Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Aug 2007 22:24:41 GMT
From:      Kent Hauser <kent@khauser.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/115406: GPT MBR hangs award BIOS on boot
Message-ID:  <200708102224.l7AMOffq009707@www.freebsd.org>
Resent-Message-ID: <200708102230.l7AMU1Gs046230@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         115406
>Category:       misc
>Synopsis:       GPT MBR hangs award BIOS on boot
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 10 22:30:01 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Kent Hauser
>Release:        6.2-STABLE
>Organization:
>Environment:
FreeBSD hnl.tfd.com 6.2-STABLE FreeBSD 6.2-STABLE #1: Sat Aug  4 22:50:46 HST 2007     kent@hnl.tfd.com:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
When a disk is configured for GPT, a machine with AWARD BIOS hangs in boot. Disk must be detached before BIOS will respond. Can not boot from CD with disk attached. Machine locked up good.

The solution is to patch the "compatiblity" MBR generated by GPT. Since the MBR is only a indicator to non-gpt aware systems that the disk is in use, it probably makes sense to generate an MBR entry which is "standard" in every way except filesystem type.

Note: my award bios hangs if if the "head" field in the MBR is set to 255. Obviously a bug in BIOS, but also head=255 is never used in MBR applications.

The following patch set start & end cyl/head/sector to more standard values:


>How-To-Repeat:
On a system with AWARD BIOS (eg eMACHINES T3410)

dd if=/dev/zero of=/dev/ad1 copy=100
gpt create -f /dev/ad1
reboot

to recover system:
remove disk drive power
boot system, pausing boot loader
reattach disk drive power
continue boot
fdisk -I /dev/ad1
(and hope you don't fry the drive).


>Fix:
Index: create.c
===================================================================
RCS file: /home/ncvs/src/sbin/gpt/create.c,v
retrieving revision 1.10.2.1
diff -u -r1.10.2.1 create.c
--- create.c    6 Sep 2005 23:59:01 -0000       1.10.2.1
+++ create.c    10 Aug 2007 22:08:14 -0000
@@ -93,11 +93,11 @@
                mbr = gpt_read(fd, 0LL, 1);
                bzero(mbr, sizeof(*mbr));
                mbr->mbr_sig = htole16(MBR_SIG);
-               mbr->mbr_part[0].part_shd = 0xff;
-               mbr->mbr_part[0].part_ssect = 0xff;
-               mbr->mbr_part[0].part_scyl = 0xff;
+               mbr->mbr_part[0].part_shd = 1;
+               mbr->mbr_part[0].part_ssect = 1;
+               mbr->mbr_part[0].part_scyl = 0;
                mbr->mbr_part[0].part_typ = 0xee;
-               mbr->mbr_part[0].part_ehd = 0xff;
+               mbr->mbr_part[0].part_ehd = 0xfe;
                mbr->mbr_part[0].part_esect = 0xff;
                mbr->mbr_part[0].part_ecyl = 0xff;
                mbr->mbr_part[0].part_start_lo = htole16(1);


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708102224.l7AMOffq009707>