[syslinux] [PATCH] memdisk: MBR not recognized correctly

bstroesser at ts.fujitsu.com bstroesser at ts.fujitsu.com
Tue Mar 23 09:56:29 PDT 2010


From: Bodo Stroesser <bstroesser at ts.fujitsu.com>

This fixes a small inaccuracy in memdisk:

get_disk_image_geometry() does not use MBR data to detect disk
geometry, since it checks MBR signature at wrong offset.

This normally does not cause problems, because memdisk guesses a
reasonable value, if no MBR is found.

Signed-off-by: Bodo Stroesser <bstroesser at ts.fujitsu.com>
---

--- syslinux-3.85/memdisk/setup.c.orig	2010-02-17 05:12:57.000000000 +0100
+++ syslinux-3.85/memdisk/setup.c	2010-03-23 16:23:35.000000000 +0100
@@ -648,7 +648,7 @@ static const struct geometry *get_disk_i
 		if (!hd_geometry.driveno)
 		    hd_geometry.driveno = 0x80;
 
-		if (*(uint16_t *) ((char *)where + 512 - 2) == 0xaa55) {
+		if (*(uint16_t *) ((char *)where + hd_geometry.offset + 512 - 2) == 0xaa55) {
 		    for (i = 0; i < 4; i++) {
 			if (ptab[i].type && !(ptab[i].active & 0x7f)) {
 			    s = (ptab[i].start_s & 0x3f);


More information about the Syslinux mailing list