Bootstrapping - Abstract view
Posted: Tue Dec 25, 2007 1:04 am
I am currently trying to plan out my operating system, and was wondering if someone could clarify something for me:
I am going to write my own bootloader. I know that the bootloader is going to sit on the floppy (no hd support yet) within the first 512 bytes.
Tell me if im right here:
My bootloader will operate at 16-bit real mode.
Now, to get to the second stage (yeah, its a two-stage bootloader), I'm going to make a couple BIOS interrupt calls to read from the floppy disk. With these interrupt calls, im going to read "sectors" from the floppy disk (specificly the sectors that contain the 2nd stage bootloader) and then throw them into memory.
Now heres my question:
The first stage bootloader has to be done entirely in assembly for obvious reasons. In order to read from the floppy disk, do I need to implement a FAT12 driver within that 512 limit? I see no other way of grabbing the second stage bootloader while keeping a legit filesystem.
Also,
I'm a little confused what to do after i've loaded the flat binary contents of the second bootloader into memory. Whats the best way of telling the processor to "jump" over to my newly memory allocated bootloader, and start processing its instructions?
Remember, I'm still in 16-bit real mode... My second stage bootloaders going to work the magic and switch me over to 32-bit protected, A20 Line, etc. What do you guys think?
I am going to write my own bootloader. I know that the bootloader is going to sit on the floppy (no hd support yet) within the first 512 bytes.
Tell me if im right here:
My bootloader will operate at 16-bit real mode.
Now, to get to the second stage (yeah, its a two-stage bootloader), I'm going to make a couple BIOS interrupt calls to read from the floppy disk. With these interrupt calls, im going to read "sectors" from the floppy disk (specificly the sectors that contain the 2nd stage bootloader) and then throw them into memory.
Now heres my question:
The first stage bootloader has to be done entirely in assembly for obvious reasons. In order to read from the floppy disk, do I need to implement a FAT12 driver within that 512 limit? I see no other way of grabbing the second stage bootloader while keeping a legit filesystem.
Also,
I'm a little confused what to do after i've loaded the flat binary contents of the second bootloader into memory. Whats the best way of telling the processor to "jump" over to my newly memory allocated bootloader, and start processing its instructions?
Remember, I'm still in 16-bit real mode... My second stage bootloaders going to work the magic and switch me over to 32-bit protected, A20 Line, etc. What do you guys think?