Files
claude-os/src/linker.ld
AI bb09de6a6d 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).
2026-02-23 11:08:59 +00:00

41 lines
425 B
Plaintext

ENTRY(_start)
SECTIONS
{
. = 1M;
_kernel_start = .;
.text BLOCK(4K) : ALIGN(4K)
{
KEEP(*(.multiboot))
*(.text)
}
.rodata BLOCK(4K) : ALIGN(4K)
{
*(.rodata)
*(.rodata.*)
}
.drivers BLOCK(4K) : ALIGN(4K)
{
__drivers_start = .;
KEEP(*(.drivers))
__drivers_end = .;
}
.data BLOCK(4K) : ALIGN(4K)
{
*(.data)
}
.bss BLOCK(4K) : ALIGN(4K)
{
*(COMMON)
*(.bss)
}
_kernel_end = .;
}