Page 1 of 1

ELF kernel

Posted: Fri Dec 27, 2002 9:52 am
by pini
If I compile my kernel in ELF32-i386 format, how can I boot it ?
My boot loader doesn't work with non-flat binary formats.

Can anyone give a piece of code for loading an elf-kernel in protected mode ?

Re:ELF kernel

Posted: Fri Dec 27, 2002 4:14 pm
by Slasher
hi,
theres a file elf.pdf. it describes the ELF file format. to load an ELF file you have to work with the format ie READ ABOUT IT and learn what the header and other sections in the FORMAT do then write code to use them in the way you want. Use google with 'elf file format pdf' or use this
http://www.google.com/search?hl=en&ie=U ... format+pdf

Re:ELF kernel

Posted: Fri Dec 27, 2002 4:26 pm
by pini
You'are right : I must read the ELF-specs.

Re:ELF kernel

Posted: Fri Dec 27, 2002 7:18 pm
by Pype.Clicker
i guess Linux kernel should have what you wish, but i dunno where (some find | grep "elf" in /usr/src/linux might help).
I also have a small documentation about ELF format and a converter tool between ELF files and Clicker native modules format, which you could use as a base to write a simple ELF loader. . .

Hope this will help

Re:ELF kernel

Posted: Sat Dec 28, 2002 4:05 am
by pini
Thanks, I think the code of your converter will be extremly useful :D

Re:ELF kernel

Posted: Sat Dec 28, 2002 10:02 am
by Schol-R-LEA
Addtional details about ELF format can be found at the OSD site's executable formats page; Linkers and Loaders also covers ELF in detail. You may also want to look at how GRUB handles ELF files, though I don't know how helpful that would be.

Re:ELF kernel

Posted: Sat Dec 28, 2002 3:23 pm
by K.J.
GRUB can load ELF, source code is here:
http://savannah.gnu.org/cvs/?group=grub

K.J.