From 700f4c412d42c9b9811269045c0e363a0331bba9 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Sat, 28 Dec 2019 21:54:42 +0100 Subject: split kernel into 2 stages; second stage gets copied to 0x0 and runs from there --- linker.ld | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 linker.ld (limited to 'linker.ld') diff --git a/linker.ld b/linker.ld deleted file mode 100644 index 444bbf6..0000000 --- a/linker.ld +++ /dev/null @@ -1,47 +0,0 @@ -ENTRY(_boot) /* defined in boot.S; qemu needs it to run elf file */ - -SECTIONS -{ - /* Starts at 0x8000 - that's where RPis in 32-bit mode load */ - /* kernel at. My experiments do, however, show, that qemu */ - /* emulating RPi2 loads the kernel at 0x10000! (took some pain */ - /* to find out). rpi-open-firmware, on the other hand, loads */ - /* kernel at 0x2000000! */ - /* This is not really a problem, since: */ - /* 1. We can use our bootloader to load the kernel at 0x8000 */ - /* 2. Stage 1 of the bootloader is written in careful */ - /* assembly, so that the loader itself should work */ - /* regardless of where it is loaded. */ - /* 3. In qemu, we can load kernel.elf instead of raw binary */ - /* (qemu will do the right thing then) */ - - . = 0x8000; - - /* RPi in 64-bit mode uses address 0x80000 instead */ - - __start = .; - .kernel : - { - __kernel_start = .; - KEEP(boot.o) - . = ALIGN(4); - ramfs_embeddable.o - *(EXCLUDE_FILE (libkernel.o interrupt_vector.o interrupts.o) *) - __kernel_end = .; - } - __kernel_size = __kernel_end - __kernel_start; - - .interrupts : - { - __interrupts_start = .; - KEEP(*(.interrupts.vector)) - interrupt_vector.o - interrupts.o - __interrupts_end = .; - } - __interrupts_size = __interrupts_end - __interrupts_start; - - __end = .; - - _stack_top = __start; -} -- cgit v1.2.3