*BSD News Article 3447


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel!munnari.oz.au!mips!mips!darwin.sura.net!Sirius.dfn.de!zrz.tu-berlin.de!math.fu-berlin.de!unidui!du9ds3!veit
From: veit@du9ds3.uni-duisburg.de (Holger Veit)
Subject: Re: Possable pccons.c bug in 0.1
References: <Bsqyun.Jp5@pix.com>
Date: 10 Aug 92 12:40:35 GMT
Reply-To: veit@du9ds3.uni-duisburg.de
Organization: Uni-Duisburg FB9 Datenverarbeitung
Sender: @unidui.uni-duisburg.de
Message-ID: <veit.713450435@du9ds3>
Lines: 45

In <Bsqyun.Jp5@pix.com> stripes@pix.com (Josh Osborne) writes:

>In sput() in pccons.c (I think it's with the ISA drivers) we have:

>...
>	was = *cp;
>	*cp = (u_short) 0xA55A;
>	if (*cp != 0xA55A) {
>			addr_6845 = MONO_BASE;
>			vs.color=0;
>	} else {
>			*cp = was;
>			addr_6845 = CGA_BASE;
>			Crtat = Crtat + (CGA_BUF-MONO_BUF)/CHR;
>			vs.color=1;
>	}
>...

>I *think* it looks like the if should be
>	if (was != 0xA55A) ...

>However I don't have a monocrome graphics card to try out...

>Sorry if the bug has been detected (or if I misread good code).
>-- 
>           stripes@pix.com              "Security for Unix is like
>      Josh_Osborne@Real_World,The          Multitasking for MS-DOS"
>      "The dyslexic porgramer"                  - Kevin Lockwood
>We all agree on the necessity of compromise.  We just can't agree on
>when it's necessary to compromise.       - Larry Wall

"was" saves the old value at the address "cp" is pointing to. It is 
restored in the else path if there is RAM at this address. With a 
Hercules card, there is none there.
The only problem that might be there is that the cc must be prevented to
put the value "*cp" into a register (after storing it). This might be done
by making "cp" "volatile".

Holger

-- 
|  |   / Holger Veit             | INTERNET: veit@du9ds3.uni-duisburg.de
|__|  /  University of Duisburg  | BITNET: veit%du9ds3.uni-duisburg.de@UNIDO
|  | /   Dept. of Electr. Eng.   | "No, my programs are not BUGGY, these are
|  |/    Inst. f. Dataprocessing |          just unexpected FEATURES"