elf crap

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
dori

elf crap

Post 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?






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

Re: elf crap

Post by dori »

in other words, is the elf file the image of the kernel?
Chris Giese

Re: elf crap

Post 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
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re: elf crap

Post 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!!
-- Stu --
Post Reply