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.
I have a very simple k_main() that clears the screen and prints "kernel loaded" when it is called... the print() and clr() functions are in a separate file. The function is called correctly and the clr() function works as it should, but print() does not seem to do anything at all. What isn't working here?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
I noticed you don't set the attribute byte. It is not unlikely that you are printing black-on-black text.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
void mov_cr(unsigned short x, unsigned short y)
{
unsigned short position;
position = 80*y + x;
// Set new cursor position
out(0x3D4, 15);
out(0x3D5, (unsigned char)(position));
out(0x3D4, 14);
out(0x3D5, (unsigned char)(position >> 8));
}
I dont think the printing code is the problem, though. I tried setting the variable directly in the print function: