Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • O OS-Kernel
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DWG
  • OS-Kernel
  • Merge requests
  • !2

feat(vfs): Add VFS abstraction layer and filesystem auto-probe mechanism (Assisted by AI)

  • Review changes

  • Download
  • Patches
  • Plain diff
Open 某某某 requested to merge feat/ext4-vfs into main Jun 04, 2026
  • Overview 0
  • Commits 18
  • Pipelines 0
  • Changes 159
  • Introduce include/fs/vfs.h: VFS filesystem type registry, super_block, and inode abstractions mapped from Rust trait FilesystemOps.
  • Introduce include/fs/ext4.h: EXT4 superblock physical layout with attribute((packed)) constraint and Magic Number 0xEF53 definition. References: nonix/lwext4_rust (BSD 2-Clause).
  • Introduce kernel/fs/vfs.c: VFS registration table, fs_probe engine, FAT32 probe (BPB sanity check), EXT4 probe (sector 2 magic check). References: T202510589995148-2209/crates/axfs-ng-vfs (MIT/MPL-2.0).
  • Introduce kernel/fs/ext4_stub.c: EXT4 mount stub that panics with a clear "not yet implemented" message after successful magic detection.
  • Refactor kernel/fs/fs.c: Replace hardcoded fat32_init() with dynamic filesystem probe chain: buf_init() -> vfs_init() -> register fs types -> buf_read(0) -> vfs_probe_filesystem() -> mount matched fs
  • Fix lock-safety: release vfs_lock before probe callbacks to avoid "sched locks" panic when buf_read -> virtio_disk_rw -> proc_sleep.
  • Fix print compatibility: use %x instead of %04X for custom printf.

QEMU verification: EXT4 test image no longer triggers the old "fat32_init: invalid sector size" panic. Instead, VFS intercepts, detects Magic 0xef53, and reports "EXT4 filesystem support is not implemented yet" as expected.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: feat/ext4-vfs