Using an assembly file as kernel image
Posted: Tue Mar 15, 2011 3:25 pm
Hi All,
First of all thanks for all the links provided on OSDev.org. I am trying to write my own OS and hence want to initially just print a string to the screen. I am using GRUB as my bootloader. I have a .S file which is my assembly script to just print a string to the console continuously.
I used the following command to get .o file.
gcc -c Kernel.S
Then the following ld command.
ld Kernel.o -o kernel.bin --oformat=binary -Ttext=0x100000
Hence I get a .bin image now. What do I need to do now to make this .bin image bootable. I tried booting with this image but got the following error.
Error 13: Invalid or unsupported executable format.
I can directly load my computer with a good kernel image as it is a spare system that I am using. I dont want to use the QEMU/BOCHS that is mentioned on the website.
Hope I have provided all the required details.
Thanks in advance
Dheeraj
First of all thanks for all the links provided on OSDev.org. I am trying to write my own OS and hence want to initially just print a string to the screen. I am using GRUB as my bootloader. I have a .S file which is my assembly script to just print a string to the console continuously.
I used the following command to get .o file.
gcc -c Kernel.S
Then the following ld command.
ld Kernel.o -o kernel.bin --oformat=binary -Ttext=0x100000
Hence I get a .bin image now. What do I need to do now to make this .bin image bootable. I tried booting with this image but got the following error.
Error 13: Invalid or unsupported executable format.
I can directly load my computer with a good kernel image as it is a spare system that I am using. I dont want to use the QEMU/BOCHS that is mentioned on the website.
Hope I have provided all the required details.
Thanks in advance
Dheeraj