From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 15 19:11:25 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 6A17916A4CE; Sat, 15 Nov 2003 19:11:25 -0800 (PST) Received: from gateway.soekris.com (adsl-68-122-44-73.dsl.pltn13.pacbell.net [68.122.44.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3566243F75; Sat, 15 Nov 2003 19:11:24 -0800 (PST) (envelope-from soren@soekris.com) Received: from soekris.com (1.4.soekris.com [192.168.1.4] (may be forged)) by gateway.soekris.com (8.11.6/8.11.6) with ESMTP id hAG3ITu00792; Sat, 15 Nov 2003 19:18:30 -0800 (PST) (envelope-from soren@soekris.com) Message-ID: <3FB6EB4D.8050901@soekris.com> Date: Sat, 15 Nov 2003 19:13:17 -0800 From: Soren Kristensen Organization: Soekris Engineering User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en, da MIME-Version: 1.0 To: Adrian Steinmann References: <32365.1068624044@critter.freebsd.dk> <3FB281B4.5060105@soekris.com> <200311160131.CAA21864@marabu.marabu.ch> In-Reply-To: <200311160131.CAA21864@marabu.marabu.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Poul-Henning Kamp cc: hackers@freebsd.org cc: msmith@freebsd.org Subject: Re: BTX loader reboot on Soekris comBIOS1.22 fails (patches forbtx.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 03:11:25 -0000 Hi Adrian, Adrian Steinmann wrote: > > In the BTX loader, the reboot command simply exits the loader, and > end up in exit near line 252 in /usr/src/sys/boot/i386/btx/btx/btx.s > which disables paging, flushes TLB, switches to real mode, flags a > 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). 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.... 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.... Regards, Soren