Skip to content

Filesystem

Kazah edited this page Jul 5, 2026 · 10 revisions

Filesystem

Layered VFS over ramdisk and EXT2. POSIX-like API with 128-node pool.

See also: Drivers, Shell, GUI Subsystem, Architecture

VFS (vfs.c)

Unified namespace with node pool (128 nodes). Path resolution relative to CWD.

  • vfs_open/read/write/close — file I/O
  • vfs_readdir — directory listing (also on EXT2 mounts)
  • vfs_getcwd/vfs_chdir — directory navigation (full absolute path)
  • Per-terminal CWD (each shell tracks its own directory)

Ramdisk

Default filesystem from CPIO initramfs. Default tree:

/  bin/  dev/  etc/  home/user/  mnt/  root/  tmp/  usr/  var/

Initramfs (initramfs.c)

CPIO newc format (070701) embedded as C byte array. Generated by tools/mkinitramfs.py.

EXT2 (ext2.c)

Read/write EXT2 driver via ATA PIO:

  • Superblock, block groups, inode tables, directory entries
  • Inode/block allocation, directory creation, file writes
  • Mount at /mnt via vfs_mount
  • Fd-based I/O flushes to disk (persistent across reboot)

ATA driver (ata.c)

PIO mode, primary channel 0x1F0, IRQ 14, 28-bit LBA (up to 128 GB), polled I/O.

Clone this wiki locally