interrupts mechanisms, serial port data receiver
[quarnos.git] / arch / x86 / console.cpp
blob5d029480d02149adc4c4660b49b83e0b92da2866
1 /* Quarn OS
3 * Text console
5 * Copyright (C) 2008 Pawel Dziepak
7 * Functions that are needed to fully use text console which is "created" by
8 * keyboard and screen.
9 */
12 #include "arch_asm.h"
13 #include "console.h"
15 using namespace arch;
17 /* Show a sign of selected colour in certain place */
18 void arch::screen_print(const char sign, scr_color color, int x, int y) {
19 char *text_mem = (char*)0xB8000;
20 int pos = x + y * scr_width;
22 /* Put char into graphic card memory */
23 text_mem[pos * 2] = sign;
24 text_mem[pos * 2 + 1] = color;
26 /* Move a cursor */
27 pos++;
28 outb(0x3D4, 14);
29 outb(0x3D5, pos >> 8);
30 outb(0x3D4, 15);
31 outb(0x3D5, pos);