Linking kernel at 0xFFFF800000000000 (AMD64)
Posted: Thu Aug 06, 2009 3:31 pm
Hi
I've been working on a long mode kernel for a couple of weeks now. I use the a.out kludge to load a a 64bit ELF with GRUB. My 32bit stub makes it into long mode and reaches my C entry point no problem when linked at 0xFFFFFFFF80010000.
I can't seem to link at 0xFFFF800000010000!!. I've read a few moans on this forum about this but no real solution. Anyone know what causes this :
My linker script is as the 64bit kernel wiki page.
I'm using a x86_64-elf cross compiler on Cygwin I built myself. GCC 4.3.3.
The function its moaning about is actually the multiboot header for GRUB.
KERNEL_VMA = 0xFFFF800000000000
Bearing in mind this all works fine when using the higher address........
Cheers!
I've been working on a long mode kernel for a couple of weeks now. I use the a.out kludge to load a a 64bit ELF with GRUB. My 32bit stub makes it into long mode and reaches my C entry point no problem when linked at 0xFFFFFFFF80010000.
I can't seem to link at 0xFFFF800000010000!!. I've read a few moans on this forum about this but no real solution. Anyone know what causes this :
Code: Select all
arch/amd64/entry.o: In function `_multiboot':
(.text+0xc): relocation truncated to fit: R_X86_64_32 against `.text'
I'm using a x86_64-elf cross compiler on Cygwin I built myself. GCC 4.3.3.
The function its moaning about is actually the multiboot header for GRUB.
KERNEL_VMA = 0xFFFF800000000000
Code: Select all
_multiboot:
.long 0x1BADB002
.long 0x00010002
.long (0 - 0x1badb002 - 0x00010002)
.long (_multiboot-KERNEL_VMA)
.long (_code-KERNEL_VMA)
.long (_data_end-KERNEL_VMA)
.long (_end-KERNEL_VMA)
.long (_entry-KERNEL_VMA)
Cheers!