* This function initializes cga * */
| 37 | * |
| 38 | */ |
| 39 | void rt_cga_init(void) |
| 40 | { |
| 41 | rt_uint16_t volatile *cp; |
| 42 | rt_uint16_t was; |
| 43 | rt_uint32_t pos; |
| 44 | |
| 45 | cp = (rt_uint16_t *) (CGA_BUF); |
| 46 | was = *cp; |
| 47 | *cp = (rt_uint16_t) 0xA55A; |
| 48 | if (*cp != 0xA55A) |
| 49 | { |
| 50 | cp = (rt_uint16_t *) (MONO_BUF); |
| 51 | addr_6845 = MONO_BASE; |
| 52 | } |
| 53 | else |
| 54 | { |
| 55 | *cp = was; |
| 56 | addr_6845 = CGA_BASE; |
| 57 | } |
| 58 | |
| 59 | /* Extract cursor location */ |
| 60 | outb(addr_6845, 14); |
| 61 | pos = inb(addr_6845+1) << 8; |
| 62 | outb(addr_6845, 15); |
| 63 | pos |= inb(addr_6845+1); |
| 64 | |
| 65 | crt_buf = (rt_uint16_t *)cp; |
| 66 | crt_pos = pos; |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * This function will write a character to cga |
no test coverage detected