Page 1 of 1

How to load kernel file through bootloader in a memory?

Posted: Fri May 29, 2009 4:59 pm
by likeagunfire
What's the right way to load kernel file through boot loader in a memory (the kernel is written with C, for example, "Hello world."). Um, I don't need someone to tell me, exactly how to write in boot loader the "Hello world", but how to load another file (that is a kernel file)?

Re: How to load kernel file through bootloader in a memory?

Posted: Fri May 29, 2009 5:33 pm
by NickJohnson
It depends on what bootloader you are using. If you have GRUB set up properly on a floppy or floppy image, with the kernel in the root directory, you can put the lines:

title Hello World
kernel (fd0)/kernel

in grub/menu.lst

Setting up a floppy from scratch with a bootloader is a bit more tricky, and depends a lot on your OS. If you run Linux, look at JamesM's kernel tutorial (http://www.jamesmolloy.co.uk/tutorial_html/index.html), and if you run Windows, look at bkerndev's tutorial (http://www.osdever.net/bkerndev/index.php). Both have good basic bootloader/image/emulator setups, and are actually almost identical in that respect.

Re: How to load kernel file through bootloader in a memory?

Posted: Fri May 29, 2009 7:33 pm
by kop99
Another way is that you have your own bootloader...
It's like redundancy work, but it's good experience for you.
If you decide to make your own bootloader, Wiki's babystep1~babystep8 is good reference.
http://wiki.osdev.org/Babystep1