Files
k-os/crates/userspace-rt/linker.ld
Gabriel Kaszewski 29cd0e7dfe feat: userspace linker script at 0x10000, proper ELF segment loading, full disk boot pipeline working
- Userspace linker script: apps/servers link at 0x10000 (user VA)
- Adapter linker script: kernel links at 0x80200000 (S-mode)
- Each uses build.rs to emit its own -T flag, global config only sets panic=abort
- ELF loader: page-aligns segment mappings, handles non-aligned vaddrs
- Stack: 4 pages (16K) mapped below program
- SP set to top of stack (0x10000), not bottom
- FAT16 disk image forced (mformat was creating FAT32)
- End-to-end verified: VirtIO → FAT16 → ELF → userspace → ecall → exit
2026-10-18 04:51:07 +02:00

26 lines
372 B
Plaintext

OUTPUT_ARCH(riscv)
ENTRY(_start)
SECTIONS {
. = 0x10000;
.text : {
*(.text.entry)
*(.text .text.*)
}
. = ALIGN(4096);
.rodata : { *(.rodata .rodata.*) }
. = ALIGN(4096);
.data : { *(.data .data.*) }
. = ALIGN(4096);
.bss : {
*(.bss .bss.*)
*(.sbss .sbss.*)
}
/DISCARD/ : { *(.eh_frame) }
}