Page 1 of 1

Load the kernel

Posted: Mon Nov 05, 2007 2:25 pm
by Frans
Yesterday I found this forum (and it's wiki), when I was searching for some
information to develop an operating system.

I started just a few days ago (:P), and now I've some problems.

1) How could I load a kernel from my bootloader? Are there maybe some simple
examples on the internet? Maybe I searched on the wrong way.

2) I thought you always need to write a bootloader to start your OS. But i saw on
different examples on this site nothing about a home made bootloader, but GRUB.
Is it possible to run your kernel straight from GRUB? (So you don't have to start
with 16 bit mode)

I hope there is someone who could help me :) I hope I did not make many big
mistakes with my English.

(This forum and wiki are great, with lots of information. I think I will come back
many times to find something I need)

Posted: Mon Nov 05, 2007 2:41 pm
by 01000101
1) The bootloader essentailly just reads sectors from a floppy/hdd/usb and throws them in a specified memory location and 'jumps' to that loaction to start up the kernel.

2) GRUB is a great multi-stage bootloader that sets up protected mode (32-bit) and does all the grunge work for you. Making a bootloader yourself does not mean that it is all 16-bit. Mine (in development) starts in 16-bit mode (you have to), reads floppy sectors, enables the A20 and enters protected mode and then jumps to high memory where I placed my kernel.

Another great place for tutorials (besides the wiki here) is OsDever.net .

Posted: Mon Nov 05, 2007 2:45 pm
by Frans
Ok, thanks for your post. I'm now searching on OsDever.

Posted: Mon Nov 05, 2007 4:06 pm
by 01000101
Hey, Also, a really helpful site is http://www.mohanraj.info/ .
gives a good breakdown of the bootloader->kernel relationship.

Pe@cE

Posted: Mon Nov 05, 2007 4:21 pm
by Frans
It seems to be helpful :). I'm now reading...

Posted: Mon Nov 05, 2007 10:22 pm
by JAAman
beyond tutorials, specifications are essential, make sure you get the CPU manuals -- the intel manuals assuming you are using an x86 chip -- the link in my signature will get you to a site where you can download or (preferably) order copies of the intel manuals (there are 5 volumes, make sure you get them all)

Posted: Tue Nov 06, 2007 3:26 am
by JamesM
I would personally reccommend using GRUB to get you started. It's an easy way of getting your kernel up-and-running quickly, and it seems most people that get bored of OSDev get bored of writing the bootloader and jumping through all the strange x86 hoops and pitfalls!

You can always write your own bootloader later.

If you're after tutorials there are some (that I wrote) in my signature that use GRUB.

http://www.jamesmolloy.co.uk

Good luck!