* 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.
* include/grub/i386/pc/int.h (grub_i386_idt): New struct.
(grub_realidt): New var.
* grub-core/lib/i386/relocator16.S (grub_relocator16_idt): New variable
Load idt.
* grub-core/lib/i386/relocator.c (grub_relocator16_idt):
New declaration.
(grub_relocator16_boot): Set grub_relocator16_idt.
* grub-core/kern/i386/realmode.S (realidt): Renamed to ...
(LOCAL(realidt)): ... this.
* grub-core/boot/i386/pc/startup_raw.S: Pass pointer to realidt in eax.
* grub-core/kern/i386/pc/startup.S: Save pointer to realidt.
(grub_realidt): New variable.
part. Instead setup the correct stack in RM.
* grub-core/lib/i386/relocator.c (grub_relocator16_boot): Reserve place
for stack.
* include/grub/i386/relocator_private.h: New file.
* grub-core/lib/i386/relocator16.S (grub_relocator16_start): Move
grub_relocator16_sp to %esp rather than %ss, and zero-extend it.
Fixes Ubuntu bug #683904.