global vars, elf and bin

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.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: global vars, elf and bin

Post 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).
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

Re: global vars, elf and bin

Post 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.
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
alexfru
Member
Member
Posts: 1112
Joined: Tue Mar 04, 2014 5:27 am

Re: global vars, elf and bin

Post 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.
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

SOLVED global vars, elf and bin

Post 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.
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
Post Reply