Determine the select code of the console device, or -1 for internal grf.

Pass this value to the kernel in register d5.  This value isn't currently
used by the kernel, but will be in the future.
This commit is contained in:
thorpej 1995-10-04 06:54:42 +00:00
parent f060c456de
commit d08330454a
8 changed files with 45 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cons.c,v 1.8 1995/08/05 16:47:37 thorpej Exp $ */
/* $NetBSD: cons.c,v 1.9 1995/10/04 06:54:42 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -61,6 +61,9 @@ struct consdev constab[] = {
{ 0 },
};
int curcons_scode; /* select code of device currently being probed */
int cons_scode; /* final select code of console device */
struct consdev *cn_tab;
int noconsole;
@ -71,15 +74,25 @@ cninit()
cn_tab = NULL;
noconsole = 1;
cons_scode = 256; /* larger than last valid select code */
for (cp = constab; cp->cn_probe; cp++) {
(*cp->cn_probe)(cp);
if (cp->cn_pri > CN_DEAD &&
(cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri))
(cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri)) {
cn_tab = cp;
cons_scode = curcons_scode;
}
}
if (cn_tab) {
(*cn_tab->cn_init)(cn_tab);
noconsole = 0;
#if 0
printf("console: ");
if (cons_scode == -1)
printf("internal grf\n");
else
printf("scode %d\n", cons_scode);
#endif
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: consdefs.h,v 1.2 1995/08/05 16:47:38 thorpej Exp $ */
/* $NetBSD: consdefs.h,v 1.3 1995/10/04 06:54:43 thorpej Exp $ */
/*
* Copyright (c) 1982, 1990, 1993
@ -33,6 +33,12 @@
* SUCH DAMAGE.
*/
/*
* Glue for determining console select code.
*/
extern int curcons_scode;
extern int cons_scode;
/*
* Console routine prototypes.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: dca.c,v 1.7 1995/08/05 16:47:39 thorpej Exp $ */
/* $NetBSD: dca.c,v 1.8 1995/10/04 06:54:44 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -84,7 +84,9 @@ dcaprobe(cp)
cp->cn_pri = CN_DEAD;
break;
}
#endif
curcons_scode = CONSCODE;
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: dcm.c,v 1.7 1995/08/05 16:47:40 thorpej Exp $ */
/* $NetBSD: dcm.c,v 1.8 1995/10/04 06:54:45 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -80,6 +80,8 @@ dcmprobe(cp)
cp->cn_pri = CN_DEAD;
break;
}
curcons_scode = hw->hw_sc;
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: ite.c,v 1.9 1995/08/05 16:47:44 thorpej Exp $ */
/* $NetBSD: ite.c,v 1.10 1995/10/04 06:54:47 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -102,6 +102,7 @@ int nitesw = sizeof(itesw) / sizeof(itesw[0]);
/* these guys need to be in initialized data */
int itecons = -1;
struct ite_softc ite_softc[NITE] = { 0 };
int ite_scode[NITE] = { 0 };
/*
* Locate all bitmapped displays
@ -129,6 +130,7 @@ iteconfig()
continue;
if (i >= NITE)
break;
ite_scode[i] = hw->hw_sc;
ip = &ite_softc[i];
ip->isw = &itesw[dtype];
ip->regbase = (caddr_t) gr;
@ -200,6 +202,7 @@ iteprobe(cp)
unit = ite;
}
}
curcons_scode = ite_scode[unit];
cp->cn_dev = unit;
cp->cn_pri = pri;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: netboot.c,v 1.8 1995/09/13 18:52:39 thorpej Exp $ */
/* $NetBSD: netboot.c,v 1.9 1995/10/04 06:54:48 thorpej Exp $ */
/*-
* Copyright (c) 1982, 1986, 1990, 1993
@ -36,7 +36,7 @@
*/
#ifndef lint
static char rcsid[] = "$NetBSD: netboot.c,v 1.8 1995/09/13 18:52:39 thorpej Exp $";
static char rcsid[] = "$NetBSD: netboot.c,v 1.9 1995/10/04 06:54:48 thorpej Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -56,6 +56,7 @@ char line[100];
extern u_int opendev;
extern char *lowram;
extern int noconsole;
extern int cons_scode;
char *name;
char *names[] = {
@ -76,7 +77,7 @@ main()
bootdev = MAKEBOOTDEV(0, 0, 0, 0, 0);
printf("\n>> NetBSD NETWORK BOOT HP9000/%s CPU [%s]\n",
getmachineid(), "$Revision: 1.8 $");
getmachineid(), "$Revision: 1.9 $");
printf(">> Enter \"reset\" to reset system.\n");
bdev = B_TYPE(bootdev);
@ -157,6 +158,7 @@ machdep_start(entry, howto, loadaddr, ssym, esym)
asm("movl %0,d7" : : "m" (howto));
asm("movl #0,d6"); /* tell setroot we've netbooted */
asm("movl %0,d5" : : "m" (cons_scode));
asm("movl %0,a5" : : "a" (loadaddr));
asm("movl %0,a4" : : "a" (esym));
(*((int (*)())entry))();

View File

@ -1,4 +1,4 @@
/* $NetBSD: pboot.c,v 1.8 1995/09/02 05:04:22 thorpej Exp $ */
/* $NetBSD: pboot.c,v 1.9 1995/10/04 06:54:49 thorpej Exp $ */
/*-
* Copyright (c) 1982, 1986, 1990, 1993
@ -36,7 +36,7 @@
*/
#ifndef lint
static char rcsid[] = "$NetBSD: pboot.c,v 1.8 1995/09/02 05:04:22 thorpej Exp $";
static char rcsid[] = "$NetBSD: pboot.c,v 1.9 1995/10/04 06:54:49 thorpej Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -56,6 +56,7 @@ char line[100];
extern u_int opendev;
extern char *lowram;
extern int noconsole;
extern int cons_scode;
char *name;
char *names[] = {
@ -70,7 +71,7 @@ main()
int currname = 0;
printf("\n>> NetBSD BOOT HP9000/%s CPU [%s]\n",
getmachineid(), "$Revision: 1.8 $");
getmachineid(), "$Revision: 1.9 $");
printf(">> Enter \"reset\" to reset system.\n");
bdev = B_TYPE(bootdev);
@ -156,6 +157,7 @@ machdep_start(entry, howto, loadaddr, ssym, esym)
asm("movl %0,d7" : : "m" (howto));
asm("movl %0,d6" : : "m" (opendev));
asm("movl %0,d5" : : "m" (cons_scode));
asm("movl %0,a5" : : "a" (loadaddr));
asm("movl %0,a4" : : "a" (esym));
(*((int (*)())entry))();

View File

@ -1,4 +1,4 @@
/* $NetBSD: sys_inst.c,v 1.1 1995/09/23 17:38:51 thorpej Exp $ */
/* $NetBSD: sys_inst.c,v 1.2 1995/10/04 06:54:51 thorpej Exp $ */
/*
* Copyright (c) 1995 Jason R. Thorpe.
@ -68,6 +68,7 @@ char line[100];
extern u_int opendev;
extern char *lowram;
extern int noconsole;
extern int cons_scode;
char *kernel_name = "/netbsd";
@ -580,6 +581,7 @@ machdep_start(entry, howto, loadaddr, ssym, esym)
asm("movl %0,d7" : : "m" (howto));
asm("movl %0,d6" : : "m" (opendev));
asm("movl %0,d5" : : "m" (cons_scode));
asm("movl %0,a5" : : "a" (loadaddr));
asm("movl %0,a4" : : "a" (esym));
(*((int (*)())entry))();