From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JOBDk-0008RS-4z for mharc-grub-devel@gnu.org; Sun, 10 Feb 2008 07:23:44 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JOBDg-0008Ph-TR for grub-devel@gnu.org; Sun, 10 Feb 2008 07:23:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JOBDf-0008Ny-MU for grub-devel@gnu.org; Sun, 10 Feb 2008 07:23:40 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOBDf-0008Nc-Ha for grub-devel@gnu.org; Sun, 10 Feb 2008 07:23:39 -0500 Received: from mailout03.sul.t-online.de ([194.25.134.81] helo=mailout03.sul.t-online.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JOBDf-00050O-0k for grub-devel@gnu.org; Sun, 10 Feb 2008 07:23:39 -0500 Received: from fwd31.aul.t-online.de by mailout03.sul.t-online.com with smtp id 1JOBDd-0003EZ-02; Sun, 10 Feb 2008 13:23:37 +0100 Received: from [10.3.2.2] (r9pwNEZCwhQpBZVgD-uiGHGWdftjXK-q4kfjweI-84DRGf7gHQmIVZ4AAtfXLEiQ74@[217.235.199.83]) by fwd31.aul.t-online.de with esmtp id 1JOBDT-1OWM5I0; Sun, 10 Feb 2008 13:23:27 +0100 Message-ID: <47AEECBD.4070906@t-online.de> Date: Sun, 10 Feb 2008 13:23:25 +0100 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071128 SeaMonkey/1.1.7 MIME-Version: 1.0 To: grub-devel@gnu.org Content-Type: multipart/mixed; boundary="------------050207030808040601020309" X-ID: r9pwNEZCwhQpBZVgD-uiGHGWdftjXK-q4kfjweI-84DRGf7gHQmIVZ4AAtfXLEiQ74 X-TOI-MSGID: 94328406-f511-4899-9564-6cadeb98644d X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: [PATCH] Ensure boot CD can be accessed X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Feb 2008 12:23:41 -0000 This is a multi-part message in MIME format. --------------050207030808040601020309 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Detecting BIOS CD device by INT13 "Check Extensions" (AH=42) call does not work for all BIOSes. This patch fixes this to allow access to the boot CD. See also thread "[PATCH] Create floppy emulation boot CD with grub-mkimage". The "(cd0" patch from Bean is not included here but should also be applied. Christian 2008-02-10 Christian Franke * disk/i386/pc/biosdisk.c: Include . (GRUB_MOD_INIT): Make boot CD accessible even if BIOS does not report INT13 Extensions for grub_boot_drive. * include/grub/i386/pc/biosdisk.h (GRUB_BIOSDISK_MACHINE_CDROM_START): Change from 0xe0 to 0x9f to cover more BIOS variants. * include/grub/i386/pc/kernel.h (grub_boot_drive): Add EXPORT_VAR. --------------050207030808040601020309 Content-Type: text/x-patch; name="grub2-biosdisk-bootcd.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="grub2-biosdisk-bootcd.patch" diff -rup --exclude CVS grub2.orig/disk/i386/pc/biosdisk.c grub2/disk/i386/pc/biosdisk.c --- grub2.orig/disk/i386/pc/biosdisk.c 2008-02-03 20:29:51.500000000 +0100 +++ grub2/disk/i386/pc/biosdisk.c 2008-02-10 12:26:25.843750000 +0100 @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -391,6 +392,16 @@ GRUB_MOD_INIT(biosdisk) } } + /* Some BIOSes do not report INT13 Extensions for the + boot CD. Ensure that the boot CD can be accessed. */ + if (! found + && GRUB_BIOSDISK_MACHINE_CDROM_START <= grub_boot_drive + && grub_boot_drive < GRUB_BIOSDISK_MACHINE_CDROM_END) + { + cd_start = grub_boot_drive; + found = 1; + } + cd_count = found; } diff -rup --exclude CVS grub2.orig/include/grub/i386/pc/biosdisk.h grub2/include/grub/i386/pc/biosdisk.h --- grub2.orig/include/grub/i386/pc/biosdisk.h 2008-02-03 20:29:52.187500000 +0100 +++ grub2/include/grub/i386/pc/biosdisk.h 2008-02-09 15:55:04.713289500 +0100 @@ -25,7 +25,7 @@ #define GRUB_BIOSDISK_FLAG_LBA 1 #define GRUB_BIOSDISK_FLAG_CDROM 2 -#define GRUB_BIOSDISK_MACHINE_CDROM_START 0xe0 +#define GRUB_BIOSDISK_MACHINE_CDROM_START 0x9f #define GRUB_BIOSDISK_MACHINE_CDROM_END 0xf0 struct grub_biosdisk_data diff -rup --exclude CVS grub2.orig/include/grub/i386/pc/kernel.h grub2/include/grub/i386/pc/kernel.h --- grub2.orig/include/grub/i386/pc/kernel.h 2008-02-03 20:29:52.375000000 +0100 +++ grub2/include/grub/i386/pc/kernel.h 2008-02-10 00:16:43.812500000 +0100 @@ -71,7 +71,7 @@ extern grub_int32_t grub_memdisk_image_s extern char grub_prefix[]; /* The boot BIOS drive number. */ -extern grub_int32_t grub_boot_drive; +extern grub_int32_t EXPORT_VAR(grub_boot_drive); /* The root BIOS drive number. */ extern grub_int32_t grub_root_drive; --------------050207030808040601020309--