I have been start learning how to make an OS recently , and i already figured out how to use gcc , nasm and grub tools , but now i am confused on how should i display some gui on the screen instead of displaying plain text through the vga buffer , i heard that you have to use something called SDL , but i don't know how exactly should i do it , I need somebody to point that out for me
By the way , I also want to ask how would I use HDMI instead of VGA for my kernel.
Things I want archive:
Display some GUI when grub loading my kernel
current code that i copied from some article:
/* VGA provides support for 16 colors */#define BLACK 0#define GREEN 2#define RED 4#define YELLOW 14#define WHITE_COLOR 15unsigned short *terminal_buffer;unsigned int vga_index;void clear_screen(void){ int index = 0; /* there are 25 lines each of 80 columns; each element takes 2 bytes */ while (index < 80 * 25 * 2) { terminal_buffer[index] = ''; index += 2; }}void print_string(char *str, unsigned char color){ int index = 0; while (str[index]) { terminal_buffer[vga_index] = (unsigned short)str[index]|(unsigned short)color << 8; index++; vga_index++; }}void kmain(void){ /* TODO: Add random f-word here */ terminal_buffer = (unsigned short *)VGA_ADDRESS; vga_index = 0; clear_screen(); print_string("This text should be yellow", YELLOW); vga_index = 80; /* next line */ print_string("This text should be red", RED); return;}