StupidOS/kernel/linker.ld
d0p1 🏳️‍⚧️ a9fec6e18c feat: setup paging and map kernel to higher half
Kernel is now at 0xC0100000, but still we use 4MiB pages, instruction like 'invlpg' which are invalid for cpu prior to 486, and we don't ensure multiboot structures are mapped. Still lot of work
2023-07-12 13:31:08 +02:00

40 lines
564 B
Plaintext

OUTPUT_ARCH(i386)
ENTRY(entry)
SECTIONS
{
. = 1M;
kernel_start = .;
.multiboot ALIGN(0x1000): {
KEEP(*(.multiboot.data))
KEEP(*(.multiboot.text))
}
. += 0xC0100000;
.text ALIGN(0x1000) : AT(ADDR(.text) - 0xC0000000) {
*(.text)
}
.rodata ALIGN(0x1000) : AT(ADDR(.rodata) - 0xC0000000) {
*(.rodata)
}
.data ALIGN(0x1000) : AT(ADDR(.data) - 0xC0000000) {
*(.data)
}
.bss ALIGN(0x1000) : AT(ADDR(.bss) - 0xC0000000) {
bss_start = .;
*(COMMON)
*(.bss)
bss_end = .;
}
kernel_end = .;
}
kernel_size = kernel_end - kernel_start;