22#define GRAY_ON_BLACK 0x07
30static void cls (
void);
153 outw (0x3d4, 0x0e | (cp & 0xff00));
154 outw (0x3d4, 0x0f | (cp << 8));
165 cp =
inb (0x3d5) << 8;
enum intr_level intr_disable(void)
Disables interrupts and returns the previous interrupt status.
enum intr_level intr_set_level(enum intr_level level)
Enables or disables interrupts as specified by LEVEL and returns the previous interrupt status.
intr_level
Interrupts on or off?
static uint8_t inb(uint16_t port)
Reads and returns a byte from PORT.
static void outw(uint16_t port, uint16_t data)
Writes the 16-bit DATA to PORT.
static void outb(uint16_t port, uint8_t data)
Writes byte DATA to PORT.
static char x
Verifies that mapping over the data segment is disallowed.
static bool inited
Already initialized?
#define ROUND_UP(X, STEP)
Yields X rounded up to the nearest multiple of STEP.
void speaker_beep(void)
Briefly beep the PC speaker.
unsigned short int uint16_t
void * memmove(void *dst_, const void *src_, size_t size)
Copies SIZE bytes from SRC to DST, which are allowed to overlap.
static void * ptov(uintptr_t paddr)
Returns kernel virtual address at which physical address PADDR is mapped.
static void init(void)
Initializes the VGA text display.
#define GRAY_ON_BLACK
Attribute value for gray text on a black background.
void vga_putc(int c)
Writes C to the VGA text display, interpreting control characters in the conventional ways.
#define COL_CNT
VGA text screen support.
static void cls(void)
Clears the screen and moves the cursor to the upper left.
static void clear_row(size_t y)
Clears row Y to spaces.
static void find_cursor(size_t *x, size_t *y)
Reads the current hardware cursor position into (*X,*Y).
static void newline(void)
Advances the cursor to the first column in the next line on the screen.
static void move_cursor(void)
Moves the hardware cursor to (cx,cy).
static size_t cx
Current cursor position.
static uint8_t(* fb)[COL_CNT][2]
Framebuffer.