loading a simple c kernel
Posted: 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.
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.