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.
36 lines
585 B
CMake
36 lines
585 B
CMake
cmake_minimum_required(VERSION 3.16)
|
|
|
|
add_executable(kernel
|
|
boot.S
|
|
gdt_flush.S
|
|
gdt.c
|
|
idt.c
|
|
isr.c
|
|
pic.c
|
|
pmm.c
|
|
paging.c
|
|
kmalloc.c
|
|
string.c
|
|
driver.c
|
|
vga.c
|
|
tss.c
|
|
process.c
|
|
syscall.c
|
|
cpio.c
|
|
vfs.c
|
|
initrd_fs.c
|
|
devicefs.c
|
|
env.c
|
|
keyboard.c
|
|
interrupts.S
|
|
kernel.c
|
|
)
|
|
|
|
# Use our custom linker script
|
|
target_link_options(kernel PRIVATE -T ${CMAKE_CURRENT_SOURCE_DIR}/linker.ld)
|
|
|
|
target_include_directories(kernel PRIVATE
|
|
${CMAKE_SOURCE_DIR}/vendor
|
|
${CMAKE_SOURCE_DIR}/include # If created later
|
|
)
|