Skip to content

Filesystem

MerlionOS uses a unified VFS layer that abstracts six filesystem backends behind a common interface. All filesystems implement the same trait for open, read, write, close, stat, and directory operations.

FilesystemTypeDescription
devfsVirtualDevice nodes (/dev/null, /dev/serial, /dev/fb0, /dev/audio)
procfsVirtualKernel state with 28 entries (/proc/uptime, /proc/meminfo, /proc/cpuinfo, etc.)
sysfsVirtualDevice model and bus topology (/sys/devices/, /sys/bus/, /sys/power/)
tmpfsIn-memoryWritable temporary files, backed by page cache
MF16On-diskFAT16-like filesystem for block devices
ext4On-diskLinux-compatible filesystem with extents, journaling, and htree directories
/
├── bin/ # user-space ELF programs
├── dev/ # devfs — device nodes
│ ├── null # discard sink
│ ├── serial # COM1 serial port
│ ├── fb0 # framebuffer device
│ └── audio # audio mixer
├── proc/ # procfs — 28 kernel entries
│ ├── uptime # system uptime
│ ├── meminfo # heap statistics
│ ├── tasks # running task list
│ ├── cpuinfo # CPU topology & features
│ ├── mounts # active mount table
│ ├── modules # loaded kernel modules
│ ├── interrupts # IRQ counters
│ ├── net/ # network statistics
│ └── ... # additional entries
├── sys/ # sysfs — device model
│ ├── devices/ # device hierarchy
│ ├── bus/ # bus types (PCI, virtio)
│ └── power/ # P/C-states, thermal
├── mnt/ # ext4 / MF16 block mounts
└── tmp/ # tmpfs — writable temp files

A FAT16-like filesystem (MerlionFS-16) for block devices:

  • Cluster-based allocation with chain tracking
  • Directory entries with 8.3 filenames
  • Block device abstraction layer
  • RAM disk and Virtio block device backends

Linux-compatible ext4 implementation (v51):

  • Extents — efficient mapping of large contiguous regions
  • Journaling — crash recovery via write-ahead log
  • Htree directories — hash-indexed directory lookup for large directories
  • Superblock and group descriptors — standard ext4 on-disk layout
  • Read and write support for block devices

In-memory filesystem (v58):

  • Page-cache-backed storage, no disk I/O
  • Full read/write/directory support
  • Automatic cleanup on unmount
  • Used for /tmp and scratch storage

Comprehensive process and kernel information filesystem (v56):

  • 28 entries exposing kernel state
  • Per-process directories (/proc/[pid]/)
  • Network, memory, CPU, module, and interrupt statistics
  • Dynamic content generated on read

Device model filesystem (v57):

  • Hierarchical device tree mirroring kernel device model
  • Bus enumeration (PCI, virtio)
  • Power management attributes (P-states, C-states, thermal)
  • Read/write attributes for device configuration

POSIX-like file descriptor table per process:

  • open, read, write, close syscall semantics
  • stdin (fd 0), stdout (fd 1), stderr (fd 2) initialization
  • Named and bidirectional pipes (v58)
  • lsof command to inspect open file descriptors
  • POSIX ACLs for per-user/group access control (v59)