dc_ioasic_consinit(cd.cn_dev);
dz_ioasic_consinit(cd.cn_dev);
consinit(){	int crt;	register char *oscon;	int screen = 0;#ifdef RCONS_HACK	extern void (*v_putc) __P ((dev_t, int));#endif	cn_tab = &cd;	/*	 * First get the "osconsole" environment variable.	 */	oscon = (*callv->_getenv)("osconsole");	crt = kbd = -1;	if (oscon && *oscon >= '0' && *oscon <= '9') {		kbd = *oscon - '0';		/*cn_tab.cn_pri = CN_DEAD;*/		screen = 0;		while (*++oscon) {			if (*oscon == ',')				/*cn_tab.cn_pri = CN_INTERNAL;*/				screen = 1;			else if (screen &&			    *oscon >= '0' && *oscon <= '9') {				crt = kbd;				kbd = *oscon - '0';				break;			}		}	}	/*	 * We can't do anything until auto-configuration	 * has run, and that requires kmalloc(), which	 * hasn't been initialized yet.  Just keep using	 * whatever the PROM vector gave us.	 */#if NRASTERCONSOLE > 0	if (pmax_boardtype == DS_PMAX && kbd == 1)		screen = 1;	/*	 * The boot program uses PMAX ROM entrypoints so the ROM sets	 * osconsole to '1' like the PMAX.	 */	if (pmax_boardtype == DS_3MAX && crt == -1 && kbd == 1) {		/* Try to use pmax onboard framebuffer */		screen = 1;		crt = 0;		kbd = 7;	}	/*	 * First try the keyboard/crt cases then fall through to the	 * remote serial lines.	 */	if (screen) {	    switch (pmax_boardtype) {	    case DS_PMAX:#if NDZ_DS > 0 && NPM > 0		if (pminit(0, 0, 1)) {			cd.cn_pri = CN_INTERNAL;			cd.cn_dev = makedev(DCDEV, DCKBD_PORT);			cd.cn_getc = LKgetc;			lk_divert(dcGetc, makedev(DCDEV, DCKBD_PORT));			cd.cn_putc = rcons_vputc;	/*XXX*/			return;		}#endif /* NDZ_DS and NPM */		goto remcons;	    case DS_MAXINE:#if NDTOP > 0		if (kbd == 3) {			cd.cn_dev = makedev(DTOPDEV, 0);			cd.cn_getc = dtopKBDGetc;		} else#endif /* NDTOP */			goto remcons;#if NXCFB > 0		if (crt == 3 && xcfbinit(NULL, NULL, 0, 0)) {			cd.cn_pri = CN_INTERNAL;			cd.cn_putc = rcons_vputc;	/*XXX*/			return;		}#endif /* XCFB */		break;	    case DS_3MAX:#if NDZ_IOASIC > 0		if (kbd == 7) {			cd.cn_dev = makedev(DCDEV, DCKBD_PORT);			cd.cn_getc = LKgetc;			lk_divert(dcGetc, makedev(DCDEV, DCKBD_PORT));		} else#endif /* NDZ_IOASIC */			goto remcons;		break;	    case DS_3MIN:	    case DS_3MAXPLUS:#if NSCC > 0		if (kbd == 3) {			/*cd.cn_dev = makedev (RCONSDEV, 0);*/			cd.cn_dev =  makedev(SCCDEV, SCCKBD_PORT);			lk_divert(sccGetc, makedev(SCCDEV, SCCKBD_PORT));			cd.cn_getc = LKgetc;		} else#endif /* NSCC */			goto remcons;		break;	    default:		goto remcons;	    };	    /*	     * Check for a suitable turbochannel frame buffer.	     */#if NTC>0	    if (tc_findconsole(crt)) {			cd.cn_pri = CN_NORMAL;#ifdef RCONS_HACK/* FIXME */		cd.cn_putc = v_putc;			cd.cn_dev = makedev (RCONSDEV, 0);#endif /* RCONS_HACK */			cd.cn_putc = rcons_vputc;	/*XXX*/			return;	    } else#endif		printf("No crt console device in slot %d\n", crt);	}remcons:#endif	/* NRASTERCONSOLE > 0 */	/*	 * Configure a serial port as a remote console.	 */	switch (pmax_boardtype) {	case DS_PMAX:#if NDZ_DS > 0		if (kbd == 4)			cd.cn_dev = makedev(DCDEV, DCCOMM_PORT);		else			cd.cn_dev = makedev(DCDEV, DCPRINTER_PORT);		dc_ds_consinit(cd.cn_dev);		return;#endif /* NDZ_DS */		break;	case DS_3MAX:#if (NDZ_IOASIC > 0)		cd.cn_dev = makedev(DCDEV, DCPRINTER_PORT);		dc_ioasic_consinit(cd.cn_dev);		return;#endif /* NDZ */		break;	}	/*	 * XXX	 * scc serial drivers need to be rewritten to handle init this early.	 * Defer switching to non-PROM driver until after serial device	 * is configured normally.	 */	pending_remcons = 1;	printf("Using PROM serial output until serial drivers initialized\n");	/* We never changed output; go back to using PROM input */	cd.cn_dev = makedev (0, 0);	cd.cn_getc = /*(int (*)(dev_t)) */ romgetc;}