loading elf and grub
Posted: Fri Jul 13, 2007 6:50 am
I'm using grub and an elf kernel and elf modules, and I have some questions.
From what I've read so far and when I experimented, it seems grub copies the contents of the the module straight from the disk into memory after where it loaded the kernel. I can the address of the module information from the multiboot header.
I'm guessing grub doesn't do anything (like aligning it to 2kb boundary for paging) so I'll have to move it around in memory.
How do I parse a elf file and prepare it to I can jump to it? Do I have to do anything special besides copy from the data section onward into a page? How do I find out where the data section starts? What do I do with the other sections?
I've only worked with flat binaries before.
From what I've read so far and when I experimented, it seems grub copies the contents of the the module straight from the disk into memory after where it loaded the kernel. I can the address of the module information from the multiboot header.
I'm guessing grub doesn't do anything (like aligning it to 2kb boundary for paging) so I'll have to move it around in memory.
How do I parse a elf file and prepare it to I can jump to it? Do I have to do anything special besides copy from the data section onward into a page? How do I find out where the data section starts? What do I do with the other sections?
I've only worked with flat binaries before.