zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.63k stars 6.51k forks source link

os: add zephyr virtual filesystem (zvfs) api #72894

Open cfriedt opened 4 months ago

cfriedt commented 4 months ago

Is your enhancement proposal related to a problem? Please describe.

As part of the POSIX Roadmap for LTSv3, we should implement a common abstraction for FILE * and int file descriptors that can be used throughout Zephyr applications.

Describe the solution you'd like

The abstraction serves to support

and should call into existing Zephyr subsystems such as Networking and Filesystem, which are part of Zephyr.

Other APIs such as POSIX, and C should call into ZVFS and not the opposite in order to eliminate API-level dependency cycles and to provide a more fully-featured and standard-conformant API.

Describe alternatives you've considered

Additional context

There are a number of other issues currently assigned to the C Library highlighting missing C89 functions. Many of these should be a part of the Common C Library, as they are OS-dependent and mostly libc-independent.

https://github.com/zephyrproject-rtos/zephyr/issues?q=is%3Aopen+is%3Aissue+label%3A%22area%3A+C+Library%22+%22libc%3A+implement%22+

Details to be worked-out:

cfriedt commented 3 months ago

A fair bit of this has been done without public API already.

I'm fine not making a public API for this until post LTSv3, as it could take some time to smooth out and properly document.

cfriedt commented 3 months ago

Updated to reflect that the the posix device_io and fd_mgmt features were reverted.

This puts LTSv3 in a kind of dilapidated state from the POSIX & libc perspective.