Load the 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
Frans
Posts: 4
Joined: Mon Nov 05, 2007 2:15 pm

Load the kernel

Post 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)
If you live each day as if it was your last, someday you'll most certainly be right.
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Post 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 .
Frans
Posts: 4
Joined: Mon Nov 05, 2007 2:15 pm

Post by Frans »

Ok, thanks for your post. I'm now searching on OsDever.
If you live each day as if it was your last, someday you'll most certainly be right.
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Post by 01000101 »

Hey, Also, a really helpful site is http://www.mohanraj.info/ .
gives a good breakdown of the bootloader->kernel relationship.

Pe@cE
Frans
Posts: 4
Joined: Mon Nov 05, 2007 2:15 pm

Post by Frans »

It seems to be helpful :). I'm now reading...
If you live each day as if it was your last, someday you'll most certainly be right.
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post 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)
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post 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!
Post Reply