From owner-freebsd-stable@FreeBSD.ORG Fri Oct 20 02:07:03 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 511A616A40F; Fri, 20 Oct 2006 02:07:03 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA76243D45; Fri, 20 Oct 2006 02:07:02 +0000 (GMT) (envelope-from bms@FreeBSD.org) Received: from db2.internal (db2.internal [10.202.2.12]) by frontend1.messagingengine.com (Postfix) with ESMTP id 40C11DB7357; Thu, 19 Oct 2006 22:07:01 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by db2.internal (MEProxy); Thu, 19 Oct 2006 22:07:04 -0400 X-Sasl-enc: gdB0ClMKWP+xUPkdTzvquLDHWULBnaO621kQeXZ1J6Sg 1161310023 Received: from [192.168.123.18] (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTP id 13F081A092; Thu, 19 Oct 2006 22:07:02 -0400 (EDT) Message-ID: <45382F43.6020509@FreeBSD.org> Date: Fri, 20 Oct 2006 03:06:59 +0100 From: "Bruce M. Simpson" User-Agent: Thunderbird 1.5.0.5 (X11/20060825) MIME-Version: 1.0 To: Dominic Marks References: <15af975d0609212321r29fdd287p462ae0f2b7e404b4@mail.gmail.com> <15af975d0609220725s1206d7ebr53589adbc1b9c17@mail.gmail.com> <4513F5B0.9030300@goodforbusiness.co.uk> <200609261305.12224.jhb@freebsd.org> <451A3E33.8010805@goodforbusiness.co.uk> In-Reply-To: <451A3E33.8010805@goodforbusiness.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: CyberSans AirBort , freebsd-stable@freebsd.org, John Baldwin Subject: Re: bug on BTX X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2006 02:07:03 -0000 Hi all, FYI, this change adds 32 bytes to btx leaving 139 bytes free, according to btxld(8). As you probably all know, and just as a reminder, size in boot2 is at a premium -- it can't go over 8192 bytes as this is the boot-sector limit in the BSD disk-label. Dominic Marks wrote: > John Baldwin wrote: >> >> Hmm, are you willing to test a change that should fix that? If so, >> try http://people.freebsd.org/~jhb/patches/btx_crx.patch You'll need >> to do a 'make clean && make && make install' in /sys/boot after >> applying, and if the make install suceeeds, do a 'bsdlabel -B ad0s1' >> (replace ad0s1 with the actual slice you boot from). I think it >> should work (I think it was tested a while ago, but boot2 used to not >> fit, now it does though). Be warned though that if it doesn't work, >> you won't be able to boot from your disk. If that happens and you >> have a 6.x disc 1 lying around, you can boot into rescue mode and >> re-run 'bsdlabel' and move boot/loader.old to boot/loader on the root >> partition to get your system back. Ideally you'd try this on a >> system with data you don't care about (i.e., it's ok to just do a >> reinstall if it is hosed). It would be a good thing to solve the real mode problem, as it would enable FreeBSD to be booted from memory stick, USB CDROM, and within QEMU without resorting to the current workarounds e.g. using GRUB or skipping /boot/loader entirely to boot the kernel directly as I currently do in QEMU virtualization. It's pretty important in the big scheme of things as it helps to bring FreeBSD to a wider audience. Many people out there may well have run into this without Indeed I recently ran into this myself. Certain 1U machines which I acquired had problems booting from USB CDROM. I traced this back to the USB BIOS trying to LGDT and causing a general protection fault in vm86 mode. I worked around this by PXE booting them on a private VLAN with most helpful assistance from dwhite@. The long term solution we've been discussing is to change btx to trampoline into real mode before invoking certain INTs. I've been doing some tests with QEMU and Etherboot; it looks like its PXE UNDI driver sets up the NIC interrupt vector *before* BTX is called; it does not call LIDT in any of its paths. Its PXE entry point does however call LGDT to enter protected mode which of course kills BTX stone dead as we're in vm86 mode at that point. Per my IRC discussions with jhb@ : given that BTX reflects the hardware interrupts, we shouldn't need to reprogram the AT-PICs; indeed GRUB does not. This was one of his concerns. We can probably get away with a simple trampoline a la GRUB providing the INTs invoked by BTX or LOADER don't attempt to rewrite or redirect interrupt vectors once we're up and running. If time permits I may try to make the changes to BTX myself, however, I am always happy to review patches and provide feedback with a view to getting the problem solved going forward. Best, BMS