Why does the Bare Bones tutorial use ELF?
-
- Member
- Posts: 83
- Joined: Tue Feb 03, 2009 11:37 am
Why does the Bare Bones tutorial use ELF?
The Bare Bones tutorial uses the ELF file format. What is the benefit of this as opposed to another format?
Re: Why does the Bare Bones tutorial use ELF?
I may be wrong, and there may be more benefits than this.gsingh2011 wrote:The Bare Bones tutorial uses the ELF file format. What is the benefit of this as opposed to another format?
1. ELF is widely supported. It provides a means of 'checking' the integrity (as secure a simple 4-byte magic header is) of the file.
2. It has debugging symbols, for example symbol tables, that enable debugging externally, and for doing a backtrace internally.
3. With the .dyn* and .reloc sections, it can make dynamic loading much simpler.
I suggest searching for these things on google. We are not here to answer your simple questions. Please, at least post some findings or other things.
[nx] kernel: http://github.com/zhiayang/nx
-
- Member
- Posts: 83
- Joined: Tue Feb 03, 2009 11:37 am
Re: Why does the Bare Bones tutorial use ELF?
Googling gives me a description of the format, but not why one would use this format over another. And why someone use this format for OSDev might be a different answer than using the format for an executable. But thanks for your input. If anyone has any other benefits of using ELF, I'd like to know.
Re: Why does the Bare Bones tutorial use ELF?
The third benefit doesn't really apply for the actual OS executable, but rather for programs that you might load *from* your OS, later on.gsingh2011 wrote:Googling gives me a description of the format, but not why one would use this format over another. And why someone use this format for OSDev might be a different answer than using the format for an executable. But thanks for your input. If anyone has any other benefits of using ELF, I'd like to know.
1. ELF is widely supported. *MAYBE*, you might be able to run a linux program on your OS, if you provide all the system calls and libraries it needs, without re-compiling, IF your OS is fully POSIX compliant.
2. Again, debugging and backtracking is very valuable in OSDev to determine where your OS went wrong.
[nx] kernel: http://github.com/zhiayang/nx
- gravaera
- Member
- Posts: 737
- Joined: Tue Jun 02, 2009 4:35 pm
- Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.
Re: Why does the Bare Bones tutorial use ELF?
Yo:
@OP:
From a purely practical point of view, we recommend ELF for several reasons:
--Peace out,
gravaera
I feel as if this post was completely unedifying, useless, tasteless, and laced with condescension.requimrar wrote:I suggest searching for these things on google. We are not here to answer your simple questions (?). Please, at least post some findings or other things.
@OP:
From a purely practical point of view, we recommend ELF for several reasons:
- In the PE/COFF specification, you will find in the legal preamble, clauses which limit the use of PE that may apply to competing products such as kernels. I do not remember exactly what the clause was, or why I felt that it clashed with the aim of using PE for competing kernel development, but when I read it, it was fairly obvious that the clause did clash.
- There is a subtle (and imho, healthy) bias toward a mostly Unix/POSIX development environment for all documentation on the site.
- The majority of GNU compiler stack programs and accompanying tools very seamlessly work with ELF.
- The majority of people in the community use ELF.
- The majority of the documentation you will find publicly available will be POSIX/GNU biased: you'll encounter a lot of documentation on Linux when trying to do research on a lot of topics.
--Peace out,
gravaera
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
- Owen
- Member
- Posts: 1700
- Joined: Fri Jun 13, 2008 3:21 pm
- Location: Cambridge, United Kingdom
- Contact:
Re: Why does the Bare Bones tutorial use ELF?
Additionally, the Bare Bones tutorials are designed to work with GNU GRUB. GRUB expects you to use ELF; using other formats uses a mechanism which is defined by the Multiboot specification itself to be a kludge.