src/vga.c
/***
 * write data to crt control register at index
 */
write data to crt control register at index
write data to crt control register at index
void vga_crt_reg_set(enum vga_crt_reg_index index, uchar data) {
    int16_t prev = inb(VGA_CRT_REG_ADR_PORT);
    outb(VGA_CRT_REG_ADR_PORT, (int16_t)index);
    outb(VGA_CRT_REG_DATA_PORT, data);
    outb(VGA_CRT_REG_ADR_PORT, prev);
}
void vga_crt_reg_set ( enum vga_crt_reg_index index , uchar data ) { int16_t prev = inb ( VGA_CRT_REG_ADR_PORT ) ; outb ( VGA_CRT_REG_ADR_PORT , ( int16_t ) index ) ; outb ( VGA_CRT_REG_DATA_PORT , data ) ; outb ( VGA_CRT_REG_ADR_PORT , prev ) ; }
write data to crt control register at index
write data to crt control register at index
// save previous index value and restore later