├── kernel ├── boot.c ├── panic.c ├── resources-authorization.c ├── main.c ├── pxe.c ├── data-runtime.c ├── OSI-data-link-MAC.c ├── data-persistent.c └── OSI-data-link-connection-pool.c ├── services ├── thing-000 │ ├── set-time-003-00000000.c │ ├── restart-005-00000000.c │ ├── shutdown-004-00000000.c │ ├── get-thing-public-key-000-00000000.c │ ├── sign-by-thing-private-key-001-00000000.c │ └── get-time-002-00000000.c ├── apps-002 │ ├── get-user-apps-id-000-00000000.c │ ├── start-app-002-00000000.c │ ├── get-app-config-003-00000000.c │ └── register-user-app-001-00000000.c ├── storage-003 │ ├── set-object-001-00000000.c │ └── get-object-000-00000000.c ├── users-001 │ ├── get-users-id-000-00000000.c │ ├── register-user-003-00000000.c │ ├── get-user-public-key-001-00000000.c │ └── sign-by-user-private-key-002-00000000.c ├── ui-004 │ ├── send-alert-002-00000000.c │ ├── lock-device-000-00000000.c │ ├── send-notification-001-00000000.c │ └── active-app-0003-00000000.c └── hardware-005 │ ├── get-battery-info-000-00000000.c │ ├── operates-the-vibrator-001-00000000.c │ └── send-network-packet-002-00000000.c ├── doc ├── scheduler.md ├── command.md └── architecture.md ├── LEGAL ├── README.md └── LICENSE /kernel/boot.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | -------------------------------------------------------------------------------- /kernel/panic.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | -------------------------------------------------------------------------------- /kernel/resources-authorization.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | -------------------------------------------------------------------------------- /services/thing-000/set-time-003-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | -------------------------------------------------------------------------------- /kernel/main.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | int main() 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /services/apps-002/get-user-apps-id-000-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | -------------------------------------------------------------------------------- /services/storage-003/set-object-001-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | -------------------------------------------------------------------------------- /services/users-001/get-users-id-000-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | -------------------------------------------------------------------------------- /services/thing-000/restart-005-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // restart device -------------------------------------------------------------------------------- /kernel/pxe.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // https://en.wikipedia.org/wiki/Preboot_Execution_Environment 4 | -------------------------------------------------------------------------------- /services/ui-004/send-alert-002-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Send alert for user attention! 4 | -------------------------------------------------------------------------------- /services/hardware-005/get-battery-info-000-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Get battery status, level,... -------------------------------------------------------------------------------- /services/ui-004/lock-device-000-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Send notification to OS notification center! 4 | -------------------------------------------------------------------------------- /services/apps-002/start-app-002-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Start by app uuid by user request or schedule! 4 | -------------------------------------------------------------------------------- /services/hardware-005/operates-the-vibrator-001-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Operates the vibrator with desire pattern! -------------------------------------------------------------------------------- /services/ui-004/send-notification-001-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Send notification to OS notification center! 4 | -------------------------------------------------------------------------------- /services/hardware-005/send-network-packet-002-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // use to send low level network like mac packet! -------------------------------------------------------------------------------- /services/thing-000/shutdown-004-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Turn off device with stage all thing (like hibernate in windows) -------------------------------------------------------------------------------- /services/ui-004/active-app-0003-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Show app with desire size or position (PiP - Picture in Picture) 4 | -------------------------------------------------------------------------------- /services/thing-000/get-thing-public-key-000-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Get public key to any app request. 4 | [32] unsigned char GetThingPublicKey() {}; 5 | -------------------------------------------------------------------------------- /services/users-001/register-user-003-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Store public & private key of User. 4 | static[32] char userPublicKey, userPrivateKey; 5 | -------------------------------------------------------------------------------- /services/thing-000/sign-by-thing-private-key-001-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Sign requested data by private key. 4 | [32] unsigned char SignByThingPrivateKey() {}; -------------------------------------------------------------------------------- /services/users-001/get-user-public-key-001-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Get user public key to any app request. 4 | [32] unsigned char GetUserPublicKey() {}; 5 | -------------------------------------------------------------------------------- /services/users-001/sign-by-user-private-key-002-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Sign requested data by private key. 4 | [32] unsigned char SignByUserPrivateKey() {}; 5 | -------------------------------------------------------------------------------- /kernel/data-runtime.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Store & retrieve all runtime data here. Data will gone on reboot for any reason even failure! 4 | // Just for services access not outer OS scope. 5 | -------------------------------------------------------------------------------- /services/storage-003/get-object-000-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | /* 4 | Each object belong to one app indicate by app UUID. 5 | just related app can get object from storage engine. 6 | */ 7 | -------------------------------------------------------------------------------- /doc/scheduler.md: -------------------------------------------------------------------------------- 1 | # Scheduler 2 | Each app run in isolate resources. 3 | 4 | ## Thread 5 | - Each app can get threads by request in the OS image manifest for each CPU cores, So thread is not as in old OS that can get in runtime by syscall! Each thread run in the same CPU core number. 6 | -------------------------------------------------------------------------------- /services/thing-000/get-time-002-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Store date & time data for any app access. 4 | // Sync with servers, If offline from Bios||EUFI automatically. 5 | // User can change manually in Bios||EUFI just if network absent! 6 | -------------------------------------------------------------------------------- /doc/command.md: -------------------------------------------------------------------------------- 1 | # Command 2 | Command as an authoritative direction or instruction to do something must get from an app with the specific domain that must include in host OS image binary. 3 | 4 | In this way OS can run with default configs and change its behavior by that app e.g. install (run) a new app (as unikernel image) 5 | -------------------------------------------------------------------------------- /services/apps-002/get-app-config-003-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Apps can save one config object as its appID and get it anytime. 4 | // Because OS is multi user, It will save app config object in this manner: AppID+UserID 5 | // With this manner each user can run same app(same appID) with diffrent config. 6 | -------------------------------------------------------------------------------- /kernel/OSI-data-link-MAC.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | /* 4 | Some structure but in golang!! 5 | 6 | // MACDataLinkProtocol : 7 | type MACDataLinkProtocol struct { 8 | DestinationMACAddress [6]byte 9 | SourceMACAddress [6]byte 10 | EtherType [2]byte 11 | Checksum [4]byte 12 | } 13 | */ -------------------------------------------------------------------------------- /kernel/data-persistent.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | // Store & retrieve all persistent data here. Data will persistent even on reboot or failure! 4 | // Just for services access not outer OS scope. 5 | 6 | // Store public & private key of thing. 7 | struct ThingPublicKey 8 | { 9 | char PublicKey; 10 | char PrivateKey; 11 | }; -------------------------------------------------------------------------------- /LEGAL: -------------------------------------------------------------------------------- 1 | Copyright and Patent 2010-2100 Geniuses.Group 2 | 3 | Without limiting other conditions in the License, the grant of rights under the License will not include, 4 | and the License does not grant to you, right to "Sell" or "Commercial use" the Software. 5 | 6 | To "Sell" or "Commercial use", you must contact us by email to "legal@geniuses.group" and bought the commercial license. 7 | More information about the project: https://Geniuses.Group/scm?repo=persiaos 8 | 9 | For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you under the License to provide to third parties, 10 | for a fee or other consideration (including without limitation fees for hosting or consulting/ support services related to the Software), 11 | a product or service whose value derives, entirely or substantially, from the functionality of the Software. 12 | Any license notice or attribution required by the License must also include this LEGAL notice. 13 | 14 | Full license is at LICENSE file in repository 15 | -------------------------------------------------------------------------------- /kernel/OSI-data-link-connection-pool.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | /* 4 | Some structure but in golang!! 5 | 6 | // DataLinkConnectionData : 7 | type DataLinkConnectionData struct { 8 | MACAddress [6]byte // Use as Connection UUID. 9 | OwnerID uint64 // Any User Type. Can't change after creation. 10 | EncryptionKey [16]byte // 128bit encryption key 11 | MTU uint16 12 | MRU uint16 13 | IssueAt uint64 // 14 | BytesSent uint64 // Counts the bytes of payload data sent. 15 | PacketsSent uint64 // Counts packets sent. 16 | BytesReceived uint64 // Counts the bytes of payload data Receive. 17 | PacketsReceived uint64 // Counts packets Receive. 18 | Description string // 19 | } 20 | 21 | // DataLinkConnections : 22 | // --TODO-- Just one process can give new ConnectionID due concurrency problems! or lock needs 23 | var DataLinkConnections map[[6]byte]*DataLinkConnectionData 24 | */ -------------------------------------------------------------------------------- /services/apps-002/register-user-app-001-00000000.c: -------------------------------------------------------------------------------- 1 | /* For license and copyright information please see LEGAL file in repository */ 2 | 3 | /* 4 | Each app has 128bit UUID. 5 | */ 6 | 7 | /* 8 | Each app can have one 8 bit range IPv6 by user given access. 9 | IPs belong to app until app release them or app removed from os 10 | 11 | OS just support IPv6. 5 level of routing exist: 12 | - 0 to 31 bit (Global routing) 13 | - 32 to 63 bit (ISP routing) so each isp have unique IPv6 32+64 bit range! 14 | - 64 to 96 bit (Edge routing) so each edge routing have unique IPv6 32+16+16 bit range! 15 | - 97 to 112 bit (OS routing) so each os(thing) have unique IPv6 16+16 bit range! 16 | - 113 to 128 bit (App routing) so each app have unique IPv6 16 bit range! 17 | 18 | By each block OS get from upper router it is use related router-ip. 19 | */ 20 | 21 | /* 22 | when app request to specific service, OS check user given permission 23 | IP bool // Internet. Charge user if network available! 24 | Notification bool 25 | RunInBackground bool 26 | UseIPInBackground bool 27 | Camera bool 28 | Location bool // GPS, ... 29 | Speaker bool 30 | Microphone bool 31 | BodySensor bool 32 | Bluetooth bool 33 | USB bool 34 | NFC bool 35 | FingerPrint bool 36 | Vibrate bool 37 | */ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PersiaOS 2 | OS can be used by many type of devices such as servers, clients by Users Manager, PXE client, UI, ..., routers by IPv6 Sub Networking router, PXE server, ... 3 | 4 | ## Architecture 5 | Distributed Operating System on [Monolithic](https://en.wikipedia.org/wiki/Monolithic_kernel), [Unikernel](https://en.wikipedia.org/wiki/Unikernel), [Exokernel](https://en.wikipedia.org/wiki/Exokernel), [Microkernel](https://en.wikipedia.org/wiki/Microkernel) and [Container Concepts](https://en.wikipedia.org/wiki/Operating-system-level_virtualization) but not tools that use them like docker, ... concepts. Tools like docker just born because file systems and networks problem in isolation and we fix that problem on related layer not invent new tools. 6 | 7 | ## Memory Model 8 | All apps can access to Kernel shared memory by libOS(libraryOS). It will use to mux network packets, storages caches, ... without need to copy it multiple time. We must separate protection from management. 9 | 10 | ## Device Drivers 11 | Live in libOS(libraryOS) 12 | 13 | ## How to install and use 14 | Not implement yet to install or use. 15 | 16 | ## Read more about kernels concept 17 | - https://unikernel.org/ 18 | - https://www.ece.cmu.edu/~ganger/papers/exo-sosp97/exo-sosp97.html 19 | - https://keetmalin.wixsite.com/keetmalin/single-post/2017/09/01/An-Introduction-on-Exokernel-Operating-Systems 20 | - https://www.slideshare.net/hawxchen/talk-exokernel-vs-24940177 21 | - https://www.slideshare.net/VimukthiWickramasing/exokernels-group-a 22 | - https://www.inso.tuwien.ac.at/uploads/media/OSKP_MonoMicroExo.pdf 23 | - https://wiki.osdev.org 24 | - https://slideplayer.com/slide/4703158/ 25 | 26 | ### Other Implementation 27 | - https://github.com/nanovms/nanos 28 | - https://www.qubes-os.org 29 | - https://github.com/HawxChen/-LibraryOS-Exokernel_Implementation 30 | - MirageOS 31 | - IncludeOS 32 | - Solo5 33 | - https://github.com/unikraft/unikraft 34 | 35 | ## Production Ready!? 36 | This OS is under development and not ready to use in real production. It can have breakable changes until version 1 release. 37 | But we are glad to hear your experience or idea about this concept. 38 | -------------------------------------------------------------------------------- /doc/architecture.md: -------------------------------------------------------------------------------- 1 | # PersiaOS 2 | OS can be used by many type of devices such as servers, clients by Users Manager, PXE client, UI, ..., routers by IPv6 Sub Networking router, PXE server, ... 3 | 4 | ## Services 5 | All services work with [sRPC protocol](https://github.com/SabzCity/internet/blob/master/sRPC.md). You can call them from any language with related SDK. As protocol standard each service categorized to get 32 bit identifier and each exported function inside each service get next 32 bit identifier, So each exported function have 64bit unique identifier in all life time of this codebase. 6 | 7 | ## Architecture 8 | [See Architecture in Diagram](https://www.draw.io/?lightbox=1&highlight=0000ff&edit=_blank&layers=1&nav=1&title=Untitled%20Diagram.xml#R7VltT9swEP41kWASVV778pEWNhBjQxS0z27iJh5OnDkubfj1OydO28TpaKFQkCYh5Dyx73zPvfjiGs4oXnzjKI2uWYCpYZvBwnDODNvu92z4L4G8BFxvUAIhJ0EJWStgTJ6wAk2FzkiAs9pEwRgVJK2DPksS7Isahjhn8%2Fq0KaN1rSkKsQaMfUR19BcJRKTQrueuXlxgEkaVaqurDIxRNVuZkkUoYPM1yDk3nBFnTJSjeDHCVJJXEVOu%2B7rh7XJnHCdimwXKE4%2BIzpRxal8ir6ydR0TgcYp8%2BTwHhxrOMBIxhScLhiQGa0%2BztCTaBESJxFzgxcZtWUtjIUowi7HgOUxRC5yKn7zyvHqer%2Fh2egqL1qh2PQUi5eNwKXvFAgwUEe2kuBopGZo8dXwi8l3ZQRUxU7LAIH44JZSOGGW8WO4EHu4HLuCZ4OwBV28SloC8IQO5UinI2hexToNYSyfWcluIXYKvIbarERvnnc3cwmJIaUnEriy%2FE1NtEdjbA089jSfGw49KlGsejqi%2BRtT9pWF3KagYTjiMQlEY2URGLI5RAkJO9XeUQaXfRkhxuBE5uU3MCezrjGQpRZKrEUsgwVvEymk%2FmCBTECQIS9oU71Zy3iD27YHu0n5bkdiHT6vwWXPqLZsJzLfxyeWNYYMG8348LAedTuf1lL5J2tgv47i%2FB4oHz5%2F60JikckhJ8lAn4zcWIldNGZoJJs8pLiIWsgTR74yltTjEgdZLPcvQGgNeCwMVxjGFlHmsi2%2BjRWm4YQQUb%2BwxNGYzNuM%2BVqvWe6iGoO7gGUEC8RALTVDhpaXZ2%2BWGpXnuy0c9F7QDtP9%2B54Kl97W3uPQnoNcogZ41lnZ8yNLgWYcrDZbTUhtKkgLy2Cy8WYqSChsLxuWHk22eJyGB%2FlXNAY3r09bgmsDD0941D0i7%2Fs2xJe2nMxGBgY32YUvSt9Kw%2Bdzdp5ajm9mEEv8K58efPnKcllL3ZpHjvTRysjz7vOFyR2JcdniUhfU%2B79OETbPOv2vY6N%2BYbTT%2FHJefMYKTCfTgATxdwIcTbevGj8ZVI3K8Qwwc3g3NTvxd3fC%2FFTf0Vtxt9oAvbcU1Qftrxastb6q7ax7s%2FpnJ%2B9whhKg4QZSESXFjYPrAfpFI6v2%2F6t0F4sEc%2FAXLjq4wTzDd9Zh8u70ZvZH8%2Byjb%2BQkNEUw1Ze16zYkg91DPN44z8oQmxQR5IZvKOCoiyxsa3pmsT5CFWZmQRbkqLTijeCpFyTIlL4xOFSxkhsq9%2ByQJ74p0PXH3VNS8Ria0NLPLm7raDfruVQ0eV79YlKm0%2Bt3HOf8L) 9 | Distributed Operating System on [Monolithic](https://en.wikipedia.org/wiki/Monolithic_kernel), [Unikernel](https://en.wikipedia.org/wiki/Unikernel), [Exokernel](https://en.wikipedia.org/wiki/Exokernel), [Microkernel](https://en.wikipedia.org/wiki/Microkernel) and [Container Concepts](https://en.wikipedia.org/wiki/Operating-system-level_virtualization) but not tools that use them like docker, ... concepts! Tools like docker just born because file systems and networks problem in isolation and we fix that problem on related layer not invent new tools! 10 | 11 | ### User Authentication 12 | Each user must have valid public key. New CPU structures have a unique immutable key that we use to improve security. 13 | 14 | ### Services Manager 15 | Each services(application) must have validated domain space e.g. my.sabz.city 16 | 17 | #### Resources Authorization 18 | Authorization can set to specific resource on specific domain. It looks like [FreeBSD JAIL](https://en.wikipedia.org/wiki/FreeBSD_jail) or [Linux CGroups](https://en.wikipedia.org/wiki/Cgroups) or [Linux LXC](https://en.wikipedia.org/wiki/LXC) or [Docker](https://en.wikipedia.org/wiki/Docker_(software)) that implement [Operating System Level Virtualization](https://en.wikipedia.org/wiki/Operating-system-level_virtualization) 19 | Services can get minimum and maximum resource for accounting purpose e.g. RAM-min:1Gb, RAM-max:2Gb 20 | 21 | ### Data Packet Routing 22 | Read more in [internet](https://github.com/SabzCity/internet) repository 23 | 24 | #### Ethernet 25 | - OS support multi NIC (Network interface controller). OS pass frames to router service(app) that will route packets between services(app) and NICs. 26 | - OS use resource authorization mechanism to [schedule](https://en.wikipedia.org/wiki/Network_scheduler) packet in each NIC by service registration data. 27 | - OS doesn't support fragmentation in any layer. App must respect MTU value from related method and just send max packet size otherwise packet will be drop at upper layer. 28 | 29 | #### Internet 30 | - Just support dedicated [internet](https://github.com/SabzCity/internet) protocol! So every where you see IP it means dedicated IP! 31 | - Each service(app) has unique IP, So OS don't bother to do upper layer like transport layer! 32 | - OS doesn't have any local IP! Detect device MAC after ARP lookup and Maybe packet route internally! 33 | So we don't have something like localhost or 127.0.0.1 due different in architecture. 34 | 35 | #### USB 36 | Nature of [USB protocol](https://en.wikipedia.org/wiki/USB_(Communications)#Protocol_layer) have enough data to route data packet easily and secure between services and devises. 37 | 38 | #### Firewall 39 | We suggest do firewall in ::/64 subnet router network level. each IP can send block signal to router. With this approach we can have both physical and upper layer security. If abuser send data to inner network services, It will easy to locate physically and remove it from router. 40 | 41 | ## How to install and use 42 | Not implement yet to install or use! 43 | 44 | ## Read more about kernels concept 45 | - https://www.ece.cmu.edu/~ganger/papers/exo-sosp97/exo-sosp97.html 46 | - https://keetmalin.wixsite.com/keetmalin/single-post/2017/09/01/An-Introduction-on-Exokernel-Operating-Systems 47 | - https://www.slideshare.net/hawxchen/talk-exokernel-vs-24940177 48 | - https://www.slideshare.net/VimukthiWickramasing/exokernels-group-a 49 | - https://www.inso.tuwien.ac.at/uploads/media/OSKP_MonoMicroExo.pdf 50 | - https://wiki.osdev.org 51 | 52 | ### Other Implementation 53 | - https://www.qubes-os.org 54 | - https://github.com/HawxChen/-LibraryOS-Exokernel_Implementation 55 | 56 | ## Production Ready!? 57 | This OS is under development and not ready to use in real production. It can have breakable changes until version 1 release. 58 | But we are glad to hear your experience or idea about this concept. 59 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------