Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jan 2020 21:21:08 +0000 (UTC)
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r356570 - head/stand/i386/libi386
Message-ID:  <202001092121.009LL8WQ090264@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tsoome
Date: Thu Jan  9 21:21:08 2020
New Revision: 356570
URL: https://svnweb.freebsd.org/changeset/base/356570

Log:
  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:
  head/stand/i386/libi386/biosdisk.c

Modified: head/stand/i386/libi386/biosdisk.c
==============================================================================
--- head/stand/i386/libi386/biosdisk.c	Thu Jan  9 20:49:26 2020	(r356569)
+++ head/stand/i386/libi386/biosdisk.c	Thu Jan  9 21:21:08 2020	(r356570)
@@ -396,7 +396,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
@@ -564,7 +565,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



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