You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BrightS uses a VFS2 (Virtual File System) layer with mount-point-based dispatch.
Each mounted filesystem provides a vfs_superblock_t with operation dispatch tables.
Mount points at boot:
/ → RAMFS (root filesystem, in-memory)
/dev → DevFS (device files)
/mnt/drive → Btrfs (if disk available, fallback: unmounted)
typedefstructvfs_inode {
uint32_tino; /* Inode number */uint32_tmode; /* File type + permissions (VFS_S_IF*) */uint64_tsize; /* File size in bytes */uint32_tuid; /* Owner user ID */uint32_tgid; /* Owner group ID */uint32_tnlink; /* Hard link count */uint64_tatime; /* Access time */uint64_tmtime; /* Modification time */uint64_tctime; /* Change time */structvfs_superblock*sb; /* Back-pointer to superblock */void*fs_private; /* Filesystem-specific data */
} vfs_inode_t;
vfs_file_t (Open file descriptor)
typedefstructvfs_file {
vfs_inode_t*inode; /* Associated inode */uint64_tpos; /* Current read/write position */uint32_tflags; /* Open flags (VFS_O_RDONLY, etc.) */vfs_file_ops_t*fops; /* File operation dispatch table */void*private_data; /* Per-open instance data */intin_use; /* Slot allocation flag */
} vfs_file_t;
vfs_superblock_t (Mounted filesystem)
typedefstructvfs_superblock {
constchar*fs_type_name; /* Filesystem type name */vfs_sb_ops_t*sb_ops; /* Superblock operations */vfs_file_ops_t*default_fops; /* Default file operations */void*fs_private; /* Filesystem-specific data */intactive; /* Mount active flag */
} vfs_superblock_t;
vfs_mount_t (Mount point mapping)
typedefstructvfs_mount {
charprefix[128]; /* Path prefix (e.g., "/", "/dev") */vfs_superblock_t*sb; /* Associated superblock */intactive; /* Mount active flag */
} vfs_mount_t;