Page 1 of 1

elf crap

Posted: Thu Dec 13, 2001 11:30 am
by dori
is the elf file the exact code that I can load into memory using the boot sector and then execute, with no problem. Also, does it have a header?






>:( :( ??? :-[ :-/ :'(

Re: elf crap

Posted: Thu Dec 13, 2001 11:33 am
by dori
in other words, is the elf file the image of the kernel?

Re: elf crap

Posted: Thu Dec 13, 2001 5:38 pm
by Chris Giese
Elf crap? Little guys with pointed ears making a mess in
the woods?

>is the elf file the exact code that I can load into memory
>using the boot sector and then execute, with no problem.
>Also, does it have a header?

An ELF file has many headers. File header, section headers,
and program headers (also called segments). If the ELF file
is an executable file, the code that loads it should look
at the program headers, not the section headers.

Using a linker script, you can make the ELF kernel contain
only one program header, which will contain your code
(.text), read-only initialized data (.rodata), and
read-write initialized data (.data). Just load this one
program header into RAM, fill with zeroes on the end for
the uninitialized data (.bss), and you're ready to run.

http://www.execpc.com/~geezer/osd/exec/index.htm#elf

Re: elf crap

Posted: Thu Dec 13, 2001 9:47 pm
by df
As Chris pointed out, you can make a plain 'flat' ELF without any relocations etc, and basically all you do is 'jump' to its start point and your going! Very Very Basic!!