diff --git a/Kernel/linker.ld b/Kernel/linker.ld index 3f76fbefe8..fcc4eee933 100644 --- a/Kernel/linker.ld +++ b/Kernel/linker.ld @@ -1,12 +1,14 @@ ENTRY(start) +KERNEL_VIRTUAL_BASE = 0xc0000000; + SECTIONS { - . = 0xc0100000; + . = KERNEL_VIRTUAL_BASE + 0x00100000; start_of_kernel_image = .; - .text ALIGN(4K) : AT (ADDR(.text) - 0xc0000000) + .text ALIGN(4K) : AT (ADDR(.text) - KERNEL_VIRTUAL_BASE) { $ *(.multiboot) @@ -22,7 +24,7 @@ SECTIONS *(.text*) } - .unmap_after_init ALIGN(4K) : AT (ADDR(.unmap_after_init) - 0xc0000000) + .unmap_after_init ALIGN(4K) : AT (ADDR(.unmap_after_init) - KERNEL_VIRTUAL_BASE) { start_of_unmap_after_init = .; *(.unmap_after_init*); @@ -31,7 +33,7 @@ SECTIONS end_of_kernel_text = .; } - .rodata ALIGN(4K) : AT (ADDR(.rodata) - 0xc0000000) + .rodata ALIGN(4K) : AT (ADDR(.rodata) - KERNEL_VIRTUAL_BASE) { start_heap_ctors = .; *libkernel_heap.a:*(.ctors) @@ -44,21 +46,21 @@ SECTIONS *(.rodata*) } - .data ALIGN(4K) : AT (ADDR(.data) - 0xc0000000) + .data ALIGN(4K) : AT (ADDR(.data) - KERNEL_VIRTUAL_BASE) { start_of_kernel_data = .; *(.data*) end_of_kernel_data = .; } - .ro_after_init ALIGN(4K) (NOLOAD) : AT(ADDR(.ro_after_init) - 0xc0000000) + .ro_after_init ALIGN(4K) (NOLOAD) : AT(ADDR(.ro_after_init) - KERNEL_VIRTUAL_BASE) { start_of_ro_after_init = .; *(.ro_after_init); end_of_ro_after_init = .; } - .bss ALIGN(4K) (NOLOAD) : AT (ADDR(.bss) - 0xc0000000) + .bss ALIGN(4K) (NOLOAD) : AT (ADDR(.bss) - KERNEL_VIRTUAL_BASE) { start_of_kernel_bss = .; *(page_tables)