loading elf and grub

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
AndrewAPrice
Member
Member
Posts: 2309
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

loading elf and grub

Post by AndrewAPrice »

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.
My OS is Perception.
User avatar
bluecode
Member
Member
Posts: 202
Joined: Wed Nov 17, 2004 12:00 am
Location: Germany
Contact:

Re: loading elf and grub

Post by bluecode »

You can force grub to align the modules to a 4kb boundary (it's somewhere in the multiboot header in your kernel) and grub can ungzip the kernel and the modules for you (transparent to the kernel).

All your questions regarding elf are answered in the Tool Interface Standard.
Post Reply