From 0e55e461a58da959878f1174e3d199f247055e61 Mon Sep 17 00:00:00 2001 From: Yanfeng Liu Date: Wed, 14 Feb 2024 20:53:03 +0800 Subject: [PATCH] docs/tmpfs: add initial document This adds initial document for using TMPFS based on my short experience, hoping to save people's time on guessing how to use. Signed-off-by: Yanfeng Liu --- Documentation/components/filesystem/tmpfs.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/components/filesystem/tmpfs.rst b/Documentation/components/filesystem/tmpfs.rst index 97a88bf3c5..95fda02cfc 100644 --- a/Documentation/components/filesystem/tmpfs.rst +++ b/Documentation/components/filesystem/tmpfs.rst @@ -2,4 +2,12 @@ TMPFS ===== -TMPFS filesystem. +NuttX TMPFS file system is a tiny dyamic RAM based file system. + +It can be enabled by adding ``CONFIG_FS_TMPFS=y`` to the configuration at build time. + +At runtime, simply use ``mount -t tmpfs /tmp`` to have a ``/tmp`` folder backed by TMPFS, then files and folders can be created under that folder. + +Be aware that TMPFS is backed by kernel memory thus don't expect to store big files on it and its size is limited by free kernel memory. + +We can watch the size of TMPFS with ``df -h`` command, especially you can see the ``Size`` column of TMPFS changes when files are added or removed in the TMPFS folder. Changes in TMPFS size is always reflected by reverse changes of free kernel memory size.