41 static u8 vga_set_basic_mode(
void)
53 if (mode != 3 && mode != 7)
63 static void vga_set_8font(
void)
91 static void vga_set_14font(
void)
114 static void vga_set_80x43(
void)
136 return (
inb(0x3cc) & 1) ? 0x3d4 : 0x3b4;
139 static void vga_set_480_scanlines(
void)
146 out_idx(0x0c, crtc, 0x11);
147 out_idx(0x0b, crtc, 0x06);
148 out_idx(0x3e, crtc, 0x07);
149 out_idx(0xea, crtc, 0x10);
150 out_idx(0xdf, crtc, 0x12);
151 out_idx(0xe7, crtc, 0x15);
152 out_idx(0x04, crtc, 0x16);
159 static void vga_set_vertical_end(
int lines)
167 ovfw = 0x3c | ((end >> (8-1)) & 0x02) | ((end >> (9-6)) & 0x40);
169 out_idx(ovfw, crtc, 0x07);
170 out_idx(end, crtc, 0x12);
173 static void vga_set_80x30(
void)
175 vga_set_480_scanlines();
176 vga_set_vertical_end(30*16);
179 static void vga_set_80x34(
void)
181 vga_set_480_scanlines();
183 vga_set_vertical_end(34*14);
186 static void vga_set_80x60(
void)
188 vga_set_480_scanlines();
190 vga_set_vertical_end(60*8);
193 static int vga_set_mode(
struct mode_info *mode)
196 vga_set_basic_mode();
202 switch (mode->
mode) {
233 static int vga_probe(
void)
235 static const char *card_name[] = {
236 "CGA/MDA/HGC",
"EGA",
"VGA"
238 static struct mode_info *mode_lists[] = {
243 static int mode_count[] = {
244 sizeof(cga_modes)/
sizeof(
struct mode_info),
245 sizeof(ega_modes)/
sizeof(
struct mode_info),
246 sizeof(vga_modes)/
sizeof(
struct mode_info),
262 if (oreg.bl != 0x10) {
267 if (oreg.al == 0x1a) {
279 video_vga.modes = mode_lists[
adapter];
280 video_vga.card_name = card_name[
adapter];
287 .set_mode = vga_set_mode,