about.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. ==================
  2. About Apache NuttX
  3. ==================
  4. NuttX is a real time embedded operating system (RTOS). Its goals are:
  5. * **Small Footprint**
  6. Usable in all but the tightest micro-controller environments, the focus is on the
  7. tiny-to-small, deeply embedded environment.
  8. * **Rich Feature OS Set**
  9. The goal is to provide implementations of most standard POSIX OS interfaces to support a
  10. rich, multi-threaded development environment for deeply embedded processors.
  11. NON-GOALS: It is not a goal to provide the level of OS features like those provided by Linux. In order to work with
  12. smaller MCUs, small footprint must be more important than an extensive feature set. But standard compliance is more
  13. important than small footprint. Surely a smaller RTOS could be produced by ignoring standards. Think of NuttX is a
  14. tiny Linux work-alike with a much reduced feature set.
  15. * **Highly Scalable**
  16. Fully scalable from tiny (8-bit) to moderate embedded (64-bit). Scalability with rich feature set
  17. is accomplished with: Many tiny source files, link from static libraries, highly configurable,
  18. use of weak symbols when available.
  19. * **Standards Compliance**
  20. NuttX strives to achieve a high degree of standards compliance. The primary governing standards
  21. are POSIX and ANSI standards. Additional standard APIs from Unix and other common RTOS's are
  22. adopted for functionality not available under these standards or for functionality that is not
  23. appropriate for the deeply-embedded RTOS (such as ``fork()``).
  24. Because of this standards conformance, software developed under other standard OSs (such as
  25. Linux) should port easily to NuttX.
  26. * **Real-Time**
  27. Fully pre-emptible; fixed priority, round-robin, and "sporadic" scheduling.
  28. * **Totally Open**
  29. Non-restrictive Apache license.
  30. * **GNU Toolchains**
  31. Compatible GNU toolchains based on `buildroot <http://buildroot.uclibc.org/>`__ available for `download <https://bitbucket.org/nuttx/buildroot/downloads/>`__
  32. to provide a complete development environment for many architectures.
  33. Feature Set
  34. ===========
  35. Key features of NuttX include:
  36. * **Standards Compliant Core Task Management**
  37. * Fully pre-emptible.
  38. * Naturally scalable.
  39. * Highly configurable.
  40. * Easily extensible to new processor architectures, SoC architecture, or board architectures. :doc:`/reference/os/index` is available.
  41. * FIFO and round-robin scheduling.
  42. * Realtime, deterministic, with support for priority inheritance
  43. * Tickless Operation
  44. * POSIX/ANSI-like task controls, named message queues, counting semaphores, clocks/timers,
  45. signals, pthreads, robust mutexes, cancellation points, environment variables, filesystem.
  46. * Standard default signal actions (optional).
  47. * VxWorks-like task management and watchdog timers.
  48. * BSD socket interface.
  49. * Extensions to manage pre-emption.
  50. * Optional tasks with address environments (*Processes*).
  51. * Loadable kernel modules; lightweight, embedded shared libraries.
  52. * Memory Configurations: (1) Flat embedded build, (2) Protected build with MPU, and (3) Kernel build with MMU.
  53. * Memory Allocators: (1) standard heap memory allocation, (2) granule allocator, (3) shared memory, and
  54. (4) dynamically sized, per-process heaps.
  55. * Inheritable "controlling terminals" and I/O re-direction.
  56. * Pseudo-terminals
  57. * On-demand paging.
  58. * System logging.
  59. * May be built either as an open, flat embedded RTOS or as a separately built, secure, monolithic kernel with a
  60. system call interface.
  61. * Built-in, per-thread CPU load measurements.
  62. * Well documented in the NuttX User Guide.
  63. * **File system**
  64. * Tiny, in-memory, root pseudo-file-system.
  65. * Virtual file system (VFS) supports drivers and mountpoints.
  66. * Mount-able volumes. Bind mountpoint, filesystem, and block device driver.
  67. * Generic system logging (SYSLOG) support.
  68. * FAT12/16/32 filesystem support with optional FAT long file name support1.
  69. * NFS Client. Client side support for a Network File System (NFS, version 3, UDP).
  70. * NXFFS. The tiny NuttX wear-leveling FLASH file system.
  71. * SMART. FLASH file system from Ken Pettit.
  72. * SPIFFS. FLASH file system, originally by Peter Anderson.
  73. * LittleFS. FLASH file system from ARM mbed..
  74. * ROMFS filesystem support (XIP capable).
  75. * CROMFS (Compressed ROMFS) filesystem support.
  76. * TMPFS RAM filesystem support.
  77. * BINFS pseudo-filesystem support.
  78. * HOSTFS filesystem support (simulation only).
  79. * Union filesystem - Supports combining and overlaying file systems.
  80. * UserFS - User application file system.
  81. * ``procfs/`` pseudo-filesystem support.
  82. * :doc:`/components/binfmt` with support for the following formats:
  83. - Separately linked ELF modules.
  84. - Separately linked :doc:`/components/nxflat` modules. NXFLAT is a binary format that can be XIP from a
  85. file system.
  86. - "Built-In" applications.
  87. * PATH variable support.
  88. * File transfers via TFTP and FTP (``get`` and ``put``), HTML (``wget``), and Zmodem (``sz``
  89. and ``rz``). Intel HEX file conversions.
  90. * FAT long file name support may be subject to certain Microsoft patent restrictions if enabled.
  91. See the top-level ``NOTICE`` file for details.
  92. * **Device Drivers**
  93. * Supports character and block drivers as well as specialized driver interfaces.
  94. * Full VFS integration. Asynchronous I/O (AIO)
  95. * Network, USB (host), USB (device), serial, I2C, I2S, NAND, CAN, ADC, DAC, PWM, Quadrature Encoder, I/O Expander, Wireless,
  96. generic timer, and watchdog timer driver architectures.
  97. * RAMDISK, pipes, FIFO, ``/dev/null``, ``/dev/zero``, ``/dev/random``, and loop drivers.
  98. * Generic driver for SPI-based or SDIO-based MMC/SD/SDH cards.
  99. * Graphics: framebuffer drivers, graphic- and segment-LCD drivers. VNC server.
  100. * Audio subsystem: CODECs, audio input and output drivers. Command line and graphic media player applications.
  101. * Cryptographic subsystem.
  102. * :doc:`/components/power` sub-system.
  103. * ModBus support provided by built-in `FreeModBus <https://www.embedded-experts.at/en/freemodbus/>`__ version 1.5.0.
  104. * **C/C++ Libraries**
  105. * Standard C Library Fully integrated into the OS.
  106. * Includes floating point support via a Standard Math Library.
  107. * Add-on `uClibc++ <http://cxx.uclibc.org/>`__ module provides Standard C++ Library (LGPL).
  108. * **Networking**
  109. * Multiple network interface support; multiple network link layer support.
  110. * IPv4, IPv6, TCP/IP, UDP, ICMP, ICMPv6, IGMPv2 and MLDv1/v2 (client) stacks.
  111. * IP Forwarding (routing) support.
  112. * User space stacks.
  113. * Stream and datagram sockets.
  114. * Address Families: IPv4/IPv6 (``AF_INET``/``AF_INET6``), Raw socket (``AF_PACKET``), raw IEEE
  115. 802.15.4 (``AF_IEEE802154``), raw Bluetooth (``AF_BLUETOOTH``), and local, Unix domain socket support (``AF_LOCAL``).
  116. * Special ``INET`` protocol sockets: Raw ICMP and ICMPv6 protocol ping sockets (``IPPROTO_ICMP``/``IPPROTO_ICMP6``).
  117. * Custom user sockets.
  118. * IP Forwarding.
  119. * DNS name resolution / NetDB
  120. * IEEE 802.11 FullMac
  121. * Radio Network Drivers: IEEE 802.15.4 MAC, Generic Packet Radio, Bluetooth LE
  122. * 6LoWPAN for radio network drivers (IEEE 802.15.4 MAC and generic packet radios)
  123. * SLIP, TUN/PPP, Local loopback devices
  124. * A port cJSON
  125. * Small footprint.
  126. * BSD compatible socket layer.
  127. * Networking utilities (DHCP server and client, SMTP client, Telnet server and client, FTP server and
  128. client, TFTP client, HTTP server and client, PPPD, NTP client). Inheritable TELNET server sessions (as "controlling
  129. terminal"). VNC server.
  130. * ICMPv6 autonomous auto-configuration
  131. * NFS Client. Client side support for a Network File System (NFS, version 3, UDP).
  132. * A NuttX port of Jeff Poskanzer's `THTTPD <http://acme.com/software/thttpd>`__
  133. HTTP server integrated with the NuttX :doc:`/components/binfmt` to provide true, embedded CGI.
  134. * PHY Link Status Management.
  135. * UDP Network Discovery (Contributed by Richard Cochran).
  136. * XML RPC Server (Contributed by Richard Cochran).
  137. * Support for networking modules (e.g., ESP8266).
  138. * **FLASH Support**
  139. * *MTD*\ -inspired interface for *M*\ emory *T*\ echnology *D*\ evices.
  140. * NAND support.
  141. * *FTL*. Simple *F*\ lash *T*\ ranslation *L*\ ayer support file systems on FLASH.
  142. * Wear-Leveling FLASH File Systems: NXFFS, SmartFS, SPIFFS.
  143. * Support for SPI-based FLASH and FRAM devices.
  144. * **USB Host Support**
  145. * USB host architecture for USB host controller drivers and device-dependent USB class drivers.
  146. * USB host controller drivers available for the Atmel SAMA5Dx, NXP LPC17xx, LPC31xx, and STmicro STM32
  147. * Device-dependent USB class drivers available for USB mass storage, CDC/ACM serial, HID keyboard, and HID mouse.
  148. * Seam-less support for USB hubs.
  149. * **USB Device Support**
  150. * *Gadget*-like architecture for USB device controller drivers and device-dependent USB class drivers.
  151. * USB device controller drivers available for the most MCU architectures includeing PIC32,
  152. Atmel AVR, SAM3, SAM4, SAMv7, and SAMA5Dx, NXP/Freescale LPC17xx, LPC214x, LPC313x, LPC43xx, and
  153. Kinetis, Silicon Laboraties EFM32, STMicro STM32 F1, F2, F3, F4, and F7, TI DM320, and others.
  154. * Device-dependent USB class drivers available for USB serial (CDC/ACM and a PL2303 emulation),
  155. for USB mass storage, for USB networking (RNDIS and CDC/ECM), DFU, and for a dynamically
  156. configurable, composite USB devices.
  157. * Built-in :doc:`/guides/usbtrace` and USB host trace functionality for non-invasive USB debug.
  158. * **Graphics Support**
  159. * Framebuffer drivers.
  160. * Graphic LCD drivers for both parallel and SPI LCDs and OLEDs.
  161. * Segment LCD drivers.
  162. * VNC Server.
  163. * ``mmap``-able, framebuffer character driver.
  164. * NX: A graphics library, tiny windowing system and tiny font support that works with either
  165. framebuffer or LCD drivers. Documented in the :doc:`/components/nxgraphics/index` manual.
  166. * Font management sub-system.
  167. * :doc:`/components/nxwidgets`: NXWidgets is library of graphic objects, or "widgets," (labels,
  168. buttons, text boxes, images, sliders, progress bars, etc.). NXWidgets is written in C++ and
  169. integrates seamlessly with the NuttX NX graphics and font management subsystems.
  170. * NxWM is the tiny NuttX window manager based on NX and NxWidgets.
  171. * **Input Devices**
  172. * Touchscreen, USB keyboard, GPIO-based buttons and keypads.
  173. * **Analog Devices**
  174. * Support for Analog-to-Digital conversion (ADC), Digital-to-Analog conversion (DAC), multiplexers, and
  175. amplifiers.
  176. * **Motor Control**
  177. * Pulse width modulation (PWM) / Pulse count modulation.
  178. * **NuttX Add-Ons**.
  179. The following packages are available to extend the basic NuttX feature set:
  180. * **NuttShell (NSH)**
  181. A small, scalable, bash-like shell for NuttX with rich feature set and small footprint. See the :doc:`/applications/nsh/index`.
  182. * **BAS 2.4**
  183. Seamless integration of Michael Haardt's BAS 2.4: "Bas is an interpreter for the classic dialect of the programming language BASIC. It is pretty compatible to typical BASIC interpreters of the 1980s, unlike some other UNIX BASIC interpreters, that implement a different syntax, breaking compatibility to existing programs. Bas offers many ANSI BASIC statements for structured programming, such as procedures, local variables and various loop types. Further there are matrix operations, automatic LIST indentation and many statements and functions found in specific classic dialects. Line numbers are not required."
  184. Look at all those files and features... How can it be a tiny OS?
  185. ================================================================
  186. The NuttX feature list (above) is fairly long and if you
  187. look at the NuttX source tree, you will see that there are hundreds of source files comprising NuttX. How can NuttX be a tiny
  188. OS with all of that?
  189. * **Lots of Features -- More can be smaller!**
  190. The philosophy behind that NuttX is that lots of features are great... *BUT* also that if you
  191. don't use those features, then you should not have to pay a penalty for the unused features.
  192. And, with NuttX, you don't! If you don't use a feature, it will not be included in the final
  193. executable binary. You only have to pay the penalty of increased footprint for the features that
  194. you actually use.
  195. Using a variety of technologies, NuttX can scale from the very tiny to the moderate-size system.
  196. I have executed NuttX with some simple applications in as little as 32K *total* memory (code and
  197. data). On the other hand, typical, richly featured NuttX builds require more like 64K (and
  198. if all of the features are used, this can push 100K).
  199. * **Many, many files -- More really is smaller!**
  200. One may be intimidated by the size NuttX source tree. There are hundreds of source files! How can
  201. that be a tiny OS? Actually, the large number of files is one of the tricks to keep NuttX small
  202. and as scalable as possible. Most files contain only a single function. Sometimes just one tiny
  203. function with only a few lines of code. Why?
  204. - **Static Libraries**.
  205. Because in the NuttX build processed, objects are compiled and saved into *static libraries*
  206. (*archives*). Then, when the file executable is linked, only the object files that are
  207. needed are extracted from the archive and added to the final executable. By having many,
  208. many tiny source files, you can assure that no code that you do not execute is ever
  209. included in the link. And by having many, tiny source files you have better granularity --
  210. if you don't use that tiny function of even just a few lines of code, it will not be
  211. included in the binary.
  212. * **Other Tricks**
  213. As mentioned above, the use of many, tiny source files and linking from static libraries
  214. keeps the size of NuttX down. Other tricks used in NuttX include:
  215. - **Configuration Files**.
  216. Before you build NuttX, you must provide a configuration file that specifies what features you plan to use and
  217. which features you do not. This configuration file contains a long list of settings that control what is
  218. built into NuttX and what is not. There are hundreds of such settings (see the
  219. `Configuration Variable Documentation <https://cwiki.apache.org/confluence/display/NUTTX/Configuration+Variables?src=contextnavpagetreemode>`__
  220. for a partial list that excludes platform specific settings). These many, many configuration options allow
  221. NuttX to be highly tuned to meet size requirements. The downside to all of these configuration options is that
  222. it greatly complicates the maintenance of NuttX -- but that is my problem, not yours. -
  223. - **Weak Symbols**
  224. The GNU toolchain supports *weak* symbols and these also help to keep the size of NuttX down.
  225. Weak symbols prevent object files from being drawn into the link even if they are accessed from source code.
  226. Careful use of weak symbols is another trick for keep unused code out of the final binary.