Port-hp300 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: HP 9000-382 based instrument panics on cnopen()



> Is there anything I should printf() within your patch too?
> Since I can get a reliable dmesg now using serial, I can output
> pretty much arbitrary information.

A major problem on debugging framebuffer "console" is
that we cannot use the "console" for debug printfs.

I've used the attached diff to "make serial com(4) at dio also
work as console even on framebuffer console".

I'm not sure if it can still be applied (i.e. console messages are emitted
both on the framebuffer and serial once after com(4) at dio is attached),
but worth to try.

Index: dev/com_dio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hp300/dev/com_dio.c,v
retrieving revision 1.9
diff -u -p -d -r1.9 com_dio.c
--- dev/com_dio.c	8 Dec 2018 17:46:11 -0000	1.9
+++ dev/com_dio.c	6 Oct 2021 11:29:47 -0000
@@ -114,6 +114,16 @@ com_dio_match(device_t parent, cfdata_t 
 	return 0;
 }
 
+#include <dev/cons.h>
+extern void comcnputc(dev_t, int);
+static void (*cnputc_save)(dev_t, int);
+static void
+cnputc_debug(dev_t dev, int c)
+{
+	(*cnputc_save)(dev, c);
+	comcnputc(dev, c);
+}
+
 static void
 com_dio_attach(device_t parent, device_t self, void *aux)
 {
@@ -160,6 +170,11 @@ com_dio_attach(device_t parent, device_t
 
 	/* Enable interrupts. */
 	bus_space_write_1(iot, iohdca, DCA_IC, IC_IE);
+
+	{
+		cnputc_save = cn_tab->cn_putc;
+		cn_tab->cn_putc = cnputc_debug;
+	}
 }
 
 int
@@ -182,7 +197,7 @@ com_dio_cnattach(bus_space_tag_t bst, bu
 	bus_space_unmap(iot, iohdca, DCA_SIZE);
 
 	switch (id) {
-#ifdef CONSCODE
+#if 1 //def CONSCODE
 	case DCAID0:
 	case DCAID1:
 #endif
Index: hp300/autoconf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hp300/hp300/autoconf.c,v
retrieving revision 1.110
diff -u -p -d -r1.110 autoconf.c
--- hp300/autoconf.c	7 Aug 2021 16:18:53 -0000	1.110
+++ hp300/autoconf.c	6 Oct 2021 11:29:48 -0000
@@ -774,7 +774,7 @@ hp300_cninit(void)
 #endif
 #if NCOM_DIO > 0
 	if (!dio_scan(com_dio_cnattach))
-		return;
+		/* return */;
 #endif
 #if NDCM > 0
 	if (!dio_scan(dcmcnattach))

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index