svn commit: r356572 - stable/11/stand/i386/libi386
Toomas Soome
tsoome at FreeBSD.org
Thu Jan 9 21:41:00 UTC 2020
Author: tsoome
Date: Thu Jan 9 21:40:59 2020
New Revision: 356572
URL: https://svnweb.freebsd.org/changeset/base/356572
Log:
MFC r356570:
loader: bioscd probe can get sector size 0
With buggy BIOS, it may happen we get sector size reported 0 for cd, and then
the default 512 is used, which is quite wrong.
PR: 238749
Modified:
stable/11/stand/i386/libi386/biosdisk.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/stand/i386/libi386/biosdisk.c
==============================================================================
--- stable/11/stand/i386/libi386/biosdisk.c Thu Jan 9 21:37:50 2020 (r356571)
+++ stable/11/stand/i386/libi386/biosdisk.c Thu Jan 9 21:40:59 2020 (r356572)
@@ -380,7 +380,8 @@ bc_add(int biosdev)
return (-1);
bd->bd_flags = BD_CDROM;
- bd->bd_unit = biosdev;
+ bd->bd_unit = biosdev;
+ bd->bd_sectorsize = 2048;
/*
* Ignore result from bd_int13probe(), we will use local
@@ -548,7 +549,8 @@ bd_int13probe(bdinfo_t *bd)
bd->bd_flags |= BD_MODEEDD3;
/* Default sector size */
- bd->bd_sectorsize = BIOSDISK_SECSIZE;
+ if (bd->bd_sectorsize == 0)
+ bd->bd_sectorsize = BIOSDISK_SECSIZE;
/*
* Test if the floppy device is present, so we can avoid receiving
More information about the svn-src-stable
mailing list