Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jan 2004 21:07:57 +0100 (CET)
From:      Adrian Steinmann <ast@marabu.ch>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        phk@phk.freebsd.dk
Subject:    i386/62003: make /boot/loader "reboot" code same as reboot() syscall
Message-ID:  <200401272007.i0RK7vpC000725@pico.marabu.ch>
Resent-Message-ID: <200401272020.i0RKKJVf022972@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         62003
>Category:       i386
>Synopsis:       make /boot/loader "reboot" code same as reboot() syscall
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-i386
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 27 12:20:19 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Adrian Steinmann
>Release:        FreeBSD 5.2-RELEASE i386
>Organization:
Webgroup Consulting AG
>Environment:
System: FreeBSD pico.marabu.ch 5.2-RELEASE FreeBSD 5.2-RELEASE #5: Mon Jan 26 09:37:10 CET 2004 root@pico.marabu.ch:/r/obj/usr/src/sys/PIC i386

>Description:
On Soekris net4501 and net4801 with comBIOS 1.22, reboot
from loader may hang. This was fixed by a change in btx.s:
revision 1.33 near line 293:

-		ljmp $0xffff,$0x0		# reboot the machine
+		ljmp $0xf000,$0xfff0		# reboot the machine

Nevertheless, it would be more consistant to also apply the patch for
loader main.c below where the same logic as for the syscall reboot() 

This would also follow the recommendation found Frank van Gilluwe,
1st ed., Addison Wesley 1994, ISBN 0-201-62277-7, p91ff, where he
says that using INT19 or jumping to BIOS boot f000:ffff are
"misconceptions" and that software control (keyboard reset) should
be used whenever possible.

This was discussed at length in soekris-tech mailing list mid-november
2003 (right before the 5.2 code freeze).

>How-To-Repeat:
Remove patch rev 1.33 from btx.s and test reboot on soekris
with comBIOS from loader -> hang.  Add patch below -> ok.

>Fix:

Index: main.c
===================================================================
RCS file: /usr/cvs/src/sys/boot/i386/loader/main.c,v
retrieving revision 1.28
diff -u -r1.28 main.c
--- main.c	25 Aug 2003 23:28:32 -0000	1.28
+++ main.c	27 Jan 2004 19:43:43 -0000
@@ -36,6 +36,7 @@
 #include <string.h>
 #include <machine/bootinfo.h>
 #include <sys/reboot.h>
+#include <i386/isa/isa.h>
 
 #include "bootstrap.h"
 #include "libi386/libi386.h"
@@ -243,6 +244,13 @@
 	    (devsw[i]->dv_cleanup)();
 
     printf("Rebooting...\n");
+
+#if !defined(BROKEN_KEYBOARD_RESET)
+    isa_outb(IO_KBD + 4, 0xFE);
+    delay(1000000);
+    printf("Keyboard reset failed; exiting...\n");
+#endif
+
     delay(1000000);
     __exit(0);
 }
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401272007.i0RK7vpC000725>