Im currently trying to get my bootloader to support the loading of elf files.
Basically I have a bootsector that is compiled to binary that loads into pmode and transfers control at 1Mb to a stub file that links together with my c files. I want this stub to be able to load the kernel in elf format from the disk.
I have looked at chris greese's loader in C, but its too complicated for me. Since this will be loaded in the stub, Im going to be writing it in 32-bit assembly. At the moment Im currently getting my help from the linkers and loaders online book and this site: http://www.muppetlabs.com/~breadbox/sof ... eensy.html
Does anybody have any experience with writing one?
Any help would be appreciated.
Basic elf loader
Re:Basic elf loader
You could look at my boot loader, the second stage takes the ELF binary loaded at 0x20000 (which the boot sector loads there) and relocates it as it should be, placing page tables & stuff up, but does not copy the kernel, so the relocated pages still point inside the ELF executable. All segments must be page-aligned also. That's also why it's a very simple ELF loader.beyondsociety wrote: I have looked at chris greese's loader in C, but its too complicated for me. Since this will be loaded in the stub, Im going to be writing it in 32-bit assembly. At the moment Im currently getting my help from the linkers and loaders online book and this site: http://www.muppetlabs.com/~breadbox/sof ... eensy.html
Does anybody have any experience with writing one?
Any help would be appreciated.
It loads my kernel to 0xF0000000.
HTH, Candy
PS: the kernel can be found in the aurora-release at www.sf.net/projects/atlantisos
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Basic elf loader
i do not have an ELF 'loader', but i toyed quite alot with ELF binaries in order to convert them into something easier to load.
The 'collected information about ELF' i have is at http://sourceforge.net/docman/display_d ... p_id=10181
My 'ELF-access library' is mainly at http://cvs.sourceforge.net/viewcvs.py/c ... ools/misc/ and http://cvs.sourceforge.net/viewcvs.py/c ... 2/#dirlist
The 'collected information about ELF' i have is at http://sourceforge.net/docman/display_d ... p_id=10181
My 'ELF-access library' is mainly at http://cvs.sourceforge.net/viewcvs.py/c ... ools/misc/ and http://cvs.sourceforge.net/viewcvs.py/c ... 2/#dirlist