Page 1 of 1

GRUB and Char*

Posted: Tue Jan 02, 2007 10:28 pm
by Phibred
Hey, it has been a while and I'm trying to start up another operating system, this time in C and booting from GRUB.

Everything was working fine until I added

Code: Select all

char* helloWorld = "Hello World";
After that GRUB stopped booting my kernel. After that I commented out that line and it worked again.

I'm guessing the issue is something to do with my GRUB header is being pushed too deep into the file and grub is giving up on looking for it. Any advice on how to fix this? Maybe a linker trick I haven't found on the net?

Anyways, thanks for reading.

Posted: Tue Jan 02, 2007 10:36 pm
by Brynet-Inc
I'm not 100%, But I think your linker script might need a .rodata section?

Posted: Wed Jan 03, 2007 3:03 am
by Solar
BareBones in the Wiki has a "known good" GRUB loader / linker frame. Do you see any obvious differences between that and your code?