lkml.org 
[lkml]   [2000]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectMDA Patch
I have been using two monitors, VGA and MDA, on my machine for over a year
now. Originally I was using 2.0.x with a patch to handle the MDA. I tried
2.2.x but I was not happy with the support for my MDA, there were a number of
bugs. When the MDA was intiallised the cursor would jump to an odd place on
the screen, screen blanking would make the console crash, as would flipping
for X11 to any console on the MDA.

I started running 2.2.x in December, I have been ignoring and working around
the various bugs in the linux kernel since then. I tried fixing it in
December, but my patch was not very clean, so i did not release it. I have
since redone my patch from scratch. It is attached.

I think the problems were caused because mdacon.c was written by somebody
using a Hercules graphics adaptor. I am using an original IBM MDA. I tracked
down the odd cursor movements on boot-up to some detection code. I commented
out the offending code, not sure if this is going to cause anybody problems,
comments?

The screen blanking just crashes my MDA card, so I assume that it is something
you can do on a Hercules, but not on an original MDA. I added a check to see
if the card is an MDA, and if so, then to just erase every character on the
screen. Seems to work.

This patch is against 2.2.14, I do not think there are many changes with
2.3.x, so it should apply okay to that as well.

--
while :;do read x;echo \?;done
--- linux/drivers/video/mdacon.c Sat May 15 00:46:16 1999
+++ kernel-source-2.2.14/drivers/video/mdacon.c Sun Mar 19 11:49:23 2000
@@ -5,6 +5,8 @@
*
* including portions (c) 1995-1998 Patrick Caulfield.
*
+ * slight improvements (c) 2000 Edward Betts <edward@debian.org>
+ *
* This file is based on the VGA console driver (vgacon.c):
*
* Created 28 Sep 1997 by Geert Uytterhoeven
@@ -240,13 +242,18 @@
/* Ok, there is definitely a card registering at the correct
* memory location, so now we do an I/O port test.
*/
-
- if (! test_mda_b(0x66, 0x0f)) { /* cursor low register */
+
+ /* Edward: These two mess `tests' mess up my cursor on bootup */
+
+ /* cursor low register */
+ /* if (! test_mda_b(0x66, 0x0f)) {
return 0;
- }
- if (! test_mda_b(0x99, 0x0f)) { /* cursor low register */
+ } */
+
+ /* cursor low register */
+ /* if (! test_mda_b(0x99, 0x0f)) {
return 0;
- }
+ } */

/* See if the card is a Hercules, by checking whether the vsync
* bit of the status register is changing. This test lasts for
@@ -339,6 +346,9 @@
mda_initialize();
}

+ /* cursor looks ugly during boot-up, so turn it off */
+ mda_set_cursor(mda_vram_len - 1);
+
printk("mdacon: %s with %ldK of memory detected.\n",
mda_type_name, mda_vram_len/1024);

@@ -494,13 +504,21 @@

static int mdacon_blank(struct vc_data *c, int blank)
{
- if (blank) {
- outb_p(0x00, mda_mode_port); /* disable video */
+ if (mda_type == TYPE_MDA) {
+ if (blank)
+ scr_memsetw((void *)mda_vram_base,
+ mda_convert_attr(c->vc_video_erase_char),
+ c->vc_screenbuf_size);
+ /* Tell console.c that it has to restore the screen itself */
+ return 1;
} else {
- outb_p(MDA_MODE_VIDEO_EN | MDA_MODE_BLINK_EN, mda_mode_port);
+ if (blank)
+ outb_p(0x00, mda_mode_port); /* disable video */
+ else
+ outb_p(MDA_MODE_VIDEO_EN | MDA_MODE_BLINK_EN,
+ mda_mode_port);
+ return 0;
}
-
- return 0;
}

static int mdacon_font_op(struct vc_data *c, struct console_font_op *op)
\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.023 / U:1.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site