minos/arch/riscv/link.ld
auser 8c44d12357 minos M1: minimal multi-arch kernel (x86 + RISC-V + ARM/Zynq)
Boots under QEMU on all three ISAs from one clang build:
- shared C core (kmain, console) calls a small per-arch contract (arch.h)
- per-arch asm entry + trap/vector table + UART driver
- parallel Makefile (make -j), 'make run-<arch>', 'make sizes'
M1 = boot, UART up, trap vector installed, banner from kmain().
2026-09-25 00:41:24 +03:00

27 lines
464 B
Text

/* link.ld (RISC-V) — QEMU 'virt' loads the kernel at 0x80000000. */
OUTPUT_ARCH(riscv)
ENTRY(_start)
SECTIONS
{
. = 0x80000000;
.text : {
KEEP(*(.text.boot)) /* _start must be first */
*(.text .text.*)
}
.rodata : { *(.rodata .rodata.*) }
.data : { *(.data .data.*) }
. = ALIGN(8);
__bss_start = .;
.bss : { *(.bss .bss.*) *(COMMON) }
. = ALIGN(8);
__bss_end = .;
/* 16 KiB boot stack */
. = ALIGN(16);
. += 0x4000;
_stack_top = .;
}