Apache NuttX is a mature, real-time embedded operating system (RTOS) https://nuttx.apache.org/
Find a file
hujun5 b4cc9fb11b sched: change nxsched_islocked_global to nxsched_islocked_tcb
reason:
1 To improve efficiency, we mimic Linux's behavior where preemption disabling is only applicable to the current CPU and does not affect other CPUs.
2 In the future, we will implement "spinlock+sched_lock", and use it extensively. Under such circumstances, if preemption is still globally disabled, it will seriously impact the scheduling efficiency.
3 We have removed g_cpu_lockset and used irqcount in order to eliminate the dependency of schedlock on critical sections in the future, simplify the logic, and further enhance the performance of sched_lock.
4 We set lockcount to 1 in order to lock scheduling on all CPUs during startup, without the need to provide additional functions to disable scheduling on other CPUs.
5 Cpu1~n must wait for cpu0 to enter the idle state before enabling scheduling because it prevents CPUs1~n from competing with cpu0 for the memory manager mutex, which could cause the cpu0 idle task to enter a wait state and trigger an assert.

size nuttx
before:
   text    data     bss     dec     hex filename
 265396   51057   63646  380099   5ccc3 nuttx
after:
   text    data     bss     dec     hex filename
 265184   51057   63642  379883   5cbeb nuttx

size -216

Configuring NuttX and compile:
$ ./tools/configure.sh -l qemu-armv8a:nsh_smp
$ make
Running with qemu
$ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \
   -machine virt,virtualization=on,gic-version=3 \
   -net none -chardev stdio,id=con,mux=on -serial chardev:con \
   -mon chardev=con,mode=readline -kernel ./nuttx

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-05 13:49:55 +08:00
.github build.yml: Check out the correct branch of nuttx-apps 2024-10-03 14:29:12 +08:00
arch nuttx/arch: Fix the issue where the compiler cannot recognize min-pagesize=0. 2024-10-05 08:45:08 +08:00
audio audio: add AUDIO_MSG_IOERR msg to meida service 2024-09-30 08:43:22 +08:00
binfmt coredump:add const to memory region struct ptr 2024-10-01 20:40:28 +08:00
boards sim: add windows64 defconfig 2024-10-04 08:21:35 +08:00
cmake greenhills: add cmake support 2024-10-01 11:48:09 +08:00
crypto nuttx/crypto: export asynchronous calling process 2024-09-28 13:05:28 +08:00
Documentation Create a documentation folder to list sensor drivers that are available. This way each sensor added/implemented can have its own space to define any unique ioctl commands that it uses, unique error codes and programming examples. 2024-10-03 15:36:10 -03:00
drivers mmcsd: move block driver register to probe stage in order to read ext_csd reg 2024-10-05 09:17:25 +08:00
dummy build: add initial cmake build system 2023-07-08 13:50:48 +08:00
fs fs_lock: fix cmake build error 2024-10-05 13:43:02 +08:00
graphics Revert "build depend:Revert Make.dep intermediate ddc file" 2024-09-15 19:29:47 +08:00
include sched: change nxsched_islocked_global to nxsched_islocked_tcb 2024-10-05 13:49:55 +08:00
libs sim: add windows64 setjmp/longjmp support 2024-10-04 08:21:35 +08:00
mm mm/kasan: Kasan global support setting alignment length 2024-09-20 21:47:23 +08:00
net accept4:move function from net to fs 2024-09-30 16:30:56 +08:00
openamp Revert "build depend:Revert Make.dep intermediate ddc file" 2024-09-15 19:29:47 +08:00
pass1 Revert "build depend:Revert Make.dep intermediate ddc file" 2024-09-15 19:29:47 +08:00
sched sched: change nxsched_islocked_global to nxsched_islocked_tcb 2024-10-05 13:49:55 +08:00
syscall fs/mmap/msync:support msync. 2024-09-19 01:43:50 +08:00
tools tools/testbuild.sh: Improved speed in the skipping phase 2024-10-03 08:59:04 +08:00
video Revert "build depend:Revert Make.dep intermediate ddc file" 2024-09-15 19:29:47 +08:00
wireless Revert "build depend:Revert Make.dep intermediate ddc file" 2024-09-15 19:29:47 +08:00
.asf.yaml
.gitignore add .gdb_history to .gitignore 2024-09-14 12:14:12 +08:00
.pre-commit-config.yaml Created pre-commit config file 2024-08-19 21:40:56 +02:00
.yamllint
AUTHORS AUTHORS: add Tomek CEDRO to the list 2023-03-07 14:15:55 +01:00
CMakeLists.txt sim: add link option /LARGEADDRESSAWARE:NO for windows64 2024-10-04 08:21:35 +08:00
CONTRIBUTING.md Remove the tail spaces from all files except Documentation 2023-02-26 13:24:24 -08:00
INVIOLABLES.md
Kconfig drivers/vhost: add vhost framework for NuttX 2024-10-03 17:37:40 +08:00
LICENSE drivers/i3c: support i3c driver model 2024-09-24 23:36:50 +08:00
Makefile tools: migrate to SPDX identifier 2024-09-10 23:11:11 +08:00
NOTICE Remove the double blank line from source files 2022-02-20 20:10:14 +01:00
README.md Gathering community recommendations 2023-10-28 13:55:56 +08:00
ReleaseNotes Documentation: move ReleaseNotes 2023-09-26 20:41:00 +08:00

POSIX Badge License Issues Tracking Badge Contributors GitHub Build Badge Documentation Badge

Apache NuttX is a real-time operating system (RTOS) with an emphasis on standards compliance and small footprint. Scalable from 8-bit to 64-bit microcontroller environments, the primary governing standards in NuttX are POSIX and ANSI standards. Additional standard APIs from Unix and other common RTOSs (such as VxWorks) are adopted for functionality not available under these standards, or for functionality that is not appropriate for deeply-embedded environments (such as fork()).

For brevity, many parts of the documentation will refer to Apache NuttX as simply NuttX.

Getting Started

First time on NuttX? Read the Getting Started guide! If you don't have a board available, NuttX has its own simulator that you can run on terminal.

Documentation

You can find the current NuttX documentation on the Documentation Page.

Alternatively, you can build the documentation yourself by following the Documentation Build Instructions.

The old NuttX documentation is still available in the Apache wiki.

Supported Boards

NuttX supports a wide variety of platforms. See the full list on the Supported Platforms page.

Contributing

If you wish to contribute to the NuttX project, read the Contributing guidelines for information on Git usage, coding standard, workflow and the NuttX principles.

License

The code in this repository is under either the Apache 2 license, or a license compatible with the Apache 2 license. See the License Page for more information.