Improve FreeDOS direct loading support compatibility.
* include/grub/i386/relocator.h (grub_relocator16_state): New member ebp. * grub-core/lib/i386/relocator.c (grub_relocator16_ebp): New extern variable. (grub_relocator16_boot): Handle %ebp. * grub-core/lib/i386/relocator16.S: Likewise. * grub-core/loader/i386/pc/freedos.c: Load BPB to pass kernel which partition to load from. Check that kernel file is not too large. Set register dl to BIOS unit number as well.
This commit is contained in:
parent
7782b8a62f
commit
08bcec5020
5 changed files with 82 additions and 8 deletions
|
@ -54,6 +54,7 @@ extern grub_uint16_t grub_relocator16_sp;
|
|||
extern grub_uint32_t grub_relocator16_edx;
|
||||
extern grub_uint32_t grub_relocator16_ebx;
|
||||
extern grub_uint32_t grub_relocator16_esi;
|
||||
extern grub_uint32_t grub_relocator16_ebp;
|
||||
|
||||
extern grub_uint16_t grub_relocator16_keep_a20_enabled;
|
||||
|
||||
|
@ -225,6 +226,7 @@ grub_relocator16_boot (struct grub_relocator *rel,
|
|||
grub_relocator16_ss = state.ss;
|
||||
grub_relocator16_sp = state.sp;
|
||||
|
||||
grub_relocator16_ebp = state.ebp;
|
||||
grub_relocator16_ebx = state.ebx;
|
||||
grub_relocator16_edx = state.edx;
|
||||
grub_relocator16_esi = state.esi;
|
||||
|
|
|
@ -259,6 +259,11 @@ VARIABLE(grub_relocator16_edx)
|
|||
VARIABLE(grub_relocator16_ebx)
|
||||
.long 0
|
||||
|
||||
/* movl imm32, %ebp. */
|
||||
.byte 0x66, 0xbd
|
||||
VARIABLE(grub_relocator16_ebp)
|
||||
.long 0
|
||||
|
||||
/* Cleared direction flag is of no problem with any current
|
||||
payload and makes this implementation easier. */
|
||||
cld
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue