Page 1 of 1

[SOLVED] Strings

Posted: Mon May 07, 2007 2:57 pm
by t0xic
Hey, I'm new to OS design and I had a quick question

Why can I not use:

Code: Select all

kprint("Hello, World!",0,0x2);
^^^ This code just resets bochs

Instead of:

Code: Select all

char *msg = "Hello, World!";
kprint(msg,0,0x2);
^^^ This code works

--Thanks
Michael

Posted: Mon May 07, 2007 3:18 pm
by Combuster
do you have a .rodata in your linker script?

Posted: Mon May 07, 2007 3:29 pm
by t0xic
I'm not using a linker script...


I'm just using

Code: Select all

tools\ld -i -e _main -Ttext 0x1000 -o kernel.o main.o video.o ports.o mem.o read.o
How would I set up a linker script?

--Thanks
Michael

Posted: Tue May 08, 2007 2:01 pm
by Combuster
You are doing incremental linking. The output of this command is not suitable for being run directly as kernel binary.

There's a decent tutorial on how to compile and link a kernel, which includes linker scripts.

EDIT: If you solved it yourself, could you please post your solution for reference?

Posted: Tue May 08, 2007 5:18 pm
by t0xic
Thanks for your help,

I found the bkerndev link.ld file earlier but just hadn't used it.

Thanks again

--Michael