Implement driver architecture with linker-section registration (AI)

- Created driver framework with probe/init lifecycle. Drivers register via
  REGISTER_DRIVER macro which places pointers in a .drivers linker section.
- During boot, init_drivers() iterates the section, probes each driver
  (checking if hardware is present), and initializes those that respond OK.
- Added .drivers section to linker.ld with __drivers_start/__drivers_end
  symbols for iteration.
- Also added .rodata.* pattern to the .rodata section for string literals
  placed in sub-sections by the compiler.
- No drivers are registered yet; the VGA driver will be the first.

Tested: boots cleanly with driver scan completing (0 registered, 0 loaded).
This commit is contained in:
AI
2026-02-23 11:08:59 +00:00
parent f63cd9eb3f
commit bb09de6a6d
6 changed files with 142 additions and 1 deletions

View File

@@ -47,7 +47,7 @@ Once a task is completed, it should be checked off.
- [x] Create a physical memory allocator and mapper. The kernel should live in the upper last gigabyte of virtual memory. It should support different zones (e.g.: `SUB_16M`, `DEFAULT`, ...) These zones describe the region of memory that memory should be allocated in. If it is not possible to allocate in that region (because it is full, or has 0 capacity to begin with), it should fallback to another zone.
- [x] Create a paging subsystem. It should allow drivers to allocate and deallocate pages at will.
- [x] Create a memory allocator. This should provide the kernel with `malloc` and `free`. Internally, it should use the paging subsystem to ensure that the address it returns have actual RAM paged to them.
- [ ] Create an initial driver architecture, allowing different drivers included in the kernel to test whether they should load or not.
- [x] Create an initial driver architecture, allowing different drivers included in the kernel to test whether they should load or not.
- [ ] Create a VGA driver. On startup, some memory statistics should be displayed, as well as boot progress.
- [ ] Create subsystem for loading new processes in Ring 3.
- [ ] Update the build script to generate a ramdisk containing any applications to run. This initial ramdisk is in CPIO format.