[syslinux:master] diskio: hard-code CD-ROM sectors to 2048 bytes

syslinux-bot for H. Peter Anvin hpa at linux.intel.com
Mon Jun 28 14:39:17 PDT 2010


Commit-ID:  c126c28095caf13d164b21f4c7cb25a44af859b0
Gitweb:     http://syslinux.zytor.com/commit/c126c28095caf13d164b21f4c7cb25a44af859b0
Author:     H. Peter Anvin <hpa at linux.intel.com>
AuthorDate: Mon, 28 Jun 2010 14:34:08 -0700
Committer:  H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Mon, 28 Jun 2010 14:34:08 -0700

diskio: hard-code CD-ROM sectors to 2048 bytes

At least the ThinkPad T22 and T23 will incorrectly report a sector
size of 512 bytes for El Torito CD-ROMs.  Ignore the reported sector
size for El Torito boots.

Reported-by: Helmut Hullen <hullen at t-online.de>
Tested-by: Peter Zijlstra <peterz at infradead.org>
Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>


---
 core/fs/diskio.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/core/fs/diskio.c b/core/fs/diskio.c
index b832868..1625bdb 100644
--- a/core/fs/diskio.c
+++ b/core/fs/diskio.c
@@ -278,7 +278,18 @@ struct disk *disk_init(uint8_t devno, bool cdrom, sector_t part_start,
 	    if (edd_params.len < sizeof edd_params)
 		memset((char *)&edd_params + edd_params.len, 0,
 		       sizeof edd_params - edd_params.len);
-	    if (edd_params.sector_size >= 512 &&
+
+	    /*
+	     * Note: filter impossible sector sizes.  Some BIOSes
+	     * are known to report incorrect sector size information
+	     * (usually 512 rather than 2048) for CD-ROMs, so at least
+	     * for now ignore the reported sector size if booted via
+	     * El Torito.
+	     *
+	     * Known affected systems: ThinkPad T22, T23.
+	     */
+	    if (!cdrom &&
+		edd_params.sector_size >= 512 &&
 		is_power_of_2(edd_params.sector_size))
 		sector_size = edd_params.sector_size;
 	}



More information about the Syslinux-commits mailing list