summaryrefslogtreecommitdiffstats
path: root/sys/dev/vt
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2015-08-13 14:43:11 +0000
committermarcel <marcel@FreeBSD.org>2015-08-13 14:43:11 +0000
commite93bf931e2542edebf1c770d64016e16ab8ef838 (patch)
tree0c8624e9878ca975a58f96a5fd9ffdf77cb792b7 /sys/dev/vt
parent0ddc1c9d3a7931e045b5bd01847dab309340d09b (diff)
downloadFreeBSD-src-e93bf931e2542edebf1c770d64016e16ab8ef838.zip
FreeBSD-src-e93bf931e2542edebf1c770d64016e16ab8ef838.tar.gz
Fix text mode operation.
We first map 64KB at 0xA0000 and then determine whether to work in text or graphics mode. When graphics mode, the mapping is precisely what we need and everything is fine. But text mode, has the frame buffer relocated to 0xB8000. We didn't map that much to safely add 0x18000 bytes to the base address. Now we first check whether to work in text or graphics mode and then map the frame buffer at the right address and with the right size (0xA0000+64KB for graphics, 0xB8000+32KB for text). PR: 202276 Tested by: ed@
Diffstat (limited to 'sys/dev/vt')
-rw-r--r--sys/dev/vt/hw/vga/vt_vga.c10
-rw-r--r--sys/dev/vt/hw/vga/vt_vga_reg.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/vt/hw/vga/vt_vga.c b/sys/dev/vt/hw/vga/vt_vga.c
index 0b7ebe4..4661f35 100644
--- a/sys/dev/vt/hw/vga/vt_vga.c
+++ b/sys/dev/vt/hw/vga/vt_vga.c
@@ -883,9 +883,9 @@ vga_bitblt_text_txtmode(struct vt_device *vd, const struct vt_window *vw,
/* Convert colors to VGA attributes. */
attr = bg << 4 | fg;
- MEM_WRITE1(sc, 0x18000 + (row * 80 + col) * 2 + 0,
+ MEM_WRITE1(sc, (row * 80 + col) * 2 + 0,
ch);
- MEM_WRITE1(sc, 0x18000 + (row * 80 + col) * 2 + 1,
+ MEM_WRITE1(sc, (row * 80 + col) * 2 + 1,
attr);
}
}
@@ -1226,8 +1226,6 @@ vga_init(struct vt_device *vd)
# error "Architecture not yet supported!"
#endif
- bus_space_map(sc->vga_fb_tag, VGA_MEM_BASE, VGA_MEM_SIZE, 0,
- &sc->vga_fb_handle);
bus_space_map(sc->vga_reg_tag, VGA_REG_BASE, VGA_REG_SIZE, 0,
&sc->vga_reg_handle);
@@ -1236,9 +1234,13 @@ vga_init(struct vt_device *vd)
vd->vd_flags |= VDF_TEXTMODE;
vd->vd_width = 80;
vd->vd_height = 25;
+ bus_space_map(sc->vga_fb_tag, VGA_TXT_BASE, VGA_TXT_SIZE, 0,
+ &sc->vga_fb_handle);
} else {
vd->vd_width = VT_VGA_WIDTH;
vd->vd_height = VT_VGA_HEIGHT;
+ bus_space_map(sc->vga_fb_tag, VGA_MEM_BASE, VGA_MEM_SIZE, 0,
+ &sc->vga_fb_handle);
}
if (vga_initialize(vd, textmode) != 0)
return (CN_DEAD);
diff --git a/sys/dev/vt/hw/vga/vt_vga_reg.h b/sys/dev/vt/hw/vga/vt_vga_reg.h
index 5bfb8ce..cf33a37 100644
--- a/sys/dev/vt/hw/vga/vt_vga_reg.h
+++ b/sys/dev/vt/hw/vga/vt_vga_reg.h
@@ -49,6 +49,8 @@
#define VGA_MEM_BASE 0xA0000
#define VGA_MEM_SIZE 0x10000
+#define VGA_TXT_BASE 0xB8000
+#define VGA_TXT_SIZE 0x08000
#define VGA_REG_BASE 0x3c0
#define VGA_REG_SIZE 0x10+0x0c
OpenPOWER on IntegriCloud