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().
27 lines
464 B
Text
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 = .;
|
|
}
|