+/* XXX reunify this with vga-overlay? */
+#define VRAM_BASE 0xA0000UL
+#define TEXT_CONSOLE_OFFSET 0x18000UL
+
+#define TEXT_CONSOLE_BASE (VRAM_BASE + TEXT_CONSOLE_OFFSET)
+
+static unsigned char vga_read(unsigned char idx)
+{
+ outb(CRTC_IDX_REG, idx);
+ return inb(CRTC_DATA_REG);
+}
+
+static char * vga_base()
+{
+ return (char *) (
+ TEXT_CONSOLE_BASE
+ + (((unsigned int) vga_read(CRTC_START_ADDR_MSB_IDX)) << 9)
+ + (((unsigned int) vga_read(CRTC_START_ADDR_LSB_IDX)) << 1)
+ );
+}
+