Subject: Console Panic after Kernel comes up - in cons.c ...
To: None <port-powerpc@NetBSD.org>
From: netbsd <netbsd@scentech.ch>
List: port-powerpc
Date: 04/30/2004 16:46:30
Hi all,

porting 2.0 current to a 750 PowerPC HW platform we
focus the following problems.

-- actual situation : Kernel comes up but 'panics'
    saying "panic: cnopen: no console device" ...

    We have a HW that has a minimal BIOS. i.e. we don't
    need to initialize any serial port in "com.c". The
    Only thing we do is filling up the structure:

    -- begin snip from com.c

/*
  * Following are all routines needed for COM to act as console
  */
struct consdev comcons = {
	NULL, NULL, comcngetc, comcnputc, comcnpollc, NULL, NULL, NULL,
	NODEV, CN_NORMAL
};

-- end snip from com.c

however in cons.c the kernel checks if cn_tab->cn_dev ...

-- begin snip from cons.c

	cndev = cn_tab->cn_dev;
	if (cndev == NODEV) {
		/*
		 * This is most likely an error in the console attach
		 * code. Panicing looks better than jumping into nowhere
		 * through cdevsw below....
		 */
		panic("cnopen: no console device");

-- end snip cons.c

... is being set to "NODEV" .. the initial setting ...

So, we don't wantr to reinitialize the HW - UART ports, is
it sufficient call : cn_tab->cn_dev = makedev(0, 0);

in order to use the very same serial port for the kernel boot
sequence afterwards in the usermode for communication?

Thank's in advance

Markus