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:
parent
68e7fc7aa8
commit
bf962df2da
6 changed files with 95 additions and 44 deletions
|
@ -22,7 +22,6 @@
|
|||
#include <grub/machine/memory.h>
|
||||
#include <grub/machine/console.h>
|
||||
#include <grub/machine/kernel.h>
|
||||
#include <grub/machine/biosdisk.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/dl.h>
|
||||
|
@ -77,13 +76,8 @@ 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);
|
||||
else
|
||||
grub_sprintf (dev, "(%cd%u",
|
||||
(grub_root_drive & 0x80) ? 'h' : 'f',
|
||||
grub_root_drive & 0x7f);
|
||||
grub_sprintf (dev, "(%cd%u", (grub_root_drive & 0x80) ? 'h' : 'f',
|
||||
grub_root_drive & 0x7f);
|
||||
|
||||
if (grub_install_dos_part >= 0)
|
||||
grub_sprintf (dev + grub_strlen (dev), ",%u", grub_install_dos_part + 1);
|
||||
|
|
|
@ -779,6 +779,17 @@ FUNCTION(grub_biosdisk_check_int13_extensions)
|
|||
ret
|
||||
|
||||
|
||||
/*
|
||||
* int grub_biosdisk_get_cdinfo_int13_extensions (int drive, void *cdrp)
|
||||
*
|
||||
* Return the cdrom information of DRIVE in CDRP. If an error occurs,
|
||||
* then return non-zero, otherwise zero.
|
||||
*/
|
||||
|
||||
FUNCTION(grub_biosdisk_get_cdinfo_int13_extensions)
|
||||
movw $0x4B01, %cx
|
||||
jmp 1f
|
||||
|
||||
/*
|
||||
* int grub_biosdisk_get_diskinfo_int13_extensions (int drive, void *drp)
|
||||
*
|
||||
|
@ -787,6 +798,8 @@ FUNCTION(grub_biosdisk_check_int13_extensions)
|
|||
*/
|
||||
|
||||
FUNCTION(grub_biosdisk_get_diskinfo_int13_extensions)
|
||||
movb $0x48, %ch
|
||||
1:
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
|
@ -802,7 +815,7 @@ FUNCTION(grub_biosdisk_get_diskinfo_int13_extensions)
|
|||
call prot_to_real
|
||||
|
||||
.code16
|
||||
movb $0x48, %ah
|
||||
movw %cx, %ax
|
||||
movw %bx, %ds
|
||||
int $0x13 /* do the operation */
|
||||
movb %ah, %bl /* save return value in %bl */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue