From 8cf8be522133548ee25fdcb0258ddf3950a68bcf Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Mon, 8 Dec 2025 22:25:48 +0800 Subject: The start of the project -- A MicroDOS feat: Initial bare-metal RISC-V boot with UART --- linker.ld | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 linker.ld (limited to 'linker.ld') diff --git a/linker.ld b/linker.ld new file mode 100644 index 0000000..0b01e98 --- /dev/null +++ b/linker.ld @@ -0,0 +1,47 @@ +OUTPUT_ARCH( "riscv" ) +ENTRY(_start) + +MEMORY +{ + ram (wxa) : ORIGIN = 0x80000000, LENGTH = 128M +} + +SECTIONS +{ + . = 0x80000000; + + .text : { + PROVIDE(_text_start = .); + *(.text.entry) + *(.text .text.*) + PROVIDE(_text_end = .); + } > ram + + .rodata : { + . = ALIGN(16); + PROVIDE(_rodata_start = .); + *(.rodata .rodata.*) + PROVIDE(_rodata_end = .); + } > ram + + .data : { + . = ALIGN(16); + PROVIDE(_data_start = .); + *(.data .data.*) + *(.sdata .sdata.*) + PROVIDE(_data_end = .); + } > ram + + .bss : { + . = ALIGN(16); + PROVIDE(_bss_start = .); + *(.bss .bss.*) + *(.sbss .sbss.*) + PROVIDE(_bss_end = .); + } > ram + + . = ALIGN(4096); + PROVIDE(_stack_top = . + 0x8000); + . = . + 0x8000; + PROVIDE(_heap_start = .); +} \ No newline at end of file -- cgit v1.2.3