filesystems.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>Storage &amp; Filesystems | NebOS Architecture</title>
  7. <meta name="description" content="NebOS filesystems: the VFS fs_ops layer, FAT12/16/32, the command-pack ramfs pipeline, the writable /share and persistent /data filesystems, and the WebDAV view of the VFS.">
  8. <link rel="icon" href="favicon.svg" type="image/svg+xml">
  9. <link rel="stylesheet" href="style.css">
  10. </head>
  11. <body>
  12. <a class="skip" href="#main">Skip to content</a>
  13. <header class="site-header">
  14. <a class="brand" href="index.html">
  15. <span class="brand-mark" aria-hidden="true"></span>
  16. <span>NebOS <span class="brand-sub">Architecture</span></span>
  17. </a>
  18. <nav class="site-nav" aria-label="Architecture sections">
  19. <a href="index.html">Overview</a>
  20. <a href="boot.html">Boot</a>
  21. <a href="memory.html">Memory</a>
  22. <a href="cpu.html">CPU</a>
  23. <a href="drivers.html">Drivers</a>
  24. <a href="filesystems.html" aria-current="page">Filesystems</a>
  25. <a href="graphics.html">Graphics</a>
  26. <a href="network.html">Network</a>
  27. <a href="userland.html">Userland</a>
  28. <a href="development.html">Development</a>
  29. </nav>
  30. </header>
  31. <main id="main" class="page">
  32. <div class="page-head">
  33. <p class="kicker">Storage &amp; filesystems</p>
  34. <h1>One VFS, three very different backends.</h1>
  35. <p class="lede">
  36. The kernel keeps filesystem policy thin: a mount table and an
  37. <code>fs_ops</code> vtable. FAT provides persistent read/write storage,
  38. the command-pack ramfs is a read-only system image, and
  39. <code>/share</code> is a writable RAM filesystem for network uploads;
  40. an installed disk adds a persistent FAT data volume at
  41. <code>/data</code>.
  42. </p>
  43. <div class="meta">
  44. <span class="pill">FAT12/16/32</span>
  45. <span class="pill">read-only ramfs</span>
  46. <span class="pill">/share · 16 MB</span>
  47. <span class="pill">/data · persistent</span>
  48. <span class="pill">WebDAV</span>
  49. </div>
  50. </div>
  51. <nav class="toc" aria-label="On this page">
  52. <h2>On this page</h2>
  53. <ul>
  54. <li><a href="#vfs">VFS layer</a></li>
  55. <li><a href="#fat">FAT</a></li>
  56. <li><a href="#ramfs">ramfs &amp; the command pack</a></li>
  57. <li><a href="#share">/share</a></li>
  58. <li><a href="#data">/data</a></li>
  59. <li><a href="#sysfs">File service ABI</a></li>
  60. <li><a href="#webdav">WebDAV</a></li>
  61. <li><a href="#capacity">Capacity chart</a></li>
  62. <li><a href="#limits">Limits</a></li>
  63. <li><a href="#sources">Source map</a></li>
  64. </ul>
  65. </nav>
  66. <section id="vfs">
  67. <h2>VFS layer</h2>
  68. <p>
  69. <span class="file">vfs.c</span> mounts every detected FAT device under
  70. <code>/</code>, keeps the two memory filesystems available throughout
  71. the boot scan, and dispatches file operations through
  72. <code>struct fs_ops</code>. The shell, the file service and the
  73. WebDAV server never call <code>fat_*</code> directly.
  74. </p>
  75. <figure class="figure">
  76. <svg viewBox="0 0 920 330" role="img" aria-labelledby="vfs-title vfs-desc">
  77. <title id="vfs-title">VFS and filesystem backends</title>
  78. <desc id="vfs-desc">The shell, sys_fs and WebDAV use the VFS mount table, which dispatches to FAT, ramfs or share through fs_ops. FAT sits on the block-device registry.</desc>
  79. <rect class="svg-box blue" x="30" y="30" width="200" height="60" rx="9"/>
  80. <text class="svg-text" x="50" y="56">shell / commands</text>
  81. <text class="svg-sub" x="50" y="76">ls, cat, save, files</text>
  82. <rect class="svg-box blue" x="255" y="30" width="200" height="60" rx="9"/>
  83. <text class="svg-text" x="275" y="56">sys_fs · WebDAV</text>
  84. <text class="svg-sub" x="275" y="76">ring-3 file service</text>
  85. <rect class="svg-box accent" x="485" y="30" width="200" height="60" rx="9"/>
  86. <text class="svg-text" x="505" y="56">vfs.c</text>
  87. <text class="svg-sub" x="505" y="76">mount table · fs_ops</text>
  88. <path class="svg-line blue" d="M230 60h18"/>
  89. <path class="svg-line blue" d="M240 54l7 6-7 6"/>
  90. <path class="svg-line blue" d="M455 60h23"/>
  91. <path class="svg-line blue" d="M470 54l7 6-7 6"/>
  92. <rect class="svg-box green" x="712" y="30" width="180" height="60" rx="9"/>
  93. <text class="svg-text" x="732" y="56">directory cache</text>
  94. <text class="svg-sub" x="732" y="76">last 64 FAT entries</text>
  95. <path class="svg-line accent" d="M685 60h20"/>
  96. <path class="svg-line accent" d="M697 54l7 6-7 6"/>
  97. <rect class="svg-box" x="30" y="150" width="200" height="64" rx="9"/>
  98. <text class="svg-text" x="50" y="176">FAT12/16/32</text>
  99. <text class="svg-sub" x="50" y="196">read + write · 8.3 names</text>
  100. <rect class="svg-box" x="255" y="150" width="200" height="64" rx="9"/>
  101. <text class="svg-text" x="275" y="176">ramfs</text>
  102. <text class="svg-sub" x="275" y="196">read-only · command pack</text>
  103. <rect class="svg-box" x="485" y="150" width="200" height="64" rx="9"/>
  104. <text class="svg-text" x="505" y="176">/share</text>
  105. <text class="svg-sub" x="505" y="196">writable · RAM only</text>
  106. <rect class="svg-box" x="30" y="252" width="200" height="58" rx="9"/>
  107. <text class="svg-text" x="50" y="277">block devices</text>
  108. <text class="svg-sub" x="50" y="297">floppy · ide · sata</text>
  109. <path class="svg-line" d="M585 90v28"/>
  110. <path class="svg-line" d="M130 118h455"/>
  111. <path class="svg-line" d="M130 118v24"/>
  112. <path class="svg-line" d="M355 118v24"/>
  113. <path class="svg-line" d="M585 118v24"/>
  114. <path class="svg-line" d="M124 143l6 7 6-7"/>
  115. <path class="svg-line" d="M349 143l6 7 6-7"/>
  116. <path class="svg-line" d="M579 143l6 7 6-7"/>
  117. <path class="svg-line" d="M130 214v26"/>
  118. <path class="svg-line" d="M124 240l6 7 6-7"/>
  119. </svg>
  120. <figcaption>
  121. <strong>Same operations, different storage.</strong> Each backend
  122. implements read, load/release, stat, write, unlink, mkdir, rmdir and
  123. index-based directory listing. Paths passed to the backend are
  124. relative to the mount; the VFS has already normalised them.
  125. </figcaption>
  126. </figure>
  127. <p>
  128. <code>vfs_resolve()</code> drops <code>.</code> components, collapses
  129. and trims slashes, and resolves <code>..</code> against the mount.
  130. The shell's working directory is per-process and inherited across
  131. commands, so relative paths keep working after <code>cd</code>.
  132. </p>
  133. </section>
  134. <section id="fat">
  135. <h2>FAT</h2>
  136. <p>
  137. <span class="file">fat.c</span> supports FAT12, FAT16 and FAT32 on
  138. any registered block device. It reads the BPB, validates the media
  139. byte and mounts partitions as separate entries such as
  140. <code>ide0p1</code>, <code>sata0p2</code> or <code>usb0p1</code>.
  141. USB mass-storage devices are registered by
  142. <span class="file">usbmsc.c</span> and mount exactly like an
  143. internal disk; the <code>install</code> command is separate and
  144. clones raw image sectors without parsing FAT.
  145. </p>
  146. <ul>
  147. <li><strong>Read/write.</strong> Read, write, delete, mkdir and rmdir are implemented; FAT32 allocation uses an FSInfo-seeded free-cluster hint.</li>
  148. <li><strong>8.3 names.</strong> The on-disk name is the canonical one. The shell and <code>files</code> display the space-padded form; a long name cannot be created.</li>
  149. <li><strong>Directory cache.</strong> The last FAT directory's first 64 entries are cached in <code>vfs.c</code>, so WebDAV's index sequence is one walk instead of N. Any write invalidates the cache.</li>
  150. <li><strong>Serialization.</strong> A file operation runs in a non-preemptible section because the FAT driver has static state and the floppy needs IRQ 6; <code>vfs_scan_busy</code>/<code>format_busy</code> make it sleep first while a mount scan or a format owns the disks. A format releases the BKL for its raw-sector loop, and only disk-backed mounts wait for it, so <code>/ramfs</code> and <code>/share</code> stay usable. A rescan (the <code>bootscan</code> thread or the <code>storage</code> command) re-adds <code>/ramfs</code>/<code>/share</code> first and is skipped by their operations too (<code>vfs_mount_is_ram</code>); it runs preemptible, and the floppy/ATA/AHCI/SDHCI wait loops call <code>vfs_scan_poll</code>/<code>vfs_scan_relax</code>, which sleep (dropping the BKL) once a wait passes 2 ms and only for the scan's owning process, so <code>storage</code> no longer freezes the WM. The floppy probe is skipped for a drive whose CMOS type (register <code>0x10</code>) is 0.</li>
  151. </ul>
  152. <p>
  153. <span class="file">fatdetect.c</span> and <span class="file">fatformat.c</span>
  154. back the <code>format</code> command. A disk can be formatted in
  155. binary units (<code>format ide0 100mb</code>, <code>1gb</code>) or
  156. whole-disk; the Chromebook eMMC is <code>format mmc0</code>.
  157. </p>
  158. <div class="warn">
  159. <p><strong>FAT32 limits.</strong> The FSInfo free-count is not updated,
  160. and a completely full FAT32 directory is not grown: new cluster
  161. allocation for directories is not implemented.</p>
  162. </div>
  163. </section>
  164. <section id="ramfs">
  165. <h2>ramfs &amp; the command pack</h2>
  166. <p>
  167. The system root is a compressed command pack, not a disk image. Every
  168. ring-3 command is a static ELF linked at <code>0x40000000</code>,
  169. packed as <code>bin/&lt;name&gt;</code>, gzipped and wrapped in a
  170. one-sector <code>NBROOT1</code> header. At boot the path loads the
  171. pack into RAM and <span class="file">ramfs.c</span> inflates it into a
  172. private page-allocated copy mounted read-only at <code>/ramfs</code>.
  173. The whole-buffer helpers in <span class="file">inflate.c</span>
  174. (<code>inflate_gzip_mem</code> and friends, also used by the image
  175. decoders) decode with 10-bit Huffman lookup tables straight into the
  176. output buffer and checksum once at the end, about five times faster
  177. than the bit-at-a-time streaming decoder that HTTP bodies still use.
  178. </p>
  179. <figure class="figure">
  180. <svg viewBox="0 0 920 312" role="img" aria-labelledby="pack-title pack-desc">
  181. <title id="pack-title">Command pack build and boot pipeline</title>
  182. <desc id="pack-desc">ucmd ELFs are packed by mkpack, gzipped, wrapped by mkrootfs, loaded by the boot path into RAM, then inflated by ramfs_init and mounted at /ramfs.</desc>
  183. <rect class="svg-box" x="20" y="26" width="150" height="64" rx="9"/>
  184. <text class="svg-text" x="40" y="52">ucmd_*.c</text>
  185. <text class="svg-sub" x="40" y="72">42 UCMDS + 3 app ELFs</text>
  186. <rect class="svg-box" x="196" y="26" width="150" height="64" rx="9"/>
  187. <text class="svg-text" x="216" y="52">mkpack</text>
  188. <text class="svg-sub" x="216" y="72">NBPAK1 · bin/name</text>
  189. <rect class="svg-box" x="372" y="26" width="150" height="64" rx="9"/>
  190. <text class="svg-text" x="392" y="52">gzip -12</text>
  191. <text class="svg-sub" x="392" y="72">cmds_pack_gz.bin</text>
  192. <rect class="svg-box" x="548" y="26" width="150" height="64" rx="9"/>
  193. <text class="svg-text" x="568" y="52">mkrootfs</text>
  194. <text class="svg-sub" x="568" y="72">NBROOT1 header</text>
  195. <rect class="svg-box green" x="724" y="26" width="174" height="64" rx="9"/>
  196. <text class="svg-text" x="744" y="52">boot path</text>
  197. <text class="svg-sub" x="744" y="72">pack_addr / pack_size</text>
  198. <path class="svg-line" d="M170 58h16"/>
  199. <path class="svg-line" d="M180 52l7 6-7 6"/>
  200. <path class="svg-line" d="M346 58h16"/>
  201. <path class="svg-line" d="M356 52l7 6-7 6"/>
  202. <path class="svg-line" d="M522 58h16"/>
  203. <path class="svg-line" d="M532 52l7 6-7 6"/>
  204. <path class="svg-line green" d="M698 58h16"/>
  205. <path class="svg-line green" d="M708 52l7 6-7 6"/>
  206. <rect class="svg-box" x="390" y="150" width="170" height="64" rx="9"/>
  207. <text class="svg-text" x="410" y="176">ramfs_init</text>
  208. <text class="svg-sub" x="410" y="196">inflate + validate</text>
  209. <rect class="svg-box accent" x="620" y="150" width="200" height="64" rx="9"/>
  210. <text class="svg-text" x="640" y="176">/ramfs</text>
  211. <text class="svg-sub" x="640" y="196">read-only · bin/command</text>
  212. <path class="svg-line green" d="M810 90v40h-335v20"/>
  213. <path class="svg-line green" d="M469 142l6 7 6-7"/>
  214. <path class="svg-line" d="M560 182h52"/>
  215. <path class="svg-line" d="M606 176l7 6-7 6"/>
  216. <text class="svg-tiny" x="20" y="272">Runtime replacement: KXNP packs replace /ramfs in place.</text>
  217. <text class="svg-tiny" x="20" y="290">Existing processes keep their loaded ELFs.</text>
  218. </svg>
  219. <figcaption>
  220. <strong>The pack is the root filesystem.</strong> The kernel no
  221. longer embeds it, so command growth does not move <code>_end</code>.
  222. The high-memory legacy loader caps the compressed pack at 1 MB;
  223. the 8 MB rootfs partition and ramfs cap remain the larger limits.
  224. </figcaption>
  225. </figure>
  226. <div class="table-wrap">
  227. <table>
  228. <thead>
  229. <tr><th>Container</th><th>Format</th><th>Purpose</th></tr>
  230. </thead>
  231. <tbody>
  232. <tr><td><code>cmds.pack</code></td><td><code>NBPAK1</code></td><td>Raw command archive: <code>bin/&lt;name&gt;</code> entries.</td></tr>
  233. <tr><td><code>cmds_pack_gz.bin</code></td><td>gzip</td><td>Compressed pack; <code>libdeflate-gzip -12</code> when available.</td></tr>
  234. <tr><td><code>rootfs.bin</code></td><td><code>NBROOT1</code> + gzip</td><td>Floppy append (header + pack).</td></tr>
  235. <tr><td><code>cmds.img</code></td><td><code>NBROOT1</code> padded to 8 MB</td><td>USB rootfs partition image.</td></tr>
  236. <tr><td><code>rootfs-full.bin</code></td><td><code>NBROOT1</code> + full gzip</td><td>Network persistent-install payload.</td></tr>
  237. <tr><td><code>/share</code></td><td>RAM entries</td><td>Writable upload target; not part of the pack.</td></tr>
  238. <tr><td><code>/data</code></td><td>FAT32/16, label <code>NEBOSDATA</code></td><td>Partition 4 on the installed disk; persistent user files.</td></tr>
  239. </tbody>
  240. </table>
  241. </div>
  242. <p>
  243. The pack build is part of the normal Makefile. Add a
  244. <code>ucmd_&lt;name&gt;.c</code> to <code>UCMDS</code> and the pack,
  245. the mount and the PATH listing pick it up automatically. Runtime
  246. replacement uses <code>make cmds-dev</code> or
  247. <code>make net-cmds</code> and validates the pack before swapping it.
  248. </p>
  249. </section>
  250. <section id="share">
  251. <h2>/share</h2>
  252. <p>
  253. <span class="file">share.c</span> is a writable, page-backed in-memory
  254. filesystem for network uploads. It matters on boards with no writable
  255. disk, or when the only writable medium is a floppy. Entries are full
  256. relative paths plus explicit directory entries, so empty directories
  257. work; names are plain strings up to 63 bytes.
  258. </p>
  259. <ul>
  260. <li><strong>Limits.</strong> 64 entries and 16 MB total, allocated as pages and freed on replace/delete.</li>
  261. <li><strong>Volatile.</strong> A reboot or kexec starts empty.</li>
  262. <li><strong>Mount point.</strong> <code>/share</code>, listed by <code>ls /</code> and visible in <code>files</code>.</li>
  263. <li><strong>Writable by anyone on the LAN.</strong> The WebDAV server has no authentication.</li>
  264. </ul>
  265. </section>
  266. <section id="data">
  267. <h2>/data</h2>
  268. <p>
  269. The installer creates a fourth partition after the 8 MB ESP and
  270. formats it as FAT with the label <code>NEBOSDATA</code>. It fills
  271. the rest of the disk and is mounted at <code>/data</code>; the VFS
  272. recognises the label in the FAT boot sector, not the device name, so
  273. the path is stable on <code>mmc0</code>, <code>sata0</code> or
  274. <code>ide0</code>.
  275. </p>
  276. <ul>
  277. <li><strong>Persistent.</strong> A reinstall or <code>install &lt;target&gt; self</code> replaces the OS partitions (P1 kernel, P2 rootfs pack, P3 ESP) and keeps P4. <code>net-install</code> writes only P1/P2.</li>
  278. <li><strong>First install is destructive.</strong> Creating P4 formats the rest of the target disk; an existing <code>NEBOSDATA</code> volume is detected and left untouched.</li>
  279. <li><strong>8.3 names.</strong> The FAT driver creates and reads short names only; long names need VFAT LFN write support.</li>
  280. <li><strong>WiFi credentials.</strong> A successful WiFi connect stores the SSID/passphrase in <code>WIFI.CFG</code>; the boot-time <code>wifi autoconnect</code> helper reads it. The file is plaintext and 8.3, like the rest of the volume.</li>
  281. <li><strong>Fixed start.</strong> P4 starts at LBA 34816. A BIOS-only install leaves the space between P2 and P4 unpartitioned, and a later disk clone does not resize P4.</li>
  282. <li><strong>No fsck.</strong> Like the other FAT mounts, the volume has no journal, repair tool or permissions; it is writable by every process.</li>
  283. </ul>
  284. </section>
  285. <section id="sysfs">
  286. <h2>File service ABI</h2>
  287. <p>
  288. Ring-3 commands use <code>SYS_READ_FILE</code>,
  289. <code>SYS_WRITE_FILE</code>, <code>SYS_LIST_DIR</code>,
  290. <code>SYS_LIST_MOUNTS</code>, <code>SYS_UNLINK</code>,
  291. <code>SYS_MKDIR</code>, <code>SYS_RMDIR</code>,
  292. <code>SYS_FS_STAT</code> and <code>SYS_GETCWD</code>.
  293. <span class="file">sys_fs.c</span> validates the path, resolves it
  294. against the caller's cwd, calls the VFS and maps backend errors to
  295. the stable <code>SYS_E*</code> values.
  296. </p>
  297. <p>
  298. The file service reads whole files, not streams. The shell loads an
  299. ELF through <code>vfs_load_file</code> and spawns it; FAT ELFs are
  300. loaded through <code>kmalloc</code> under <code>sys_fs_enter/exit</code>,
  301. since the floppy needs IRQ 6.
  302. </p>
  303. <p>
  304. Directory entries carry a 64-byte display name plus <code>raw_83</code>,
  305. so FAT's space-padded names and the string-named memory filesystems
  306. share one ABI.
  307. </p>
  308. </section>
  309. <section id="webdav">
  310. <h2>WebDAV</h2>
  311. <p>
  312. <span class="file">websrv</span> is a ring-3 HTTP/1.1 + WebDAV server
  313. built on the kernel TCP listener. It serves the VFS:
  314. <code>/</code> lists mounts, <code>/ramfs</code> is read-only, FAT
  315. mounts accept only names that round-trip to 8.3, and
  316. <code>/share</code> and <code>/data</code> are the writable
  317. targets (RAM and persistent respectively).
  318. </p>
  319. <ul>
  320. <li><strong>Concurrency.</strong> One active connection plus a small backlog (three backlog/closing slots in the current TCP server). Parallel clients queue with a zero window until the active request finishes.</li>
  321. <li><strong>Bodies.</strong> Whole-file buffering, 4 MB normally and 1 MB when the heap cannot provide the larger buffer. A larger PUT gets 413.</li>
  322. <li><strong>Methods.</strong> GET, PUT, DELETE, MKCOL, PROPFIND and MOVE to the extent described; directory <code>MOVE</code> is 501 and <code>PROPPATCH</code> is answered 200 without persisting.</li>
  323. <li><strong>No auth.</strong> This is a trusted-LAN service; <code>/share</code> is writable by anyone who can reach it.</li>
  324. </ul>
  325. <p>
  326. The WebDAV server still takes the raw NIC lease, so it is mutually
  327. exclusive with packet-level commands and with TCP client connections
  328. (<code>curl</code> and the browser workers). Starting
  329. <code>websrv</code> while another raw owner exists fails; TCP clients
  330. fail to connect while it owns the receiver.
  331. </p>
  332. </section>
  333. <section id="capacity">
  334. <h2>Capacity chart</h2>
  335. <figure class="figure">
  336. <div class="bars" role="img" aria-label="Capacity limits: /share 16 MB, ramfs decompressed pack 8 MB, USB rootfs image 8 MB, current legacy compressed pack about 1.3 MB. Bar widths are relative to 16 MB.">
  337. <div class="bar-row">
  338. <span class="bar-label">/share</span>
  339. <div class="bar-track"><span class="bar-fill green" style="--w:100%"></span></div>
  340. <span class="bar-value">16 MB</span>
  341. </div>
  342. <div class="bar-row">
  343. <span class="bar-label">ramfs (inflated)</span>
  344. <div class="bar-track"><span class="bar-fill" style="--w:50%"></span></div>
  345. <span class="bar-value">8 MB</span>
  346. </div>
  347. <div class="bar-row">
  348. <span class="bar-label">rootfs image</span>
  349. <div class="bar-track"><span class="bar-fill blue" style="--w:50%"></span></div>
  350. <span class="bar-value">8 MB</span>
  351. </div>
  352. <div class="bar-row">
  353. <span class="bar-label">legacy pack</span>
  354. <div class="bar-track"><span class="bar-fill" style="--w:8.1%"></span></div>
  355. <span class="bar-value">~1.3 MB</span>
  356. </div>
  357. </div>
  358. <figcaption>
  359. <strong>Different limits for different paths.</strong> The legacy
  360. boot stage's compressed-pack cap is much smaller than the 8 MB
  361. ramfs cap; UEFI and kexec avoid the low-gap bottleneck.
  362. </figcaption>
  363. </figure>
  364. </section>
  365. <section id="limits">
  366. <h2>Limits</h2>
  367. <ul>
  368. <li><strong>Whole-file service.</strong> Commands read a complete file into memory; there is no stream API for general files.</li>
  369. <li><strong>FAT names.</strong> No long filename creation or lookup. WebDAV refuses names that cannot be represented exactly in 8.3.</li>
  370. <li><strong>ramfs is read-only.</strong> Writes return <code>SYS_EROFS</code>; use <code>/share</code> for volatile data and <code>/data</code> for persistent files.</li>
  371. <li><strong>Pack volatile at runtime.</strong> Runtime pack replacement is RAM only; a cold boot uses the flashed rootfs.</li>
  372. <li><strong>Directory listing cache.</strong> Only the first 64 entries of the last FAT directory are cached; a very large directory still costs a walk.</li>
  373. </ul>
  374. </section>
  375. <section id="sources">
  376. <h2>Source map</h2>
  377. <ul class="filelist">
  378. <li><code>vfs.c</code>, <code>vfs.h</code> — mounts and dispatch</li>
  379. <li><code>fat.c</code>, <code>fat.h</code> — FAT12/16/32</li>
  380. <li><code>ramfs.c</code>, <code>ramfs.h</code> — pack inflate</li>
  381. <li><code>share.c</code>, <code>share.h</code> — /share</li>
  382. <li><code>sys_fs.c</code> — ring-3 file service</li>
  383. <li><code>mkpack.c</code>, <code>mkrootfs.c</code>, <code>rootfs.h</code></li>
  384. <li><code>inflate.c</code> — DEFLATE/gzip</li>
  385. <li><code>ucmd_websrv.c</code> — HTTP/WebDAV</li>
  386. <li><code>fatdetect.c</code>, <code>fatformat.c</code> — format</li>
  387. <li><code>usbmsc.c</code>, <code>usbmsc.h</code> — USB mass-storage block devices</li>
  388. <li><code>install.c</code>, <code>install.h</code> — clone, self-update and net-install writer</li>
  389. <li><code>rootfs.h</code> — installed image geometry and NBROOT1 header</li>
  390. </ul>
  391. </section>
  392. </main>
  393. <footer class="site-footer">
  394. <div class="inner">
  395. <p><strong>NebOS 0.2.0</strong> · Architecture documentation · <a href="index.html">overview</a></p>
  396. <p>Maintain alongside <code>AGENTS.md</code> and the source files listed on each page.</p>
  397. </div>
  398. </footer>
  399. </body>
  400. </html>