From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JODO6-0003Pc-KB for mharc-grub-devel@gnu.org; Sun, 10 Feb 2008 09:42:34 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JODO4-0003OU-JZ for grub-devel@gnu.org; Sun, 10 Feb 2008 09:42:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JODO1-0003Ni-MY for grub-devel@gnu.org; Sun, 10 Feb 2008 09:42:31 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JODO1-0003Nf-HY for grub-devel@gnu.org; Sun, 10 Feb 2008 09:42:29 -0500 Received: from mailout05.sul.t-online.de ([194.25.134.82] helo=mailout05.sul.t-online.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JODO1-0005iz-5M for grub-devel@gnu.org; Sun, 10 Feb 2008 09:42:29 -0500 Received: from fwd26.aul.t-online.de by mailout05.sul.t-online.com with smtp id 1JODO0-0001bu-02; Sun, 10 Feb 2008 15:42:28 +0100 Received: from [10.3.2.2] (JlvLSEZJ8hb2b7PH17rfEF5PbGD8xBzNbbTnot7lGSyeZFUKzyoWBiPE6JgCfWbg-g@[217.235.224.97]) by fwd26.aul.t-online.de with esmtp id 1JODNt-18UIHg0; Sun, 10 Feb 2008 15:42:21 +0100 Message-ID: <47AF0D4E.5040001@t-online.de> Date: Sun, 10 Feb 2008 15:42:22 +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: The development of GRUB 2 References: <47AEECBD.4070906@t-online.de> <47AEF27B.2090403@t-online.de> In-Reply-To: Content-Type: multipart/mixed; boundary="------------080803090807090600030201" X-ID: JlvLSEZJ8hb2b7PH17rfEF5PbGD8xBzNbbTnot7lGSyeZFUKzyoWBiPE6JgCfWbg-g X-TOI-MSGID: a2d9d58d-777b-46f6-ad20-80b8ad854594 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: [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 14:42:32 -0000 This is a multi-part message in MIME format. --------------080803090807090600030201 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Bean wrote: > On Feb 10, 2008 8:47 PM, Christian Franke <...> wrote: > >> Bean wrote: >> >>> On Feb 10, 2008 8:23 PM, Christian Franke <...> wrote: >>> >>> >>>> ... >>>> >>> i think we can assume grub_boot_drive as (cd0) if it's within range, >>> and start scanning from grub_boot_drive + 1. >>> >>> >>> >> Yes, I will provide a new patch. Should it include your init.c patch? >> > > you can include it so that the changes can be committed at the same time. > > New patch below. 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. Start CD scanning from grub_boot_drive + 1. * 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. * kern/i386/pc/init.c (make_install_device): Always set boot CD device name to "(cd0)". Patch was provided by Bean. --------------080803090807090600030201 Content-Type: text/x-patch; name="grub2-biosdisk-bootcd-2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="grub2-biosdisk-bootcd-2.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 15:16:19.343750000 +0100 @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -364,7 +365,8 @@ grub_disk_biosdisk_fini (void) GRUB_MOD_INIT(biosdisk) { - int drive, found = 0; + int drive = GRUB_BIOSDISK_MACHINE_CDROM_START; + int found = 0; if (grub_disk_firmware_is_tainted) { @@ -375,8 +377,17 @@ GRUB_MOD_INIT(biosdisk) grub_disk_dev_register (&grub_biosdisk_dev); - for (drive = GRUB_BIOSDISK_MACHINE_CDROM_START; - drive < GRUB_BIOSDISK_MACHINE_CDROM_END; drive++) + /* Some BIOSes do not report INT13 Extensions for the + boot CD. Ensure that the boot CD can be accessed. */ + if (GRUB_BIOSDISK_MACHINE_CDROM_START <= grub_boot_drive + && grub_boot_drive < GRUB_BIOSDISK_MACHINE_CDROM_END) + { + cd_start = grub_boot_drive; + drive = grub_boot_drive + 1; + found = 1; + } + + for ( ; drive < GRUB_BIOSDISK_MACHINE_CDROM_END; drive++) { if (grub_biosdisk_check_int13_extensions (drive)) { 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; diff -rup --exclude CVS grub2.orig/kern/i386/pc/init.c grub2/kern/i386/pc/init.c --- grub2.orig/kern/i386/pc/init.c 2008-02-03 20:29:53.125000000 +0100 +++ grub2/kern/i386/pc/init.c 2008-02-10 15:05:40.140625000 +0100 @@ -77,9 +77,9 @@ make_install_device (void) if (grub_root_drive == 0xFF) grub_root_drive = grub_boot_drive; - if (grub_root_drive >= GRUB_BIOSDISK_MACHINE_CDROM_START) - grub_sprintf (dev, "(cd%u", - grub_root_drive - GRUB_BIOSDISK_MACHINE_CDROM_START); + if ((grub_root_drive >= GRUB_BIOSDISK_MACHINE_CDROM_START) && + (grub_root_drive < GRUB_BIOSDISK_MACHINE_CDROM_END)) + grub_strcpy (dev, "(cd0"); else grub_sprintf (dev, "(%cd%u", (grub_root_drive & 0x80) ? 'h' : 'f', --------------080803090807090600030201--