Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Sep 2009 23:52:47 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r197608 - head/sys/geom/part
Message-ID:  <200909282352.n8SNql1n069970@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Mon Sep 28 23:52:47 2009
New Revision: 197608
URL: http://svn.freebsd.org/changeset/base/197608

Log:
  The first 96 bytes may not be zeroes. It can contain trivial boot
  code that merely emits an error and waits for a key press before
  rebooting. The error being that extended partitions are not
  bootable. The origin is presumed to be Windows 2000; Windows XP
  does not do this...
  
  For now, ignore the first 96 bytes when checking that the EBR is
  (for the most part) all zeroes.
  
  Tested by:	Mario Lobo <mlobo@digiart.art.br>
  MFC after:	1 week

Modified:
  head/sys/geom/part/g_part_ebr.c

Modified: head/sys/geom/part/g_part_ebr.c
==============================================================================
--- head/sys/geom/part/g_part_ebr.c	Mon Sep 28 23:48:16 2009	(r197607)
+++ head/sys/geom/part/g_part_ebr.c	Mon Sep 28 23:52:47 2009	(r197608)
@@ -410,13 +410,13 @@ g_part_ebr_probe(struct g_part_table *ta
 		goto out;
 
 	/*
-	 * The sector is all zeroes, except for the partition entries
-	 * and some signatures or disk serial number. Those can be
-	 * found in the 9 bytes immediately in front of the partition
-	 * table.
+	 * The sector is all zeroes, except for the partition entries,
+	 * pseudo boot code and some signatures or disk serial number.
+	 * The latter can be found in the 9 bytes immediately in front
+	 * of the partition table.
 	 */
 	sum = 0;
-	for (index = 0; index < DOSPARTOFF - 9; index++)
+	for (index = 96; index < DOSPARTOFF - 9; index++)
 		sum += buf[index];
 	if (sum != 0)
 		goto out;



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