I started yesterday with OS Development with a very basic kernel written in C booted from GRUB with QEMU. I wrote a simple kprint function to write some test text and it worked well. Today I thought of a more efficient 'kprint' function and I wrote it. I have just changed it a little bit but it has stopped working. I have been two hours trying to figure out why it's not working and I can't find out. I'm sure I'm missing something very stupid but I can't think so much at 3:11 AM. I've read the OSDev wiki "Printing" page to compare but although it's a different way of doing it I can't find anithing wrong.
The 'kprint' function is the following
Code: Select all
void kprint(int colour, const char *string)
{
volatile char *vidmem=(volatile char*)0xB8000;
int end = 0;
while(end == 0)
{
*vidmem=*string;
vidmem++;
*vidmem=colour;
vidmem++;
string++;
end = *string == '/' ? 1 : 0;
}
}
Greetings from Spain!