apache / nuttx

Apache NuttX is a mature, real-time embedded operating system (RTOS)
https://nuttx.apache.org/
Apache License 2.0
2.9k stars 1.18k forks source link

Add support to use NuttX as POSIX PSE51 system #11390

Open acassis opened 11 months ago

acassis commented 11 months ago

NuttX is a very complete POSIX RTOS, but sometimes for low end applications like some low cost automotive application POSIX standard is overwhelming.

This issue was fixed with PSE51 subset, that doesn't require many POSIX features, like file systems, etc.

Some years ago I removed many of NuttX features to make it running in a low end DIP package LPC1114 MCU, picture here: https://flickr.com/photos/79703543@N00/18013069041/in/dateposted-public/

After some time this minnsh demo was removed from NuttX mainline and many options to disable feature also were removed from kernel (option to disable FILES, VFS, etc). It is important to remove this option to disable NuttX features to make it adaptable to POSIX PSE51 standard.

xiaoxiang781216 commented 11 months ago

it's a very interesting topic, we are looking to fully support PSE51 spec.

raiden00pl commented 11 months ago

The ability to run NuttX on low cost chips would be a very cool feature, but if we're thinking about PSE51, then supporting the rest of POSIX RT profiles would be a good idea. If we could select supported POSIX profile by just setting the appropriate configuration option, it would be perfect. It's very interesting how low it's possible to go for NuttX with the required chip resources.

acassis commented 4 months ago

The POSIX missing functions can be found here: https://medium.com/@zim.kalinowski/posix-support-comparison-in-various-rtoses-b45677889ec8

acassis commented 3 days ago

@xiaoxiang781216 @raiden00pl I think we need to rollback that patches that removed the ability to disable signals, to disable VFS support, etc. The PSE51 doesn't require it. Please see the discussion at Discord: https://discord.com/channels/716091708336504884/716091708819111959

raiden00pl commented 3 days ago

I'll deal with this issue sometime at the beginning of next year. Is there any discussion or justification for removing these options (DISABLE_SIGNALS etc) in the past ? I think I saw something like this before, but I can't remember where.

EDIT: I didn't dig into it any further, but PSE51 has POSIX_SIGNALS in its requirements. So restoring DISABLE_SIGNALS is probably not an option. Zephyr has a nice doc page for this https://docs.zephyrproject.org/latest/services/portability/posix/aep/index.html