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:
Vladimir 'phcoder' Serbinenko 2011-11-12 21:12:52 +01:00
parent 691cbb5816
commit 5fbdac149b
11 changed files with 63 additions and 171 deletions

View file

@ -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