Page 2 of 2
Re: global vars, elf and bin
Posted: Sat Jun 23, 2018 10:25 am
by iansjack
Well, you're welcome to continue using flat binaries.
No skin off my nose. You might like to think why real OSs don't do that (or you may not).
Re: global vars, elf and bin
Posted: Sat Jun 23, 2018 10:32 am
by Octacone
iansjack wrote:Well, you're welcome to continue using flat binaries.
No skin off my nose. You might like to think why real OSs don't do that (or you may not).
Dude, chill. I didn't decide anything yet. That is why I asked for some input.
Can you elaborate? Why would I want kernel libraries? That was a legit question I was hoping would get answered.
Re: global vars, elf and bin
Posted: Sat Jun 23, 2018 3:29 pm
by alexfru
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.
SOLVED global vars, elf and bin
Posted: Tue Jun 26, 2018 4:01 pm
by Octacone
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.