2008-03-24 Bean <bean123ch@gmail.com>

* disk/i386/pc/biosdisk.c (cd_start): Removed.
	(cd_count): Removed.
	(cd_drive): New variable.
	(grub_biosdisk_get_drive): Don't check for (cdN) device.
	(grub_biosdisk_call_hook): Likewise.
	(grub_biosdisk_iterate): Change cdrom detection method.
	(grub_biosdisk_open): Replace cd_start with cd_drive.
	(GRUB_MOD_INIT): Use grub_biosdisk_get_cdinfo_int13_extension to
	detect cdrom device.

	* include/grub/i386/pc/biosdisk.h (GRUB_BIOSDISK_MACHINE_CDROM_START):
	Removed.
	(GRUB_BIOSDISK_MACHINE_CDROM_END): Removed.
	(GRUB_BIOSDISK_CDTYPE_NO_EMUL): New macro.
	(GRUB_BIOSDISK_CDTYPE_1_2_M): Likewise.
	(GRUB_BIOSDISK_CDTYPE_1_44_M): Likewise.
	(GRUB_BIOSDISK_CDTYPE_2_88_M): Likewise.
	(GRUB_BIOSDISK_CDTYPE_HARDDISK): Likewise.
	(GRUB_BIOSDISK_CDTYPE_MASK): Likewise.
	(grub_biosdisk_cdrp): New structure.
	(grub_biosdisk_get_cdinfo_int13_extensions): New function.

	* include/grub/i386/pc/kernel.h (grub_boot_drive): Export this variable.

	* kern/i386/pc/init.c (make_install_device): Don't use (cdN) as root
	device.

	* kern/i386/pc/startup.S (grub_biosdisk_get_cdinfo_int13_extensions):
	New function.
This commit is contained in:
bean 2008-03-24 04:13:37 +00:00
parent 68e7fc7aa8
commit bf962df2da
6 changed files with 95 additions and 44 deletions

View file

@ -25,8 +25,13 @@
#define GRUB_BIOSDISK_FLAG_LBA 1
#define GRUB_BIOSDISK_FLAG_CDROM 2
#define GRUB_BIOSDISK_MACHINE_CDROM_START 0xe0
#define GRUB_BIOSDISK_MACHINE_CDROM_END 0xf0
#define GRUB_BIOSDISK_CDTYPE_NO_EMUL 0
#define GRUB_BIOSDISK_CDTYPE_1_2_M 1
#define GRUB_BIOSDISK_CDTYPE_1_44_M 2
#define GRUB_BIOSDISK_CDTYPE_2_88_M 3
#define GRUB_BIOSDISK_CDTYPE_HARDDISK 4
#define GRUB_BIOSDISK_CDTYPE_MASK 0xF
struct grub_biosdisk_data
{
@ -74,6 +79,23 @@ struct grub_biosdisk_drp
grub_uint8_t dummy[16];
} __attribute__ ((packed));
struct grub_biosdisk_cdrp
{
grub_uint8_t size;
grub_uint8_t media_type;
grub_uint8_t drive_no;
grub_uint8_t controller_no;
grub_uint32_t image_lba;
grub_uint16_t device_spec;
grub_uint16_t cache_seg;
grub_uint16_t load_seg;
grub_uint16_t length_sec512;
grub_uint8_t cylinders;
grub_uint8_t sectors;
grub_uint8_t heads;
grub_uint8_t dummy[16];
} __attribute__ ((packed));
/* Disk Address Packet. */
struct grub_biosdisk_dap
{
@ -90,6 +112,8 @@ int EXPORT_FUNC(grub_biosdisk_rw_standard) (int ah, int drive, int coff, int hof
int EXPORT_FUNC(grub_biosdisk_check_int13_extensions) (int drive);
int EXPORT_FUNC(grub_biosdisk_get_diskinfo_int13_extensions) (int drive,
void *drp);
int EXPORT_FUNC(grub_biosdisk_get_cdinfo_int13_extensions) (int drive,
void *cdrp);
int EXPORT_FUNC(grub_biosdisk_get_diskinfo_standard) (int drive,
unsigned long *cylinders,
unsigned long *heads,

View file

@ -71,7 +71,7 @@ extern grub_int32_t grub_memdisk_image_size;
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;