How to load kernel file through bootloader in a memory?
-
- Posts: 11
- Joined: Wed Apr 08, 2009 2:21 pm
How to load kernel file through bootloader in a memory?
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)?
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: How to load kernel file through bootloader in a memory?
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.
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?
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
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