From owner-freebsd-i386@FreeBSD.ORG Mon Mar 1 20:20:13 2004 Return-Path: Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ED29016A4CE for ; Mon, 1 Mar 2004 20:20:12 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CE25643D49 for ; Mon, 1 Mar 2004 20:20:12 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i224KCbv025471 for ; Mon, 1 Mar 2004 20:20:12 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i224KCLx025470; Mon, 1 Mar 2004 20:20:12 -0800 (PST) (envelope-from gnats) Resent-Date: Mon, 1 Mar 2004 20:20:12 -0800 (PST) Resent-Message-Id: <200403020420.i224KCLx025470@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alan Robson Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 413BD16A4CE for ; Mon, 1 Mar 2004 20:15:46 -0800 (PST) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B30B43D2D for ; Mon, 1 Mar 2004 20:15:46 -0800 (PST) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.10/8.12.10) with ESMTP id i224Fk72046553 for ; Mon, 1 Mar 2004 20:15:46 -0800 (PST) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.10/8.12.10/Submit) id i224FkCW046552; Mon, 1 Mar 2004 20:15:46 -0800 (PST) (envelope-from nobody) Message-Id: <200403020415.i224FkCW046552@www.freebsd.org> Date: Mon, 1 Mar 2004 20:15:46 -0800 (PST) From: Alan Robson To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: i386/63628: patch to i.386 master boot record to allow boot from USB Flash drive X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2004 04:20:13 -0000 >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: