Nable wrote:It's generally a good idea to use some multi-stage bootloader.
First stage is very small and loads second stage (or kernel) that enables protected mode and has enough device-specific routines to load full kernel to upper memory.
You can write your own implementations of these stages but I suggest you using GrUB or
Yoda's OS Boot Tools.
Well, the Benu OS's all use Grub, but the grub file (called "grub_file") is apparently obfuscated in some way, so I can't edit it myself, and I couldn't figure out how to edit it or create a new one. Actually, I'm not entirely sure what this "grub_file"
is. Apparently the OS's at the Benu link use two stages, but for some reason I still get an error saying selected item cannot fit into memory.
I tried out the OS Boot Tools, but it seems that with that the OS can only be max 620kb. Not a whole lot...
Now, the Benu OS's have this option in the linker:
Which to me seems that the kernel would start at address 0x100000, which is apparently 14mb big, which is plenty. But apparently this doesn't work as the OS is loaded in lower memory. Why would this be?
Casm wrote:Your post begs a lot of questions, such as whether the operating system is running in real or protected mode, and, if protected mode, whether it uses segmentation or paging.
Most protected mode kernels need to be compiled and linked to run at a particular address in memory, so, once they have been compiled and linked, they can only successfully be loaded at that address.
I didn't write the OS's myself, so I am not sure yet which mode they run in.