*BSD News Article 12664


Return to BSD News archive

Newsgroups: comp.os.386bsd.bugs
Path: sserve!newshost.anu.edu.au!munnari.oz.au!metro!ipso!runxtsa!bde
From: bde@runx.oz.au (Bruce Evans)
Subject: pccons initialization bugs with mono screen
Message-ID: <1993Mar14.050211.3739@runx.oz.au>
Organization: RUNX Un*x Timeshare.  Sydney, Australia.
Date: Sun, 14 Mar 93 05:02:11 GMT
Lines: 53

The following bugs showed up on an old system with a mono screen and
a kernel compiled by gcc-2.3.3.

1. kdb_init() is called before the console driver is initialized from
   isa_configure().  So when there are no symbols, ddb calls the
   console driver before the latter is initialized.  pccons supports
   this (sput() is self-initializing) but it is inconvenient for all
   console drivers to have to support it.
2. gcc-2.3.3 optimized out the 0xA55A color/mono test, so the screen
   type defaulted to 'color'.  Reading the bogus CRTC registers gave
   a bogus cursor offset, perhaps 0xFFFF, but pehaps larger so that
   crtat = Crtat + cursorat was an unmapped address and caused a
   panic.
3. After (2) was fixed, kernel messages were printed with the color
   intense black on black == black.  I had been using pcvt so I don't
   have the hard-coded escape sequence to set the color in init_main.c.
   This escape sequence was necessary to make the mono kernel colors
   readable.

The patches fix the color/mono test and the mono kernel color.  The
out of bounds cursor offset is not fixed.

*** /isa/pccons.c~~	Fri Mar  5 13:50:46 1993
--- /isa/pccons.c	Sun Mar 14 05:45:08 1993
***************
*** 568,572 ****
  	if (crtat == 0)
  	{
! 		u_short *cp = Crtat + (CGA_BUF-MONO_BUF)/CHR, was;
  		unsigned cursorat;
  
--- 627,632 ----
  	if (crtat == 0)
  	{
! 		u_short volatile *cp = Crtat + (CGA_BUF-MONO_BUF)/CHR;
! 		u_short was;
  		unsigned cursorat;
  
***************
*** 601,605 ****
  
  		if (vs.color == 0) {
! 			vs.kern_fg_at = FG_INTENSE;
  			vs.so_at = FG_BLACK | BG_LIGHTGREY;
  		} else {
--- 661,665 ----
  
  		if (vs.color == 0) {
! 			vs.kern_fg_at = FG_UNDERLINE;
  			vs.so_at = FG_BLACK | BG_LIGHTGREY;
  		} else {
-- 
Bruce Evans  bde%runx.oz.au@ips.oz.au