From 6767d96e8ed5049af7b551b00d6320fbfb5dcd05 Mon Sep 17 00:00:00 2001 From: salmonik Date: Fri, 31 Jul 2026 16:31:34 +0200 Subject: vfs: everything is a file — dirs, ramfs, character devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fs.rs: node-table VFS (root /dev /tmp /etc). Regular files are in-memory ramfs; char devices regenerate content on every read so 'cat /dev/rtc' shows the live time. Nodes are stable handles with tombstone removal; . and .. path resolution. - /dev devices: mem (raw physical RAM, offset = address), rtc, pci, version, meminfo, null, zero, console (write prints to screen+serial), serial. /etc/motd static file. - shell: ls, cat, hexdump (hexdump -C style), mkdir, touch, rm; echo gains '>' overwrite and '>>' append redirection (append bug fixed: first '>' in '>>' was parsed as overwrite) - boot: fs init + self-test (create/read/write/remove) before the shell - QEMU verified: file lifecycle, redirection, console/null writes, mkdir/touch/rm, hexdump /dev/mem and /tmp/x byte-exact --- CONTEXT.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'CONTEXT.md') diff --git a/CONTEXT.md b/CONTEXT.md index 8ee7f6c..5b76eaa 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -98,6 +98,9 @@ Single Rust crate (`x86_64-unknown-uefi` target). Module breakdown: - `power.rs` — `ResetSystem`-based shutdown, hlt loop fallback - `rtc.rs` — CMOS/RTC clock (ports 0x70/0x71), BCD/12h normalization - `pci.rs` — legacy PCI config space (0xCF8/0xCFC), full enumeration +- `fs.rs` — VFS: dirs, ramfs files, char devices (`/dev/mem`, `rtc`, `pci`, + `version`, `meminfo`, `null`, `zero`, `console`, `serial`; `/tmp` ramfs; + `/etc/motd`) - `gop.rs` — framebuffer access and text rendering - `font.rs` — 8×16 bitmap font data - `ps2.rs` — PS/2 keyboard driver (polling) @@ -124,6 +127,9 @@ Single Rust crate (`x86_64-unknown-uefi` target). Module breakdown: (ACPI S5; `halt` keeps the plain hlt loop) ✅ **RTC** — CMOS clock read at boot and via `date` (BCD/12h handled) ✅ **PCI** — port-based config access, full bus enumeration via `pci` +✅ **VFS** — “everything is a file”: dirs, ramfs, char devices + (`ls`/`cat`/`hexdump`/`mkdir`/`touch`/`rm`, `echo >`/`>>`; devices + regenerate on read, `/dev/mem` is raw physical RAM) ## Target audience -- cgit v1.2.3