In this post i'll speak about the boot loader
- Why a bootloader ?
- Existing bootloaders
- writing your own bootloader
*Why a bootloader ?
The bootloader is a peace of code that will do some very initial operations before launching the kernel.
Generally, the BIOS will load some Kb into a given memory adress (0x7C0 for ~x86) the give it the controle, this code will do some initialisations then load/run the kernel (or a second stage loader)
*Existing bootloaders :
There is many OpenSource bootloaders that can be found around the web, but the most popular one is GRUB, GRUB is a bootloader for any OS, it Multiboot standards complients, and is relatively easy to install and use, for more information about GRUB go here
http://www.mega-tokyo.com/osfaq2/index.php/GRUB.
Other bootloaders can be used such as (XOSL, Bootmagic, System commander ...) but IMHO, they are more complicated to use with your own OS than GRUB.
*Writing your own BootLoader :
this step is not really needed since you can use an existing bootloader (like GRUB) or pick one from another small OS ...
but i recomand to try writing your own Bootloader since this step will help you understand some low level stuff which can be helpful for futur OS Debugging or for writing low level routines, and also, because this part is the only one that must be totally written in asm (a good exercice)
I personnaly write a personalised bootloader with two stages :
-The bootsector (1st stage) loads the kernel and the loader to given memory addresses and gives control to the loader.
-The second stage does some basic hardware detections, switch to Pmode, move the kernel above the first Megabyte then launch it.
you can take a look at my bootloader if you want here :
http://xos.freezee.org/downloads/xossrc_23092004.tar.gz
the bootloader is in xolo/ directory (comments are in french, will be translated later

)
two stages bootloaders are useful when you want to move your kernel from the first Mb (and this is very recomanded) ....