Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Hi everyone, I apologize for the total newb question I'm about to ask but for someone reason my kernel doesn't print text correctly when I use a string literal. Here is a sample.
void KernelEntry()
{
...
// This version works fine
char strMe[3] = { 'M', 'e', 0 };
// but if I use this instead...
char strMe[] = "Me"; // this causes nothing to print
PrintString(strMe);
...
}
I'm new to all of this and would like to thank you all in advance for any help you may be able to give me. Oh, and I am using a linker script which places my text segment above .data and .bss. my tools are gcc, nasm and ld.
I am using the -fwritable-strings option but I'm not too sure what that .rodata stuff is about. could you please expand on that? This is my current linker script.
what your strings are put in if you don't put them in .data (with -fwritable-strings). That part is data but can be put in the .text section to save overhead with program texts being multiply mapped.
I have this problem too. I'm not using a linker script though, what can I do? If I use -fwritable-strings it puts the strings directly in front of the code and it doesn't work right.