Load kernel before or after I enable the Protect Mode?
Posted: Sun Apr 25, 2010 11:31 pm
I am writing a loader for my little test OS. My booting sequence is as below:
Bootsector -> Loader -> Kernel...
Bootsector: Only load the loader.
Loader: (a) Load the kernal from a floppy in real mode
(b) Switch to protect mode
Kernel: to-be-continued...
I am wondering:
In what order should I arrange the 2 parts of the Loader's job?
Currently, the loader loads the kernel into memory with the help of real mode BIOS interrupt routine. But real mode limits the size of memory I can use. Though the kernel for now is small enough to fit in, what if it grow quite big in the future?
So I am considering doing step (b) first. But thus I won't be able to use the BIOS interrupt routine, then I have to implement my own floppy driver.
How does Linux handle this problem?
Could someone give me some suggestion to solve this problem elegantly?
Bootsector -> Loader -> Kernel...
Bootsector: Only load the loader.
Loader: (a) Load the kernal from a floppy in real mode
(b) Switch to protect mode
Kernel: to-be-continued...
I am wondering:
In what order should I arrange the 2 parts of the Loader's job?
Currently, the loader loads the kernel into memory with the help of real mode BIOS interrupt routine. But real mode limits the size of memory I can use. Though the kernel for now is small enough to fit in, what if it grow quite big in the future?
So I am considering doing step (b) first. But thus I won't be able to use the BIOS interrupt routine, then I have to implement my own floppy driver.
How does Linux handle this problem?
Could someone give me some suggestion to solve this problem elegantly?