__asm__(".code16gcc\n"); void vga_graphics_write_at_offset(char, short); void vga_graphics_write(char); void vga_graphics_write_str(char*); static short CURSOR_LOC = 0; void _start() { vga_graphics_write('a'); vga_graphics_write('/'); vga_graphics_write('b'); char foo[] = "hello how are you"; vga_graphics_write_str(foo); while(1) { } } void vga_graphics_write_str(char* str) { while(*str) { vga_graphics_write(*str++); } } void vga_graphics_write(char value) { vga_graphics_write_at_offset(value, CURSOR_LOC); CURSOR_LOC += 2; } void vga_graphics_write_at_offset(char value, short offset) { __asm__( "mov %0, %%al \n" "mov %1, %%di \n" "mov %%al, %%gs:(%%di) \n" : :"r"(value), "r"(offset) : "%ax", "%di"); }