alexfru wrote:
Octacone wrote:
Btw writing an ELF loader in assembly is a huge pain. I can do it but will take me a lot of time and debugging.
For (un)real mode there's Smaller C. Loading a DOS/MZ-style .EXE is easy. The ones produced by Smaller C don't even have DOS relocations to take care of (you save a dozen of instructions by not relocating!
), so just load, set up SS:SP and jump. And you can debug portions of code in DOS, not just on bare metal.
Oh, I don't actually have anything in common with DOS. I am not building a real mode OS or anything like that, if that is what you were thinking. I was talking about my bootloader supporting different formats and such.
But I plan on supporting MZ's big brother PE which suits my needs (32 bit code).
Just a quick update:
50 lines of assembly later and I have a fully working elf loader. Wasn't as hard as expected.
I'll be definitely looking into supporting other formats as well (for userspace apps).
Thanks for helping.