Subject: port-pmax/3543: A pmax kernel configured only for a serial console won't build.
To: None <gnats-bugs@gnats.netbsd.org>
From: Ted Lemon <mellon@adagio.fugue.com>
List: netbsd-bugs
Date: 04/25/1997 23:51:35
>Number:         3543
>Category:       port-pmax
>Synopsis:       A pmax kernel configured only for a serial console won't build.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 26 00:05:01 1997
>Last-Modified:
>Originator:     Ted Lemon
>Organization:
Barefoot Consulting
>Release:        4/25/97
>Environment:
System: NetBSD adagio.fugue.com 1.2D NetBSD 1.2D (ADAGIO) #8: Sun Apr 20 21:51:46 PDT 1997 mellon@toccata.fugue.com:/NetBSD/current/current/sys/arch/pmax/compile/ADAGIO pmax


>Description:
	There are a couple of places in the pmax kernel where it is
	assumed that the raster console pseudo-device has been configured.
	If a kernel is configured without the raster console device,
	pmax/tc/scc.c and pmax/pmax/cpu_cons.c still reference externals
	that are only defined if the raster console device has been
	configured.
>How-To-Repeat:
	Build a pmax kernel without pseudo-device rcons
>Fix:
	Apply the following patch (which also prettys up a couple of
	nits in the autoconf printout):

Index: arch/pmax/pmax/cpu_cons.c
===================================================================
RCS file: /cvsroot/src/sys/arch/pmax/pmax/cpu_cons.c,v
retrieving revision 1.14
diff -c -2 -r1.14 cpu_cons.c
*** cpu_cons.c	1996/10/13 03:39:48	1.14
--- cpu_cons.c	1997/04/26 00:35:07
***************
*** 212,215 ****
--- 212,216 ----
  	if (pmax_boardtype == DS_PMAX && kbd == 1)
  		screen = 1;
+ #if NRASTERCONSOLE > 0
  	/*
  	 * The boot program uses PMAX ROM entrypoints so the ROM sets
***************
*** 307,310 ****
--- 308,312 ----
  
  remcons:
+ #endif /* NRASTERCONSOLE > 0 */
  
  	/*
Index: arch/pmax/tc/scc.c
===================================================================
RCS file: /cvsroot/src/sys/arch/pmax/tc/scc.c,v
retrieving revision 1.18
diff -c -2 -r1.18 scc.c
*** scc.c	1996/10/16 05:04:51	1.18
--- scc.c	1997/04/26 00:35:14
***************
*** 125,128 ****
--- 125,130 ----
  #include <machine/conf.h>
  
+ #include "rasterconsole.h"
+ 
  extern void ttrstrt	__P((void *));
  
***************
*** 137,142 ****
   * compile on Alphas. 
   */
! #ifdef pmax
  #define HAVE_RCONS
  extern int pending_remcons;
  #endif
--- 139,146 ----
   * compile on Alphas. 
   */
! #if defined (pmax)
! #if NRASTERCONSOLE > 0
  #define HAVE_RCONS
+ #endif
  extern int pending_remcons;
  #endif
***************
*** 511,518 ****
  	 * complete.
  	 */
! #ifdef HAVE_RCONS
  	if (CONSOLE_ON_UNIT(unit) && (cn_tab->cn_pri == CN_REMOTE))
  		DELAY(10000);
! #else
  	if ((cputype == ST_DEC_3000_500 && sc->sc_dv.dv_unit == 1) ||
  	    (cputype == ST_DEC_3000_300 && sc->sc_dv.dv_unit == 0))
--- 515,524 ----
  	 * complete.
  	 */
! #ifdef pmax
  	if (CONSOLE_ON_UNIT(unit) && (cn_tab->cn_pri == CN_REMOTE))
  		DELAY(10000);
! #endif
! 
! #ifdef alpha
  	if ((cputype == ST_DEC_3000_500 && sc->sc_dv.dv_unit == 1) ||
  	    (cputype == ST_DEC_3000_300 && sc->sc_dv.dv_unit == 0))
***************
*** 558,563 ****
  		 * And what about maxine?
  		 */
! 		if (cn_tab->cn_dev == unit && cputype != DS_MAXINE)
  			return;
  
  		/*
--- 564,571 ----
  		 * And what about maxine?
  		 */
! 		if (cn_tab->cn_dev == unit && cputype != DS_MAXINE) {
! 			printf ("\n");
  			return;
+ 		}
  
  		/*
***************
*** 577,581 ****
  		printf(" (In sccattach: cn_dev = 0x%x)", cn_tab->cn_dev);
  	 	printf(" (Unit = %d)", unit);
! 		printf(": console");
  		pending_remcons = 0;
  		/*
--- 585,589 ----
  		printf(" (In sccattach: cn_dev = 0x%x)", cn_tab->cn_dev);
  	 	printf(" (Unit = %d)", unit);
! 		printf(": console\n");
  		pending_remcons = 0;
  		/*
>Audit-Trail:
>Unformatted: