Page 1 of 1

Kernel and Bootloader

Posted: Thu Jan 17, 2008 4:31 am
by ExtremeCoder27
I am not new to assembly and C, I am experienced in both :)
I want to make an os, I have a kernel.bin that contains a main function that does nothing, I want to add a printf fucntion to print letters to the screen so I need some help there, I also need to know how to make 512byte bootloader to load my kernel in the memory and when I have the new function, I want to make it print some "Hello World!" string on the screen.

Thanks for all your help,

ExtremeCoder27

Posted: Thu Jan 17, 2008 4:42 am
by AJ
Hi and Welcome!

Sorry for the fairly standard reply for this question but here are some links that may help:

1. For the boot sector, see http://www.osdever.net . There are several sample boot sectors there - that's how I got started (eventually, I moved to GRUB, but I intend to go back to my own boot loader soon).

2. For the kernel, there are two sources that will give you everything you need for a 'Hello World' kernel and beyond. They are http://www.jamesmolloy.co.uk and Bran's Kernel Development Tutorial, which is, again, over on Bona Fide OS development.

Of course, the wiki (link at top of page) is an extremely useful resource for starting out - particularly pay attention to the Getting Started and barebones guides.

It can be a little frustrating for good ASM and C programmers to start with, because you do somewhat have to go back to basics - particularly with the C where you have next to no standard library support initially. For printf, I suggest you start with a basic PutChar, add a PutString and eventually work up to coding a full Printf function, which will expand with your needs.

Cheers,
Adam