Page 1 of 1

Starting a bootloader

Posted: Tue Jul 22, 2014 8:56 pm
by ScropTheOSAdventurer
I understand that as my bootloader stands right now, I am like early humans realizing that they can sharpen stones and use them as attack weapons (in other words, in comparison to most of you I am like a dog in this regard), but I still felt like sharing it. Right now it just prints a couple of messages (and unsuccessfully attempts to clear the screen; need to take another look at RBIL). But I am happy with myself :D. Link: https://github.com/scrat101/Alo-bootloader.


EDIT: Got screen clearing to finally work :).

Re: Starting a bootloader

Posted: Wed Jul 23, 2014 4:10 pm
by Marionumber1
Just one thing I noticed, it's probably a bad idea to have the stack at 0x400. The Interrupt Vector Table (IVT) is located at address 0 and is 0x400 bytes long, so pushing stuff onto the stack will overwrite it. In practice, this may not be a problem, since you'll likely only overwrite the high vectors (which probably aren't used), but it's still not good practice. What I do is place the stack at 0x7C00, directly below the bootsector.

Re: Starting a bootloader

Posted: Wed Jul 23, 2014 4:33 pm
by ScropTheOSAdventurer
I set the stack segment to be 0x7C0, so the stack is right above my 512 byte bootsector, so it should be no problem. In fact, I set all my segment registers to 0x7C0 in the start initialization of my bootsector.

Re: Starting a bootloader

Posted: Wed Jul 23, 2014 7:25 pm
by Marionumber1
Ah yes, I missed that part. In most cases I see, they're set to 0 in a bootsector, which confused me.