Date: Mon, 1 Mar 2004 20:15:46 -0800 (PST) From: Alan Robson <kimandalan@covad.net> To: freebsd-gnats-submit@FreeBSD.org Subject: i386/63628: patch to i.386 master boot record to allow boot from USB Flash drive Message-ID: <200403020415.i224FkCW046552@www.freebsd.org> Resent-Message-ID: <200403020420.i224KCLx025470@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 63628
>Category: i386
>Synopsis: patch to i.386 master boot record to allow boot from USB Flash drive
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-i386
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Mon Mar 01 20:20:12 PST 2004
>Closed-Date:
>Last-Modified:
>Originator: Alan Robson
>Release: 5.2 Release
>Organization:
>Environment:
FreeBSD planb.local 5.2-RELEASE FreeBSD 5.2-RELEASE #0: Sun Jan 11 04:21:45 GMT 2004 root@wv1u.btc.adaptec.com:/usr/obj/usr/src/sys/GENERIC i386
>Description:
For some reason, the BIOS will not load a partition boot record from a flash USB "thumb" drive using the Cylinder, Head & Sector values in the MBR in an int13/02 BIOS call. Instead and LBA call should be used
>How-To-Repeat:
install the minimal FreeBSD installation to a USB Memory stick from the distribution CD and try to boot from it. The boot always fails, even when the bios supports booting from a USB device.
>Fix:
Modify the mbr.s file to try LBA as the first resort, then fall back to CHS if that fails. My system works with the following diff -u patch to mbr.s, I have no way to test it on other equipment.
--- mbr.s.origional Sun Feb 29 20:58:05 2004
+++ mbr.s Sun Feb 29 21:20:40 2004
@@ -89,9 +89,7 @@
movw 0x2(%si),%cx # Load cylinder:sector
movw $LOAD,%bx # Transfer buffer
cmpb $0xff,%dh # Might we need to use LBA?
- jnz main.7 # No.
cmpw $0xffff,%cx # Do we need to use LBA?
- jnz main.7 # No.
pushw %cx # Save %cx
pushw %bx # Save %bx
movw $0x55aa,%bx # Magic
>Release-Note:
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403020415.i224FkCW046552>
