I'm am trying to link an ELF64 kernel but I have some trouble understanding how ld works.
I have a file named a.asm:
Code: Select all
dd 0x12345678
Code: Select all
nasm a.asm -o a.o -felf64
Code: Select all
ld -Tl.ld a.o -o o
Also, if I compile the asm file with -felf32 and link with -melf_i386, I get a 4.3KB file (still with a lot of 0 in it, but better than 2MB).
And how this is related to my problem: I need to put a multiboot header in the first 32KB of my file (as the spec says) and ld keeps putting it at 1MB or 2MB whatever I tell it
Any help is appreciated!