Print finction not working?
I have the following code:
Code:
void Print(char Text[10])
{
char *vidmem = (char *) 0xb8002;
int I = 0;
while (I != 5)
{
if (Text[I] == '\n')
{
CurrentPosition = CurrentPosition + 80;
}
else {
vidmem[CurrentPosition] = Text[I];
}
I++;
CurrentPosition = CurrentPosition + 2;
}
return;
}
This code is intended to be part of my "kernel" for my "OS".
The idea of the function is that it takes a message and prints the letters on the screen. I get no errors compiling.
When I go to run the code though, the program doesn't even seem to print anything, it just shutsdown. I know that it should work because the following code
Code:
char *vidmem = (char *) 0xb8002;
vidmem = 'A';
Works just fine. So I think the problem is that somehow my loop is stuffing me up. Any ideas?