Today after a long time I got to spend some time on SOS. It was working well with Bochs but bochs was giving me some problems regarding video mem (good old 0xb8000) refreshes etc. So I decided to give it a try on . I downloaded it and tried to run SOS kernel on that. To my surprise it failed and the reason was A20! The beast was back. Then I tried SOS kernel on a real machine and there also it gave me "A20 disabled" error. This was amazing. The method to enable A20 that worked on bochs was failing on real hardware as well as on VMware.
Uptill now I read millions of bootsector primers on the net and each had started with the same thing. They all recommend NOT to write your own bootsector and use boot loaders like . But I dint take it because I wanted to do it from scratch. And I did it on one architecture. Now I dont have time as well as enthusiasm to do it for every architecture. I told myself that I learned what I wanted and now its no disgrace to use GRUB as a boot loader :).
I found a on google. This is an amazing document and a must if you are developing a kernel.
And yes.. SOS now boots using GRUB. Its amazing how powerful GRUB is. Its almost unbelievable. I just had to put a Multiboot header in an elf file with .text starting from 1MB. Put it on a floppy, with ext2 or FAT, in /boot/grub directory and you are ready to go!!! Simply Bloody Amazing!
I also coded my own printf (i call it kprint), my own hex/dec_to_string functions. Its just amazing how much time I can spend on the actual kernal library now that GRUB is doing the loading.
So the advise is : Remember GRUB is your friend!