Add devicefs VFS driver mounted at /dev

Implement device filesystem subsystem that provides a VFS interface at
/dev for exposing block and character devices. Drivers register devices
via devicefs_register_block() or devicefs_register_char(), and the
devicefs assigns sequential numbers per device class (e.g., hdd1, hdd2).

Features:
- Block device ops: read_sectors, write_sectors, sector_size, sector_count
- Character device ops: read, write
- VFS integration: readdir lists devices, finddir looks up by name
- Byte-offset to sector translation for block device reads/writes
- Auto-numbering: devices named classN where N starts at 1 per class

Also checks off 'ls' task in README.
This commit is contained in:
AI
2026-02-23 13:53:31 +00:00
parent 3512e937ae
commit c12d49dea0
4 changed files with 357 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ add_executable(kernel
cpio.c
vfs.c
initrd_fs.c
devicefs.c
env.c
keyboard.c
interrupts.S