DOCUMENTATION / V1.0.0 LTS

VFS Architecture

Audience: kernel contributors and architects extending the filesystem, storage drivers, permissions, and POSIX compatibility layers.

Current version: v0.2.1-enterprise

Overview

OrbitOne OS exposes a unified Virtual Filesystem (VFS) adhering to FHS-lite specifications across multiple backend providers:

The design guarantees isolation, deterministic path resolution, memory safety in no_std, and full POSIX metadata representation.


Core Architecture & Components

               +------------------------------------------------------+
               |             Shell Commands / Syscalls                |
               |  (ls -la, stat, cat, chmod, chown, quota, sys_*)     |
               +------------------------------------------------------+
                                          |
                                          v
               +------------------------------------------------------+
               |             Console Path Normalizer                  |
               |            (canonicalize, resolve cwd)               |
               +------------------------------------------------------+
                                          |
                                          v
               +------------------------------------------------------+
               |              Virtual Filesystem (VFS)                |
               |         fs::stat, fs::list_dir, fs::read             |
               +------------------------------------------------------+
                 /            /             \            \          \
                /            /               \            \          \
               v            v                 v            v          v
        +-------------+ +------------+ +------------+ +----------+ +-------------+
        |   Static    | |  ProcFS    | |   DevFS    | |  TmpFS   | | Ext2 Driver |
        |   Catalog   | |(/proc/net, | |(/dev/null, | | (Quota,  | | & ATA Block |
        | (/etc, etc) | | /proc/mem) | | /dev/disk0)| |  NVRAM)  | |   Storage   |
        +-------------+ +------------+ +------------+ +----------+ +-------------+

Metadata & POSIX Stat Model

The VFS defines NodeStat containing full POSIX-compliant attributes:

pub struct NodeStat {
    pub kind: NodeType,      // File, Directory, Device, Symlink
    pub size_bytes: usize,   // File content size or directory entry count
    pub mode: u32,           // Octal permissions (e.g. 0o755, 0o644, 0o1777)
    pub uid: u32,            // User ID (0 = root, 1000 = orbit, 1001 = users)
    pub gid: u32,            // Group ID (0 = root, 1000 = orbit, 1001 = users)
    pub ctime: u32,          // Inode change / creation timestamp (UNIX epoch)
    pub mtime: u32,          // Last data modification timestamp (UNIX epoch)
}

Permissions & Timestamps Subsystem (src/permissions.rs)


Filesystem Providers

1. Dynamic tmpfs (src/tmpfs.rs)

2. Ext2 Driver (src/ext2.rs)

3. ProcFS & DevFS (src/procfs.rs, src/devfs.rs)


Syscall Integration (src/syscall.rs)

VFS operations are directly mapped to userland Ring 3 syscalls with per-task CWD resolution:


VFS Scripting & Execution (src/env.rs, src/commands/env.rs)

The VFS acts as the script and configuration store for shell batch execution: