Jump form bootloader to kernel

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
SCHiM
Posts: 5
Joined: Tue Nov 23, 2010 10:52 am

Jump form bootloader to kernel

Post 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?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Jump form bootloader to kernel

Post by Combuster »

The wiki page on bootloaders wrote:How do I actually load bytes

BIOS interrupt 13h
Please search before posting.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
SCHiM
Posts: 5
Joined: Tue Nov 23, 2010 10:52 am

Re: Jump form bootloader to kernel

Post 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
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Jump form bootloader to kernel

Post 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:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
skyking
Member
Member
Posts: 174
Joined: Sun Jan 06, 2008 8:41 am

Re: Jump form bootloader to kernel

Post 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).
Post Reply