[Soekris] reboot issues with net4801 - clerified

Adrian Steinmann ast at marabu.ch
Thu Nov 13 13:15:52 UTC 2003


Randal

Yes, I think mp_machdep is a bit of a red herring. I just sent this
to Poul and Soren this morning but haven't heard back yet (I didn't
copy the list because it's a bit very experimental).

I'm kinda happy now because I have a new net4501 with upgraded 1.22
comBIOS and cmoswrite fix as well as the loader patch below: all
three reboots work.

Adrian

PS You don't use the loader? You sure you don't boot into /boot/loader
first (the ... booting kernel hit space message ... comes from the
loader).

From: Adrian Steinmann <ast>
Date: Thu, 13 Nov 2003 11:04:50 +0100
To: Poul-Henning Kamp <phk at phk.freebsd.dk>
Subject: reboot from loader on net4501: mp_machdep really relevant?
cc: soren at soekris.com

Poul

The more I study how loader reboots as compared to the syscall,
the more I think that mp_machdep is actually not used (isn't it
just an optional kernel file in the options SMP case?)

In /usr/src/sys/boot/i386/loader/main.c:

command_reboot(int argc, char *argv[])
{
    int i;

    for (i = 0; devsw[i] != NULL; ++i)
        if (devsw[i]->dv_cleanup != NULL)
            (devsw[i]->dv_cleanup)();

    printf("Rebooting...\n");
    delay(1000000);
    __exit(0);
}

i.e. loader just "exits cleanly" [IMHO, it should try to do more
stuff along the lines of cpu_reset_real() in vm_machdep.c]

I've got a patched loader now with *does* work on my net4501, it
uses stuff which I gleaned from vm_machdep.c [note I haven't copied
the list because I hardly understand what I'm doing here myself]

ok reboot
Rebooting ...
cpu reset did not work, attempting kbd reset


POST: 0123456789bcefghipajklnoq,,,tvwxy


with loader having this patch:
RCS file: /usr/cvs/src/sys/boot/i386/loader/main.c,v
retrieving revision 1.17.2.7
diff -u -r1.17.2.7 main.c
--- main.c      10 Oct 2002 15:53:27 -0000      1.17.2.7
+++ main.c      13 Nov 2003 09:47:33 -0000
@@ -34,6 +34,12 @@
 #include <stand.h>
 #include <string.h>
 #include <machine/bootinfo.h>
+#include <machine/cpufunc.h>
+#ifdef PC98
+#include <pc98/pc98/pc98.h>
+#else
+#include <i386/isa/isa.h>
+#endif
 #include <sys/reboot.h>

 #include "bootstrap.h"
@@ -237,7 +243,24 @@
        if (devsw[i]->dv_cleanup != NULL)
            (devsw[i]->dv_cleanup)();

-    printf("Rebooting...\n");
+    printf("Rebooting ...\n");
+
+    /* work around comBIOS 1.22 problem on Soekris net4x01 */
+
+    /* from /usr/src/sys/i386/i386/vm_machdep.c */
+    outb(0xf0, 0x00);               /* Reset. */
+    delay(500000);  /* wait 0.5 sec to see if that did it */
+    printf("cpu reset did not work, attempting kbd reset\n");
+    delay(1000000); /* wait 1 sec for printf to complete */
+
+    #if !defined(PC98) && !defined(BROKEN_KEYBOARD_RESET)
+       outb(IO_KBD + 4, 0xFE);
+       delay(500000);  /* wait 0.5 sec to see if that did it */
+       printf("Keyboard reset did not work\n");
+       delay(1000000); /* wait 1 sec for printf to complete */
+    #endif
+
+    printf("soekris loader exit...\n");
     delay(1000000);
     __exit(0);
 }



More information about the Soekris-tech mailing list