Introduced GetObjectFromPathEx which tracks unconsumed path segments after hitting a DRIVE node, returning a volume-relative path alongside the VFS object. All callers (GetDirectoryListing, PathValid, ResolveFilePath) now use this instead of the old makeRelative/getAbsolutePath approach. Symlink traversal is handled inline with a configurable depth guard (MAX_SYMLINK_DEPTH = 8) and cycle detection.
Device Nodes
Added /dev/null and /dev/zero as built-in VFS device nodes with a RegisterDevice API. Device nodes support read, write, and size callbacks via a TVFSDeviceOps record. Open/Read/Write/Close all dispatch through device ops when the underlying object is otDEVICE.
Stream I/O
Merged the old TOpenMode and TWriteMode into a single TOpenMode enum (omRead, omWrite, omCreate, omReadWrite, omStream). Stream mode auto-advances the file offset on each read/write, enabling sequential I/O without manual offset tracking. Both sync and async paths support stream mode.
Symlinks
Added CreateSymlink for creating VFS symlink objects (otSYMLINK). Path resolution follows symlinks transparently with remaining path segments appended after resolution. Chained symlinks resolve up to the max depth. The file picker now includes otSYMLINK in its directory collection so symlinked directories like /sys appear and are navigable.
Declarative Boot Mounts (mount.asr)
Replaced the old asr.mnt binary blob with a human-readable mount.asr file parsed at boot. Each line is mnt {device}/path /vfs_path where {device} expands to the boot volume's mount point. Currently used to symlink /sys. The boot drive itself is now directly mounted at /boot via mountVolume in auto_mount_volumes.
Test Cleanup
VFS unit tests expanded from 77 to 104 covering symlink traversal, chained symlinks, cycle detection, symlink-to-root, device node I/O, stream mode, and watch/notify. STORTEST expanded to 34 tests with symlink traversal coverage. Both test suites now clean up after themselves via RemoveVirtualTree, and a listing leak in cmd_stortest was fixed.
Misc
Consolidated scattered type/const/var sections into single blocks. Removed unused /cfg virtual directory. Added FreeVFSObjTree and RemoveVirtualTree for proper teardown of virtual directory trees.
## Path Resolution
Introduced `GetObjectFromPathEx` which tracks unconsumed path segments after hitting a DRIVE node, returning a volume-relative path alongside the VFS object. All callers (`GetDirectoryListing`, `PathValid`, `ResolveFilePath`) now use this instead of the old `makeRelative`/`getAbsolutePath` approach. Symlink traversal is handled inline with a configurable depth guard (`MAX_SYMLINK_DEPTH = 8`) and cycle detection.
## Device Nodes
Added `/dev/null` and `/dev/zero` as built-in VFS device nodes with a `RegisterDevice` API. Device nodes support read, write, and size callbacks via a `TVFSDeviceOps` record. Open/Read/Write/Close all dispatch through device ops when the underlying object is `otDEVICE`.
## Stream I/O
Merged the old `TOpenMode` and `TWriteMode` into a single `TOpenMode` enum (`omRead`, `omWrite`, `omCreate`, `omReadWrite`, `omStream`). Stream mode auto-advances the file offset on each read/write, enabling sequential I/O without manual offset tracking. Both sync and async paths support stream mode.
## Symlinks
Added `CreateSymlink` for creating VFS symlink objects (`otSYMLINK`). Path resolution follows symlinks transparently with remaining path segments appended after resolution. Chained symlinks resolve up to the max depth. The file picker now includes `otSYMLINK` in its directory collection so symlinked directories like `/sys` appear and are navigable.
## Declarative Boot Mounts (mount.asr)
Replaced the old `asr.mnt` binary blob with a human-readable `mount.asr` file parsed at boot. Each line is `mnt {device}/path /vfs_path` where `{device}` expands to the boot volume's mount point. Currently used to symlink `/sys`. The boot drive itself is now directly mounted at `/boot` via `mountVolume` in `auto_mount_volumes`.
## Test Cleanup
VFS unit tests expanded from 77 to 104 covering symlink traversal, chained symlinks, cycle detection, symlink-to-root, device node I/O, stream mode, and watch/notify. STORTEST expanded to 34 tests with symlink traversal coverage. Both test suites now clean up after themselves via `RemoveVirtualTree`, and a listing leak in `cmd_stortest` was fixed.
## Misc
Consolidated scattered `type`/`const`/`var` sections into single blocks. Removed unused `/cfg` virtual directory. Added `FreeVFSObjTree` and `RemoveVirtualTree` for proper teardown of virtual directory trees.
- 5-phase VFS architecture overhaul (path resolution, dir cache, watch/notify,
symlinks, async API)
- Add character/block device node layer with /dev/null and /dev/zero built-ins
- RegisterDevice() API for custom device nodes with read/write/size callbacks
- Merge TOpenMode + TWriteMode into single TOpenMode enum
(omRead, omWrite, omCreate, omReadWrite, omStream)
- Add stream write support: WriteFile/WriteFileAsync now accept omStream handles
with auto-advancing offset for both device and volume FDs
- Add PPWriteOffsetHook type and writeOffsetCallback field to TFilesystem
- Add PPReadOffsetHook-based streaming reads for FAT32 and ISO9660
- Update all callers (notepad, edit, inio, wasm runner, filepicker, filedispatch,
vterminal, stdio) to new 2-param OpenFile API
- 77 unit tests (0 failures) covering path ops, dir cache, symlinks, watch,
device nodes, and stream read/write
- Add doc/vfs.md — comprehensive public VFS API documentation
- Add mount.asr parser in auto_mount_volumes: reads MOUNT.ASR from boot
volume root, parses 'mnt {device}<src> <target>' lines, expands {device}
to the boot volume's /disk/volN path, creates symlinks for each entry
- Remove old asr.mnt persistent mount logic from auto_mount_volumes
- Remove persistent mount write ([p] flag) from MOUNT shell command
- Remove hardcoded /boot mount for boot volumes (now driven by mount.asr)
- Add iso/mount.asr with default /boot and /sys symlinks
- Update doc/vfs.md with mount.asr documentation
- File picker (app.filepicker.pas): add otSYMLINK to directory case in
fp_collect_cb so symlinks like /sys appear as navigable directories
- VFS: add RemoveVirtualTree() to recursively free vdir/symlink trees
- VFS UnitTest: clean up /utest_vfs tree after all tests
- STORTEST: clean up /st_test tree after tests, fix listing leak in
cmd_stortest (GetDirectoryListingFrom result was never freed)
- Boot mount: auto-mount boot drive at /boot via mountVolume() instead
of symlink; remove /boot and /cfg from init() vdirs
- mount.asr: remove boot line (now only 'mnt {device}/sys /sys')
Aaron
requested review from admin 2026-03-08 19:03:30 +00:00
Aaron
requested review from t3hn3rd 2026-03-08 19:03:31 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Path Resolution
Introduced
GetObjectFromPathExwhich tracks unconsumed path segments after hitting a DRIVE node, returning a volume-relative path alongside the VFS object. All callers (GetDirectoryListing,PathValid,ResolveFilePath) now use this instead of the oldmakeRelative/getAbsolutePathapproach. Symlink traversal is handled inline with a configurable depth guard (MAX_SYMLINK_DEPTH = 8) and cycle detection.Device Nodes
Added
/dev/nulland/dev/zeroas built-in VFS device nodes with aRegisterDeviceAPI. Device nodes support read, write, and size callbacks via aTVFSDeviceOpsrecord. Open/Read/Write/Close all dispatch through device ops when the underlying object isotDEVICE.Stream I/O
Merged the old
TOpenModeandTWriteModeinto a singleTOpenModeenum (omRead,omWrite,omCreate,omReadWrite,omStream). Stream mode auto-advances the file offset on each read/write, enabling sequential I/O without manual offset tracking. Both sync and async paths support stream mode.Symlinks
Added
CreateSymlinkfor creating VFS symlink objects (otSYMLINK). Path resolution follows symlinks transparently with remaining path segments appended after resolution. Chained symlinks resolve up to the max depth. The file picker now includesotSYMLINKin its directory collection so symlinked directories like/sysappear and are navigable.Declarative Boot Mounts (mount.asr)
Replaced the old
asr.mntbinary blob with a human-readablemount.asrfile parsed at boot. Each line ismnt {device}/path /vfs_pathwhere{device}expands to the boot volume's mount point. Currently used to symlink/sys. The boot drive itself is now directly mounted at/bootviamountVolumeinauto_mount_volumes.Test Cleanup
VFS unit tests expanded from 77 to 104 covering symlink traversal, chained symlinks, cycle detection, symlink-to-root, device node I/O, stream mode, and watch/notify. STORTEST expanded to 34 tests with symlink traversal coverage. Both test suites now clean up after themselves via
RemoveVirtualTree, and a listing leak incmd_stortestwas fixed.Misc
Consolidated scattered
type/const/varsections into single blocks. Removed unused/cfgvirtual directory. AddedFreeVFSObjTreeandRemoveVirtualTreefor proper teardown of virtual directory trees.- Add mount.asr parser in auto_mount_volumes: reads MOUNT.ASR from boot volume root, parses 'mnt {device}<src> <target>' lines, expands {device} to the boot volume's /disk/volN path, creates symlinks for each entry - Remove old asr.mnt persistent mount logic from auto_mount_volumes - Remove persistent mount write ([p] flag) from MOUNT shell command - Remove hardcoded /boot mount for boot volumes (now driven by mount.asr) - Add iso/mount.asr with default /boot and /sys symlinks - Update doc/vfs.md with mount.asr documentation- File picker (app.filepicker.pas): add otSYMLINK to directory case in fp_collect_cb so symlinks like /sys appear as navigable directories - VFS: add RemoveVirtualTree() to recursively free vdir/symlink trees - VFS UnitTest: clean up /utest_vfs tree after all tests - STORTEST: clean up /st_test tree after tests, fix listing leak in cmd_stortest (GetDirectoryListingFrom result was never freed) - Boot mount: auto-mount boot drive at /boot via mountVolume() instead of symlink; remove /boot and /cfg from init() vdirs - mount.asr: remove boot line (now only 'mnt {device}/sys /sys')Approved 👍