All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: grub-devel@gnu.org
Subject: [PATCH] Ensure boot CD can be accessed
Date: Sun, 10 Feb 2008 13:23:25 +0100	[thread overview]
Message-ID: <47AEECBD.4070906@t-online.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 741 bytes --]

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  <franke@computer.org>

	* disk/i386/pc/biosdisk.c: Include <grub/machine/kernel.h>.
	(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.



[-- Attachment #2: grub2-biosdisk-bootcd.patch --]
[-- Type: text/x-patch, Size: 1911 bytes --]

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 <grub/machine/biosdisk.h>
 #include <grub/machine/memory.h>
+#include <grub/machine/kernel.h>
 #include <grub/disk.h>
 #include <grub/dl.h>
 #include <grub/mm.h>
@@ -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;

             reply	other threads:[~2008-02-10 12:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-10 12:23 Christian Franke [this message]
2008-02-10 12:37 ` [PATCH] Ensure boot CD can be accessed Bean
2008-02-10 12:47   ` Christian Franke
2008-02-10 12:56     ` Bean
2008-02-10 14:42       ` Christian Franke
2008-02-15 21:13         ` Christian Franke
2008-03-02  8:42           ` Bean
2008-03-03 20:46             ` Christian Franke
2008-03-05  7:05               ` Bean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47AEECBD.4070906@t-online.de \
    --to=christian.franke@t-online.de \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.