Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

NuttX pseudo file system

Overview

NuttX without filesystem

NuttX includes an optional, scalable file system. This file system may be omitted altogether; NuttX does not depend on the presence of any file system.

Pseudo Root File System

Or, a simple in-memory, pseudo file system can be enabled. This simple file system can be enabled setting the CONFIG_NFILE_DESCRIPTORS option to a non-zero value (see Appendix A). This is an in-memory file system because it does not require any storage medium or block driver support. Rather, file system contents are generated on-the-fly as referenced via standard file system operations (open, close, read, write, etc.). In this sense, the file system is pseudo file system (in the same sense that the Linux /proc file system is also referred to as a pseudo file system).

Any user supplied data or logic can be accessed via the pseudo-file system. Built in support is provided for character and block drivers in the /dev pseudo file system directory.

Special Files

NuttX does not support special files in the way that, say, Linux does. In fact, it is more correct to say that NuttX file systems do not support special files at all.

...

In NuttX, the underlying principle is that all named resources appear as special files in the root pseudo-file system and are managed by the VFS.

Mounted Volumes

The simple in-memory file system can be extended by mounting block devices that provide access to true file systems backed up via some mass storage device. NuttX supports the standard mount() command that allows a block driver to be bound to a mount point within the pseudo file system and to a file system. At present, NuttX supports the standard VFAT and ROMFS file systems, a special, wear-levelling NuttX FLASH File System (NXFFS), as well as a Network File System client (NFS version 3, UDP).

Comparison to Linux

From a programming perspective, the NuttX file system appears very similar to a Linux file system. However, there is a fundamental difference: The NuttX root file system is a pseudo file system and true file systems may be mounted in the pseudo file system. In the typical Linux installation by comparison, the Linux root file system is a true file system and pseudo file systems may be mounted in the true, root file system. The approach selected by NuttX is intended to support greater scalability from the very tiny platform to the moderate platform.

FAQ

Question: I'm wondering why I can't create a directory. If I try to create a dir.

...

mkdir can only work if there is a real filesystem at the location.
There are no real directories in the psuedo-filesystem.
The pseudo-filesystem does support nodes that look like directories and have some of the properties of directories (like the node /mnt mentioned above).
But this is really an illusion.
I suppose that one could add the capability to create new, empty nodes in the pseudo-filesystem using 'mkdir' –
but I am not sure that this would really serve any purpose other than completing the illusion.


Wiki Markup
\[On the other hand, all directories are really an _illusion_ in a way and I suppose that in that sense these nodes the pseudo-filesystem are just as _real_ as any other directory.]


After you mount the SD card at /mnt/sda, then you can do:

...

See also http://nuttx.org/Documentation/NuttxPortingGuide.html#NxFileSystemImage RemovedImage Added.