Bran's Kernel development tutorial
I was reading Bran's Kernel development tool at following link: Bona Fide OS Development Bran's Kernel Development Tutorial
I used link.ld start.asm main.c system.h scrn.c file from this link as it is.
As per the tutorial, it says add the two function calls(init_video() and puts()) to main function in main.c
After adding the above two function calls to the main function, I compiled the code with following commands
nasm -f aout -o start.o start.asm
gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o main.o main.c
gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o scrn.o scrn.c
ld -T link.ld -o kernel.bin start.o scrn.o
Compilation and linking went fine, and kernel.bin was generated
I copied kernel.bin to /boot and edited menu.lst under grub to pick up this kernel as follows.
Now, when I rebooted the system and tried to boot with kernel.bin, I got following error:
Error 13: Invalid or Unsupported executable format
When I removed the calls to init_video() and puts() from the main() function and used the newly generated kernel.bin, I did not get any error 13 as mentioned above.
Request you to help in this regard.
For all the files that are mentioned above are available at :
Bona Fide OS Development Bran's Kernel Development Tutorial
Because there is lot of code, I did not paste it here.
Thanks and Regards,