This way it works (I used simple string in this example to make it shorter):
Code: Select all
void kmain()
{
char string[] = "Hello World!";
monitor_print(string);
}
Code: Select all
char string[] = "Hello World!";
void kmain()
{
monitor_print(string);
}
Code: Select all
void monitor_print(unsigned char* message)
{
int i;
for(i = 0; i < strlen(message); i++){
monitor_print_char(message[i]);
}
}
void monitor_print_char(unsigned char c)
{
unsigned short* where;
unsigned attr = attribute << 8;
where = vid_mem_ptr + (cursor_y * 80 + cursor_x); //vid_mem_ptr = (unsigned short*)0xb8000
*where = c | attr;
cursor_x++;
if(cursor_x >= 80){
cursor_x = 0;
cursor_y++;
}
monitor_scroll();
monitor_move_cursor();
}