From owner-freebsd-current@FreeBSD.ORG Thu Jan 6 00:17:59 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 D04C916A4CE; Thu, 6 Jan 2005 00:17:59 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 74BF243D4C; Thu, 6 Jan 2005 00:17:59 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id 461C87A450; Wed, 5 Jan 2005 16:17:59 -0800 (PST) Message-ID: <41DC83B6.2030605@elischer.org> Date: Wed, 05 Jan 2005 16:17:58 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3.1) Gecko/20030516 X-Accept-Language: en, hu MIME-Version: 1.0 To: Peter Edwards References: <200501052101.j05L139i085802@freefall.freebsd.org> In-Reply-To: <200501052101.j05L139i085802@freefall.freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: FreeBSD Current Subject: Re: kern/66248: [panic] bootloader is confused by booting from USB flash, trashes main drives boot block 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 00:18:00 -0000 Peter Edwards wrote: >The following reply was made to PR kern/66248; it has been noted by GNATS. > >From: Peter Edwards >To: freebsd-gnats-submit@FreeBSD.org, bremner@unb.ca >Cc: julian@elischer.org, imp@bsdimp.org >Subject: Re: kern/66248: [panic] bootloader is confused by booting from USB > flash, trashes main drives boot block >Date: Wed, 05 Jan 2005 20:53:02 +0000 > > This is a multi-part message in MIME format. > --------------070200040205060401080901 > Content-Type: text/plain; charset=us-ascii; format=flowed > Content-Transfer-Encoding: 7bit > > The following patch, applied before the one above, shrinks boot0 enough > to squeeze the previous patch in without undeffing the BEL stuff. > > FWIW: The patch to fix the bug looks good to me. > I someone gives a go-ahead, I'll commit a combined patch: I certainly > don't want to make a commit to boot0 and have half the FreeBSD community > left without a bootable machine, unless I can pass the book :-) > you can pass the book here, but I don't need that buck.. > > > --------------070200040205060401080901 > Content-Type: text/plain; > name="boot0.smaller.patch" > Content-Transfer-Encoding: 7bit > Content-Disposition: inline; > filename="boot0.smaller.patch" > > Index: boot0.S > =================================================================== > RCS file: /usr/cvs/FreeBSD-CVS/src/sys/boot/i386/boot0/boot0.S,v > retrieving revision 1.12 > diff -u -w -r1.12 boot0.S > --- boot0.S 24 Nov 2004 15:39:04 -0000 1.12 > +++ boot0.S 5 Jan 2005 20:44:32 -0000 > @@ -29,7 +29,7 @@ > .set PRT_OFF,0x1be # Partition table > > .set TBL0SZ,0x3 # Table 0 size > - .set TBL1SZ,0xb # Table 1 size > + .set TBL1SZ,0xc # Table 1 size > > .set MAGIC,0xaa55 # Magic: bootable > .set B0MAGIC,0xbb66 # Identification > @@ -148,13 +148,8 @@ > movb $TBL1SZ,%cl # Number of entries > repne # Known > scasb # type? > - jne main.4 # No > -/* > - * If it matches get the matching element in the next array. If it doesn't, > - * we are already pointing at its first element which points to a "?". > - */ > - addw $TBL1SZ,%di # Adjust > -main.4: movb (%di),%cl # Partition > + addw $TBL1SZ - 1, %di # Adjust > + movb (%di),%cl # Partition > addw %cx,%di # description > callw putx # Display it > main.5: incw %dx # Next item > @@ -314,8 +309,7 @@ > cmpw $MAGIC,0x1fe(%bx) # Bootable? > jne main.10 # No > pushw %si # Save > - movw $crlf,%si # Leave some > - callw puts # space > + callw putn # Leave some space > popw %si # Restore > jmp *%bx # Invoke bootstrap > > @@ -408,14 +402,14 @@ > .byte 0x0, 0x5, 0xf > /* > * These values indicate bootable types we know the names of. > + * The value of the last entry is unimportant: it indicates "everything else" > */ > .byte 0x1, 0x4, 0x6, 0xb, 0xc, 0xe, 0x83 > - .byte 0x9f, 0xa5, 0xa6, 0xa9 > + .byte 0x9f, 0xa5, 0xa6, 0xa9, 0xff > /* > * These are offsets that match the known names above and point to the strings > * that will be printed. > */ > - .byte os_misc-. # Unknown > .byte os_dos-. # DOS > .byte os_dos-. # DOS > .byte os_dos-. # DOS > @@ -427,6 +421,7 @@ > .byte os_freebsd-. # FreeBSD > .byte os_bsd-. # OpenBSD > .byte os_bsd-. # NetBSD > + .byte os_misc-. # Unknown > /* > * And here are the strings themselves. 0x80 or'd into a byte indicates > * the end of the string. (not so great for Russians but...) > > --------------070200040205060401080901-- >_______________________________________________ >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" > >