NuttX

NuttX is another open source, real-time operating system for embedded devices, portable across a number of different platforms and architectures. Its first goal is the compliance to the POSIX and ANSI standards, and it provides quite an extensive set of interfaces, libraries, and command-line tools to offer a broad compatibility with existing software originally written for other platforms, and supports effective system management through standard tools.

Each feature, including the scheduler internals, can be enabled and tuned separately at compile time. This means that the same code base can produce small, static, and flat RTOS as well as feature-rich POSIX systems for high-end microprocessors with actual process separation through virtual memory management. NuttX integrates a TCP/IP stack in kernel space that is based on Contiki's uIP, and it has a well-designed power management, supporting stop and standby modes, which makes it a competitor in the low-power IoT systems category.

The user space includes a basic set of command-line tools integrated in the shell, which allows users to interact with the system. The APIs devices, peripherals, process management, and network communication are as close as possible to those defined by POSIX, and an interface is provided for standard C library calls from the applications.

On Cortex-M, by default, NuttX is built in flat mode, with no memory separation among tasks, and between applications and the kernel. The system calls are invoked directly by the applications and executed in place, and there is no switch between kernel and thread mode.

The separation between kernel and userland is activated by building the system in protected mode. The system calls are invoked by the applications by using an SVCall interrupt to directly request a context switch. The system provides two types of execution units: threads, using the default pthread interface, and tasks, an approximation of the POSIX process, adapted to fit the implementation. If the system is compiled to run in protected mode, user applications are not supposed to access any functionality present in the drivers or other components of the system other than requesting the operation to be performed by the kernel through the system call interface. That guarantees the separation of the stack spaces, and allows the kernel to supervise and coordinate the access to all the important system resources. Some of the task management operations, such as task termination and signal handling, are simplified and slightly diverge from the standards, to still be able to guarantee acceptable and measurable deadlines for real-time operations on microcontrollers.

The NuttX kernel is distributed with a wide selection of drivers, a set of embedded-tailored filesystems, and a complete userspace, with a command-line shell, NuttX Shell (NSH), integrating some of the default built-in tools expected in a UNIX-like system, but developed considering the right compromises to produce a system that is still usable in real-time contexts.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.196.217