#include <stdint.h> #include <cursor.h> #include <ports.h> #include <_stdio.h> void setCursorOffset(uint16_t offset) { outb(0x3D4, 0x0F); outb(0x3D5, (uint8_t) (offset & 0xFF)); outb(0x3D4, 0x0E); outb(0x3D5, (uint8_t) ((offset >> 8) & 0xFF)); } void setCursorPosition(uint8_t x, uint8_t y) { setCursorOffset(x + y * VIDEO_WIDTH); } uint16_t getCursorOffset() { uint16_t result = 0; outb(0x3D4, 0x0F); result |= inb(0x3D5); outb(0x3D4, 0x0E); result |= ((uint16_t)inb(0x3D5)) << 8; return result; }