I am trying to boot the very first image from the Benu series of OSes, but I have run into a problem. With debugging information in the ISO the image is too big for lower memory and it fails to load (even though it's only 4kb bigger than without debug info). I allocate 16mb to the Qemu session, but I can't find anywhere online about how to load the OS in upper memory. Obviously it's possible since most operating systems are much larger than around 490kb, but none of the tutorials on this site seem to cover how to load a larger OS.
Thanks!
Load OS into upper memory?
Re: Load OS into upper memory?
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.
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.
Re: Load OS into upper memory?
Your post begs a lot of questions, such as whther 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.
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.
Re: Load OS into upper memory?
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.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.
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:
Code: Select all
-e arch_start -Ttext=0x100000
I didn't write the OS's myself, so I am not sure yet which mode they run in.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.
Re: Load OS into upper memory?
Oh, then it's definitely time to fill some gaps in your knowledge base before starting to do anything in this direction. Because when you're trying smth, it's always better to understand what are doing (even if you didn't write it by yourself).sjheiss wrote:I didn't write the OS's myself, so I am not sure yet which mode they run in.
http://wiki.osdev.org/Required_Knowledge
http://wiki.osdev.org/Getting_Started
http://wiki.osdev.org/Real_Mode , http://wiki.osdev.org/Protected_Mode