I'm trying to write a function which will print message onto the screen using VGA text mode buffer. This is function which prints a single char:
void putc(uint8_t c, enum Color term_color)
{
uint8_t *vidptr = (uint8_t*)0xB8000;
*vidptr = c;
vidptr++;
*vidptr = (uint8_t*)term_color;
vidptr++;
}
Here is function which I want to print string:
void puts(const uint8_t* str, enum Color term_color)
{
for(size_t i = 0; i != '\0'; i++) {
putc(str[i], term_color);
}
}
But it doesn't print anything. There is just black screen with blinking cursor.
EDIT: first function which prints a single character works.