I decided to start it all over again. I am (ab)using Code from "Brans Kernel Development Tutorial" right now, because the Tutorial does all the things that i have accomplished back in my previous efforts, just that it is way more elegant and it does not have the strange problem of crashing with a growing kernel.
Now i have new problems:
1. When i use the code unmodified, text output does not work.
(the chars from the keyboard-isr are shown as they should but the string from the message that is putch-ed is lost.) I assume this is a problem that has something to do with pointers, literal strings and the linker? I also believe it has been solved on this forum, but i could not find the old threads that i remember and don't remember what to do.
Text output was the only thing my previous attempts had working, which does not work in the tutorial code... but well, text output is kind of a nifty feature, so please help me on this
2. I tried to add these lines in main, to verify my thoughts about problem 1:
Code: Select all
unsigned char* v=(unsigned char*) 0xb8000;
v[0]=67; //"C"
v[1]=10; //Light green
After trying to boot the modified kernel, grub complained about my kernel not having the right format anymore.
When i looked at my kernel-binary it indeed proved to have not the right format, because the data-section (ie all the constants), had been linked in before the text section and the start.o file with the multiboot-header.
I really wonder how this could happen just by adding three harmless lines, especially as i am using a linker script (provided by the tutorial as well).
Thanks in advance for help.
Of course i can also post any needed code or just a link to the Tutorial, if needed.