Defer multiboot device parsing until we're in compressed part.
* grub-core/boot/i386/pc/lnxboot.S: Remove setting dos_part and bsd_part. setdevice has fallen into disuse. * grub-core/boot/i386/pc/startup_raw.S (dos_part): Removed. (bsd_part): Likewise. (boot_dev): New variable. (multiboot_trampoline): Don't parse multiboot device. Pass multiboot device in %edx. * grub-core/disk/i386/pc/biosdisk.c (GRUB_MOD_INIT): Parse grub_boot_device. * grub-core/kern/i386/pc/init.c (grub_machine_get_bootlocation): Likewise. * grub-core/kern/i386/pc/startup.S: Save edx. (grub_boot_drive): Removed. (grub_install_dos_part): Likewise. (grub_install_bsd_part): Likewise. (grub_boot_device): New variable. * include/grub/i386/pc/kernel.h (grub_install_dos_part): Removed. (grub_install_bsd_part): Likewise. (grub_boot_drive): Likewise. (grub_boot_device): New variable. * include/grub/offsets.h (GRUB_KERNEL_I386_PC_INSTALL_DOS_PART): Removed. (GRUB_KERNEL_I386_PC_INSTALL_BSD_PART): Likewise. (GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY): Moved lower. (GRUB_KERNEL_MACHINE_INSTALL_BSD_PART): Removed. (GRUB_KERNEL_MACHINE_INSTALL_DOS_PART): Likewise. * util/grub-install.in: Remove redundant condition.
This commit is contained in:
parent
691cbb5816
commit
5fbdac149b
11 changed files with 63 additions and 171 deletions
|
@ -205,11 +205,6 @@ real_code_2:
|
|||
2:
|
||||
call LOCAL(move_memory)
|
||||
|
||||
movsbl %dh, %eax
|
||||
movl %eax, %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_INSTALL_DOS_PART)
|
||||
movsbl (reg_edx + 2 - start), %eax
|
||||
movl %eax, %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_INSTALL_BSD_PART)
|
||||
|
||||
movb $0xFF, %dh
|
||||
|
||||
ljmp $(DATA_ADDR >> 4), $0
|
||||
|
|
|
@ -57,13 +57,6 @@ LOCAL(compressed_size):
|
|||
LOCAL(uncompressed_size):
|
||||
.long 0
|
||||
|
||||
. = _start + GRUB_KERNEL_I386_PC_INSTALL_DOS_PART
|
||||
LOCAL(dos_part):
|
||||
.long 0xFFFFFFFF
|
||||
. = _start + GRUB_KERNEL_I386_PC_INSTALL_BSD_PART
|
||||
LOCAL(bsd_part):
|
||||
.long 0xFFFFFFFF
|
||||
|
||||
. = _start + GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY
|
||||
reed_solomon_redundancy:
|
||||
.long 0
|
||||
|
@ -72,8 +65,10 @@ reed_solomon_redundancy:
|
|||
* This is the area for all of the special variables.
|
||||
*/
|
||||
|
||||
LOCAL(boot_dev):
|
||||
.byte 0xFF, 0xFF, 0xFF
|
||||
LOCAL(boot_drive):
|
||||
.byte 0
|
||||
.byte 0x00
|
||||
|
||||
/* the real mode code continues... */
|
||||
LOCAL (codestart):
|
||||
|
@ -164,28 +159,12 @@ multiboot_entry:
|
|||
|
||||
multiboot_trampoline:
|
||||
/* fill the boot information */
|
||||
movl %edx, %eax
|
||||
shrl $8, %eax
|
||||
xorl %ebx, %ebx
|
||||
cmpb $0xFF, %ah
|
||||
je 1f
|
||||
movb %ah, %bl
|
||||
movl %ebx, LOCAL(dos_part)
|
||||
1:
|
||||
cmpb $0xFF, %al
|
||||
je 2f
|
||||
movb %al, %bl
|
||||
movl %ebx, LOCAL(bsd_part)
|
||||
2:
|
||||
movl %edx, LOCAL(boot_dev)
|
||||
shrl $24, %edx
|
||||
movb %dl, LOCAL(boot_drive)
|
||||
movb $0xFF, %dh
|
||||
movl $GRUB_MEMORY_MACHINE_PROT_STACK, %esp
|
||||
/* enter the usual booting */
|
||||
call prot_to_real
|
||||
.code16
|
||||
jmp LOCAL (codestart)
|
||||
|
||||
.code32
|
||||
|
||||
post_reed_solomon:
|
||||
|
@ -201,9 +180,7 @@ post_reed_solomon:
|
|||
popl %esi
|
||||
#endif
|
||||
|
||||
movb LOCAL(boot_drive), %dl
|
||||
movl LOCAL(dos_part), %eax
|
||||
movl LOCAL(bsd_part), %ebx
|
||||
movl LOCAL(boot_dev), %edx
|
||||
movl $prot_to_real, %edi
|
||||
movl $real_to_prot, %ecx
|
||||
jmp *%esi
|
||||
|
|
|
@ -622,7 +622,8 @@ grub_disk_biosdisk_fini (void)
|
|||
GRUB_MOD_INIT(biosdisk)
|
||||
{
|
||||
struct grub_biosdisk_cdrp *cdrp
|
||||
= (struct grub_biosdisk_cdrp *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR;
|
||||
= (struct grub_biosdisk_cdrp *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR;
|
||||
grub_uint8_t boot_drive;
|
||||
|
||||
if (grub_disk_firmware_is_tainted)
|
||||
{
|
||||
|
@ -634,15 +635,16 @@ GRUB_MOD_INIT(biosdisk)
|
|||
grub_memset (cdrp, 0, sizeof (*cdrp));
|
||||
cdrp->size = sizeof (*cdrp);
|
||||
cdrp->media_type = 0xFF;
|
||||
if ((! grub_biosdisk_get_cdinfo_int13_extensions (grub_boot_drive, cdrp)) &&
|
||||
((cdrp->media_type & GRUB_BIOSDISK_CDTYPE_MASK)
|
||||
== GRUB_BIOSDISK_CDTYPE_NO_EMUL))
|
||||
boot_drive = (grub_boot_device >> 24);
|
||||
if ((! grub_biosdisk_get_cdinfo_int13_extensions (boot_drive, cdrp))
|
||||
&& ((cdrp->media_type & GRUB_BIOSDISK_CDTYPE_MASK)
|
||||
== GRUB_BIOSDISK_CDTYPE_NO_EMUL))
|
||||
cd_drive = cdrp->drive_no;
|
||||
/* Since diskboot.S rejects devices over 0x90 it must be a CD booted with
|
||||
cdboot.S
|
||||
*/
|
||||
if (grub_boot_drive >= 0x90)
|
||||
cd_drive = grub_boot_drive;
|
||||
if (boot_drive >= 0x90)
|
||||
cd_drive = boot_drive;
|
||||
|
||||
grub_disk_dev_register (&grub_biosdisk_dev);
|
||||
}
|
||||
|
|
|
@ -67,10 +67,15 @@ void
|
|||
grub_machine_get_bootlocation (char **device, char **path)
|
||||
{
|
||||
char *ptr;
|
||||
grub_uint8_t boot_drive, dos_part, bsd_part;
|
||||
|
||||
boot_drive = (grub_boot_device >> 24);
|
||||
dos_part = (grub_boot_device >> 16);
|
||||
bsd_part = (grub_boot_device >> 8);
|
||||
|
||||
/* No hardcoded root partition - make it from the boot drive and the
|
||||
partition number encoded at the install time. */
|
||||
if (grub_boot_drive == GRUB_BOOT_MACHINE_PXE_DL)
|
||||
if (boot_drive == GRUB_BOOT_MACHINE_PXE_DL)
|
||||
{
|
||||
if (grub_pc_net_config)
|
||||
grub_pc_net_config (device, path);
|
||||
|
@ -82,18 +87,18 @@ grub_machine_get_bootlocation (char **device, char **path)
|
|||
*device = grub_malloc (DEV_SIZE);
|
||||
ptr = *device;
|
||||
grub_snprintf (*device, DEV_SIZE,
|
||||
"%cd%u", (grub_boot_drive & 0x80) ? 'h' : 'f',
|
||||
grub_boot_drive & 0x7f);
|
||||
"%cd%u", (boot_drive & 0x80) ? 'h' : 'f',
|
||||
boot_drive & 0x7f);
|
||||
ptr += grub_strlen (ptr);
|
||||
|
||||
if (grub_install_dos_part >= 0)
|
||||
if (dos_part != 0xff)
|
||||
grub_snprintf (ptr, DEV_SIZE - (ptr - *device),
|
||||
",%u", grub_install_dos_part + 1);
|
||||
",%u", dos_part + 1);
|
||||
ptr += grub_strlen (ptr);
|
||||
|
||||
if (grub_install_bsd_part >= 0)
|
||||
if (bsd_part != 0xff)
|
||||
grub_snprintf (ptr, DEV_SIZE - (ptr - *device), ",%u",
|
||||
grub_install_bsd_part + 1);
|
||||
bsd_part + 1);
|
||||
ptr += grub_strlen (ptr);
|
||||
*ptr = 0;
|
||||
}
|
||||
|
|
|
@ -82,8 +82,6 @@ LOCAL(cont):
|
|||
movsb
|
||||
#endif
|
||||
|
||||
movl %eax, %esi
|
||||
|
||||
/* clean out the bss */
|
||||
movl $BSS_START_SYMBOL, %edi
|
||||
|
||||
|
@ -97,9 +95,7 @@ LOCAL(cont):
|
|||
rep
|
||||
stosb
|
||||
|
||||
movl %esi, EXT_C(grub_install_dos_part)
|
||||
movb %dl, EXT_C(grub_boot_drive)
|
||||
movl %ebx, EXT_C(grub_install_bsd_part)
|
||||
movl %edx, EXT_C(grub_boot_device)
|
||||
|
||||
/*
|
||||
* Call the start of main body of C code.
|
||||
|
@ -182,9 +178,5 @@ FUNCTION(grub_pxe_call)
|
|||
#include "../int.S"
|
||||
|
||||
.bss
|
||||
VARIABLE(grub_boot_drive)
|
||||
.byte 0
|
||||
VARIABLE(grub_install_dos_part)
|
||||
.long 0xFFFFFFFF
|
||||
VARIABLE(grub_install_bsd_part)
|
||||
.long 0xFFFFFFFF
|
||||
VARIABLE(grub_boot_device)
|
||||
.long 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue