Re: map_isa_ioregs

Frank Wille <[email protected]>
Newsgroups gmane.os.netbsd.ports.ofppc
Organization Privates Internet Ostwestfalen/Lippe e.V.
Message-ID <[email protected]>
Tim Rightnour wrote:

On 08.11.07 02:19:25 you wrote:

> Are you using a physical console?  It's possible I broke something in that
> realm.  I do all my work via serial console.

Not even serial console works here. But I debugged the problem today:

First, when working with physical console, checking for device_type property
"display" fails on the Pegasos. It is called "bootconsole". Additionally,
when the pckbc driver is missing, cninit_kd() would just return, instead of
falling back to the ofwbootcons.

Second, when using a serial terminal, the check for the name-property
"serial" fails, which is "failsafe" here. IMHO this check is not needed at
all, because it is a fallback to the ofwbootcons.

I fixed both with the following patch, giving me output with physical and
serial console on the Peg2:

--- ofw_consinit.c.orig 2007-11-08 20:12:03.000000000 +0100
+++ ofw_consinit.c  2007-11-08 21:16:52.000000000 +0100
@@ -150,11 +150,6 @@
        goto nocons;
 
    OFPRINTF("console type: %s\n", type);
-   if (strcmp(type, "display") == 0) {
-       cninit_kd();
-       return;
-   }
-
    if (strcmp(type, "serial") == 0) {
        struct consdev *cp;
        char name[32];
@@ -182,12 +177,12 @@
 
        OF_getprop(console_node, "name", name, sizeof(name));
        /* fallback to ofwbootcons */
-       if (strcmp(name, "serial") == 0) {
-           cp = &consdev_ofwbootcons;
-           cn_tab = cp;
-       }
+       cp = &consdev_ofwbootcons;
+       cn_tab = cp;
        return;
    }
+   else
+       cninit_kd();
 nocons:
    return;
 }
@@ -374,9 +369,9 @@
 #endif
 
    /*
-    * No keyboard is found.  Just return.
+    * No keyboard is found.  Fallback to ofwbootcons.
     */
-   printf("no console keyboard\n");
+   cn_tab = &consdev_ofwbootcons;
    return;
 
 kbd_found:;


And, it seems to me that printf() is pretty useless in this early stage. It
doesn't generate any output when anything goes wrong. Maybe we should think
about using OFPRINTF instead?

-- 
    _  Frank Wille ([email protected])
 _ //  http://sun.hasenbraten.de/~frank/
 \X/   Phx @ #AmigaGer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.