Page 1 of 1

Jump form bootloader to kernel

Posted: Tue Nov 23, 2010 11:05 am
by SCHiM
Hello everybody
I'm new to the osdev forum, and I've got a little problem understanding a certain piece of theory.

All the pages & wiki's I've read (and I've read them before asking my question) said that there are many kinds of boot loaders. But that they ultimately do the same thing: Transferring control to the kernel after setting up it's environment (stack, real/unreal/protected mode, enz, enz)

Thats all the wiki's have to say about it. But how am I supposed to do this? I've made the boot loader (I've c+pd it and then remade it) and a test environment.

But I don't understand how the kernel is loaded, sure the windows kernel is far bigger than 512 kb? So you switch to protected mode, but your kernel is still on the disk right?

So ultimately;
How to put the kernel in memory?

Re: Jump form bootloader to kernel

Posted: Tue Nov 23, 2010 11:18 am
by Combuster
The wiki page on bootloaders wrote:How do I actually load bytes

BIOS interrupt 13h
Please search before posting.

Re: Jump form bootloader to kernel

Posted: Tue Nov 23, 2010 11:25 am
by SCHiM
Combuster wrote:
The wiki page on bootloaders wrote:How do I actually load bytes

BIOS interrupt 13h
Please search before posting.
I have searched:

Image

But I must have missed that, thank you for your response

Re: Jump form bootloader to kernel

Posted: Tue Nov 23, 2010 11:39 am
by Combuster
There is a tutorial under booting.
There is a page called Bootloader.
There is an explicit "more info here" reference among the pages you have read.

Practice your search skills :wink:

Re: Jump form bootloader to kernel

Posted: Tue Nov 23, 2010 12:17 pm
by skyking
The choices I can think of is:

1. Make the kernel fit into the lower 640KiB
2. Load a piece of the kernel in low memory, switch to PM and copy it to high memory, and switch back to real mode and repeat.
3. Use BIOS services that allows reading from disk to high memory.
4. Write code that is able to read directly from disk in PM.

I think the first alternative would be good for a starter (it will take some time before your kernel exceeds half a meg anyway).