From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 16 04:40:07 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C686516A4CF; Sun, 16 Nov 2003 04:40:07 -0800 (PST) Received: from oneplusone.ch (oneplusone.ch [212.55.208.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id 825A543F75; Sun, 16 Nov 2003 04:40:05 -0800 (PST) (envelope-from ast@marabu.ch) Received: from oneplusone.ch (localhost [127.0.0.1]) by oneplusone.ch (8.12.9p1/8.12.9) with ESMTP id hAGCe3i3035152; Sun, 16 Nov 2003 13:40:03 +0100 (MET) (envelope-from ast@marabu.ch) Received: (from uucp@localhost) by oneplusone.ch (8.12.9p1/8.12.9/Submit) with UUCP id hAGCe3Ya035151; Sun, 16 Nov 2003 13:40:03 +0100 (MET) (envelope-from ast@marabu.ch) Received: from marabu.marabu.ch (marabu.marabu.ch [192.168.21.3]) by nano.marabu.ch (8.12.9/8.12.9) with ESMTP id hAGCXvuv071131; Sun, 16 Nov 2003 13:33:58 +0100 (MET) (envelope-from ast@marabu.marabu.ch) Received: by marabu.marabu.ch (8.7.5/20001028-ast-8.3) id NAA27227; Sun, 16 Nov 2003 13:33:56 +0100 (CET) Message-Id: <200311161233.NAA27227@marabu.marabu.ch> MIME-Version: 1.0 (NeXT Mail 3.3 v124.8483.6) Content-Type: text/plain In-Reply-To: <3FB6EB4D.8050901@soekris.com> X-Nextstep-Mailer: Mail 3.3 (Enhance 2.0b6) Received: by NeXT.Mailer (1.124.8483.6) From: Adrian Steinmann Date: Sun, 16 Nov 2003 13:33:53 +0100 To: Soren Kristensen References: <32365.1068624044@critter.freebsd.dk> <3FB281B4.5060105@soekris.com> <200311160131.CAA21864@marabu.marabu.ch> <3FB6EB4D.8050901@soekris.com> X-Organization: Webgroup Consulting AG, Apollostrasse 21, 8032 Zurich X-Phone-Numbers: Switzerland, Tel +41 1 380 30 83 Fax +41 1 380 30 85 cc: Poul-Henning Kamp cc: hackers@freebsd.org cc: msmith@freebsd.org Subject: Re: BTX loader reboot on Soekris comBIOS1.22 fails (patches for btx.s and loader/main.c enclosed) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2003 12:40:07 -0000 Soren We seem to have localized the loader reboot hang back to the first far jump happening in btx.s: observed: > warm boot (writes 0x1234 to 0x472) and then jumps to the BIOS reboot > handler: > - ljmp $0xffff,$0x0 # reboot the machine > > however in various literature it is mentioned that $0xf000,$0xfff0 > is bound to work better on most platforms, so I tried > + ljmp $0xf000,$0xfff0 # reboot the machine > > which indeed works! (OpenBSD, for example, uses ljmp $0xf000,$0xfff0). replied: The reason is that on some hardware (t.ex the Geode) there need to be work done early on in the BIOS to enable access to the BIOS in low memory before that first far jump, and therefore the first jump is not a far jump as on the original PC, but a near jump. Having the segment set at FFFF can screw up that first near jump.... This is exactly what I have read in the book "The Undocumented PC" by Frank van Gilluwe, 1st ed., Addison Wesley 1994, ISBN 0-201-62277-7, p91ff. In there, he also says that using INT19 or jumping to BIOS boot f000:ffff are "misconceptions" and that software control (keyboard reset) should be used whenever possible (hence both of my patches). I will wait for feedback from some Cc: people and if required, submit PRs to fix btx.s and loader/main.c. then opined: So the ljmp $0xf000,$0xfff0 would be the best way, but since my BIOS patches F000:FFF0 after copying the BIOS from flash to ram, I could also change my near jump to a far jump to increase compatibility.... Both! FreeBSD should fix the jmp in btx.s and you could do an initial far jump for increased compatibility. Adrian