From owner-freebsd-current@FreeBSD.ORG Thu Jan 6 21:20:56 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A5E5916A4E8 for ; Thu, 6 Jan 2005 21:20:56 +0000 (GMT) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3CB8A43D45 for ; Thu, 6 Jan 2005 21:20:56 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 20836 invoked from network); 6 Jan 2005 21:20:55 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 6 Jan 2005 21:20:55 -0000 Received: from [10.50.41.243] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id j06LKeB8083753; Thu, 6 Jan 2005 16:20:49 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: freebsd-current@FreeBSD.org Date: Thu, 6 Jan 2005 14:11:35 -0500 User-Agent: KMail/1.6.2 References: <41BBDE8C.6040702@elischer.org> In-Reply-To: <41BBDE8C.6040702@elischer.org> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200501061411.35453.jhb@FreeBSD.org> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: Julian Elischer Subject: Re: could bootblock guru's look at this? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2005 21:20:57 -0000 On Sunday 12 December 2004 01:00 am, Julian Elischer wrote: > We need to decide what to do with this PR I just don't like loosing the bell but I guess it can go in. It also needs to be merged into boot0ext.S, but that wouldn't have to lose the bell as that version has more room for code. > -------- Original Message -------- > Subject: Re: kern/66248: [panic] bootloader is confused by booting from USB > flash, trashes main drives boot block > Date: Mon, 8 Nov 2004 17:20:21 GMT > From: Hans Petter Selasky > Reply-To: Hans Petter Selasky > To: freebsd-usb@freebsd.org > > The following reply was made to PR kern/66248; it has been noted by GNATS. > > From: Hans Petter Selasky > To: jhb@freebsd.org, freebsd-gnats-submit@freebsd.org, bremner@unb.ca > Cc: > Subject: Re: kern/66248: [panic] bootloader is confused by booting from USB > flash, trashes main drives boot block > Date: Mon, 8 Nov 2004 18:24:03 +0100 > > --SUOF0GtieIMvvwua > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > > Hi, > > Attached patch for /src/sys/boot/i386/boot0/boot0.S closes kern/66248 > Apply using: cat boot0.S.diff | patch -N -l > > > When the boot0 boot-manager is used on a floppy or USB drive, the > floppy's or USB's boot-sector gets written to the hdd! > > Solution: Only update the boot-sector when there is a valid drive number > or the drive number is set manually. > > To make the patch fit into the code I had to disable the "beep-signal". > > Yours > -HPS > > > --SUOF0GtieIMvvwua > Content-Type: text/plain; charset=us-ascii > Content-Disposition: attachment; filename="boot0.S.diff" > > *** boot0.S.ref Wed Oct 20 17:24:19 2004 > --- boot0.S Wed Oct 20 17:30:56 2004 > *************** > *** 103,112 **** > * Check what flags were loaded with us, specifically, Use a predefined > Drive. * If what the bios gives us is bad, use the '0' in the block > instead, as well. */ > ! testb $0x20,_FLAGS(%bp) # Set number drive? > jnz main.1 # Yes > testb %dl,%dl # Drive number valid? > js main.2 # Possibly (0x80 set) > main.1: movb _SETDRV(%bp),%dl # Drive number to use > /* > * Whatever we decided to use, now store it into the fake > --- 103,117 ---- > * Check what flags were loaded with us, specifically, Use a predefined > Drive. * If what the bios gives us is bad, use the '0' in the block > instead, as well. */ > ! testb $0x20,_FLAGS(%bp) # Set drive number? > jnz main.1 # Yes > testb %dl,%dl # Drive number valid? > js main.2 # Possibly (0x80 set) > + /* > + * Only update the boot-sector when there is a valid drive number or > + * the drive number is set manually. > + */ > + orb $0x40,_FLAGS(%bp) # Disable updates > main.1: movb _SETDRV(%bp),%dl # Drive number to use > /* > * Whatever we decided to use, now store it into the fake > *************** > *** 203,210 **** > /* > * Start of input loop. Beep and take note of time > */ > ! main.10: movb $ASCII_BEL,%al # Signal > callw putchr # beep! > xorb %ah,%ah # BIOS: Get > int $0x1a # system time > movw %dx,%di # Ticks when > --- 208,218 ---- > /* > * Start of input loop. Beep and take note of time > */ > ! main.10: > ! #ifdef BEL > ! movb $ASCII_BEL,%al # Signal > callw putchr # beep! > + #endif > xorb %ah,%ah # BIOS: Get > int $0x1a # system time > movw %dx,%di # Ticks when > > --SUOF0GtieIMvvwua-- > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org