loading a simple c kernel

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
eddie23
Posts:2
Joined:Sat Jun 13, 2009 3:38 pm
loading a simple c kernel

Post by eddie23 » Sat Jun 13, 2009 4:16 pm

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.

User avatar
Wolf
Posts:11
Joined:Mon May 18, 2009 10:35 pm

Re: loading a simple c kernel

Post by Wolf » Sun Jun 14, 2009 12:29 am

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.

Andyhhp
Moderator
Posts:387
Joined:Tue Oct 23, 2007 10:05 am
Location:127.0.0.1
Contact:

Re: loading a simple c kernel

Post by Andyhhp » Sun Jun 14, 2009 1:14 pm

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
Image

eddie23
Posts:2
Joined:Sat Jun 13, 2009 3:38 pm

Re: loading a simple c kernel

Post by eddie23 » Sun Jun 14, 2009 1:48 pm

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.

ehenkes
Posts:34
Joined:Fri Jul 24, 2009 5:35 pm

Re: loading a simple c kernel

Post by ehenkes » Fri Aug 07, 2009 8:44 pm

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

starcrossed
Posts:1
Joined:Fri Oct 01, 2010 11:31 pm

Re: loading a simple c kernel

Post by starcrossed » Fri Oct 01, 2010 11:35 pm

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!

Post Reply