An additional suggestion for the 'Brans known bugs' page
Posted: Sun Nov 02, 2008 9:46 pm
Hi,
Came across this (very cool) site after spending the last couple of days covering the basics, mainly using Bran's Kernel Development tutorial. I'm sure glad he took the time to write that! Anyway, one problem I had run into was my Grub loader not recognising the file format of my kernel binary when introducing strings into my main.c. I saw the note in the page http://wiki.osdev.org/Bran%27s_Known_Bugs regarding the .rodata section in the linker file, but in my case this appeared not to work (still getting a 1Mb+ sized binary and grub not recognising the format of the file). Examining the kernel binary using hexdump, I saw that the strings were still getting placed at location 0 rather than where they should be.
The fix is simple, and probably obvious to those in the know, but it took me a little while to solve it. Bran specifies the 'aout' format in the nasm command in his build.bat. By changing the output format of nasm from 'aout' to 'elf', as well as adding the .rodata line in the link.ld file everything works just fine.
Sorry if this has been done to death in the past, but not seeing anything on the 'known bugs' page I thought I'd mention it!
Eddy.
Came across this (very cool) site after spending the last couple of days covering the basics, mainly using Bran's Kernel Development tutorial. I'm sure glad he took the time to write that! Anyway, one problem I had run into was my Grub loader not recognising the file format of my kernel binary when introducing strings into my main.c. I saw the note in the page http://wiki.osdev.org/Bran%27s_Known_Bugs regarding the .rodata section in the linker file, but in my case this appeared not to work (still getting a 1Mb+ sized binary and grub not recognising the format of the file). Examining the kernel binary using hexdump, I saw that the strings were still getting placed at location 0 rather than where they should be.
The fix is simple, and probably obvious to those in the know, but it took me a little while to solve it. Bran specifies the 'aout' format in the nasm command in his build.bat. By changing the output format of nasm from 'aout' to 'elf', as well as adding the .rodata line in the link.ld file everything works just fine.
Sorry if this has been done to death in the past, but not seeing anything on the 'known bugs' page I thought I'd mention it!
Eddy.