Page 1 of 1

loading a simple c kernel

Posted: Sat Jun 13, 2009 4:16 pm
by eddie23
Hi everyone,
I have currently written my own bootloader much like the one on the tutorials here. The tutorials on here for writing a bootloader were very helpful for understanding the gdt and enabling of A20. However the tutorials here only explain MSVC++ do not explain how to use gcc (cywin or djgpp) to compile and link to load the image at the 1 meg mark. My current bootloader can load an image at 0x100000 but of course the simple kernel I currently load is written in asm and is assembled in pure binary making it easy to load at the 1 meg. I was trying to figure out how I could load a simple kernel (that just puts text to the monitor) I wrote in c to compile and link so it would run at 0x100000. Any tutorial I have seen says to use grub to load the image. I would like to use my own bootloader to load the image. I guess I am looking for a better explanation on what format I should compile and link in, like pe or elf, and how I would have to load that image.

Thanks,
I hope I have explained what I am looking for good enough.

Re: loading a simple c kernel

Posted: Sun Jun 14, 2009 12:29 am
by Wolf
Sorry, I think you may have to use MSVC++. I looked for GCC but he said he hasn't got around to the tutorial yet. MSVC is much more customizable, but often confusing.

Re: loading a simple c kernel

Posted: Sun Jun 14, 2009 1:14 pm
by Andyhhp
I suggest you read http://wiki.osdev.org/C_PlusPlus

It contains the relevent setup code to get both GCC and MSCV working.

Hope it helps

~Andrew

Re: loading a simple c kernel

Posted: Sun Jun 14, 2009 1:48 pm
by eddie23
Andyhhp wrote:I suggest you read http://wiki.osdev.org/C_PlusPlus

It contains the relevent setup code to get both GCC and MSCV working.

Hope it helps

~Andrew



Thank you I will read through that.

Re: loading a simple c kernel

Posted: Fri Aug 07, 2009 8:44 pm
by ehenkes
I would like to use my own bootloader to load the image.

In this tutorial you find own bootloader:
http://www.henkessoft.de/OS_Dev/OS_Dev1.htm

Re: loading a simple c kernel

Posted: Fri Oct 01, 2010 11:35 pm
by starcrossed
I was wondering could anyone be so kind and translate this article, in English? It is a good resource, but I don't know German. Or maybe some knows anything close to this that is similar? Thanks!