Page 1 of 1

How to exucute an elf kernel from a bootloader

Posted: Sun Nov 08, 2015 6:54 pm
by marcthe12
Hi! I am a beginner and I have made a boot loader return in flat binary and planning to execute the kernel. I have written the code for loading up files and entered protected mode. I planning to write a kernel ini686-elf. So after the kernel is loader in memory, how to run the code.

I have been using the following tutorial http://www.brokenthorn.com/Resources/OSDevIndex.html in order making the boot loader.

Re: How to exucute an elf kernel from a bootloader

Posted: Sun Nov 08, 2015 10:34 pm
by BASICFreak
Hello, so the steps are:

Process ELF Header - Get Entry Point and Program Header Information

Process each Program Header - Copy each section to there respected location, and clear any allocated memory not located in the ELF.

Switch Modes

Jump to ELF Entry Point.


Grab a copy of the ELF Spec - if I'm not mistaken you should only have to worry about sections 1-3 and 2-2 (until you get into SOs or Relocs)



B!