required by the boot protocol.
* include/grub/i386/relocator.h (struct grub_relocator32_state): Add
ebp and edi members.
* grub-core/lib/i386/relocator.c (grub_relocator_boot): Handle
state.ebp and state.edi.
* grub-core/lib/i386/relocator32.S (grub_relocator32_start): Set
%ebp and %edi according to grub_relocator32_ebp and
grub_relocator32_edi respectively.
* grub-core/loader/i386/linux.c (grub_linux_boot): Zero state.ebp
and state.edi.
+2010-09-02 Colin Watson <cjwatson@ubuntu.com>
+
+ Zero %ebp and %edi when entering Linux's 32-bit entry point, as
+ required by the boot protocol.
+
+ * include/grub/i386/relocator.h (struct grub_relocator32_state): Add
+ ebp and edi members.
+ * grub-core/lib/i386/relocator.c (grub_relocator_boot): Handle
+ state.ebp and state.edi.
+ * grub-core/lib/i386/relocator32.S (grub_relocator32_start): Set
+ %ebp and %edi according to grub_relocator32_ebp and
+ grub_relocator32_edi respectively.
+ * grub-core/loader/i386/linux.c (grub_linux_boot): Zero state.ebp
+ and state.edi.
+
2010-09-02 Vladimir Serbinenko <phcoder@gmail.com>
Add i386-pc-pxe image target.
extern grub_uint32_t grub_relocator32_edx;
extern grub_uint32_t grub_relocator32_eip;
extern grub_uint32_t grub_relocator32_esp;
+extern grub_uint32_t grub_relocator32_ebp;
extern grub_uint32_t grub_relocator32_esi;
+extern grub_uint32_t grub_relocator32_edi;
extern grub_uint8_t grub_relocator64_start;
extern grub_uint8_t grub_relocator64_end;
grub_relocator32_edx = state.edx;
grub_relocator32_eip = state.eip;
grub_relocator32_esp = state.esp;
+ grub_relocator32_ebp = state.ebp;
grub_relocator32_esi = state.esi;
+ grub_relocator32_edi = state.edi;
grub_memmove (get_virtual_current_address (ch), &grub_relocator32_start,
RELOCATOR_SIZEOF (32));
movl %eax, %esp
+ /* mov imm32, %eax */
+ .byte 0xb8
+VARIABLE(grub_relocator32_ebp)
+ .long 0
+
+ movl %eax, %ebp
+
/* mov imm32, %eax */
.byte 0xb8
VARIABLE(grub_relocator32_esi)
.long 0
movl %eax, %esi
-
+
+ /* mov imm32, %eax */
+ .byte 0xb8
+VARIABLE(grub_relocator32_edi)
+ .long 0
+
+ movl %eax, %edi
+
/* mov imm32, %eax */
.byte 0xb8
VARIABLE(grub_relocator32_eax)
/* FIXME. */
/* asm volatile ("lidt %0" : : "m" (idt_desc)); */
- state.ebx = 0;
+ state.ebp = state.edi = state.ebx = 0;
state.esi = real_mode_target;
state.esp = real_mode_target;
state.eip = params->code32_start;
struct grub_relocator32_state
{
grub_uint32_t esp;
+ grub_uint32_t ebp;
grub_uint32_t eax;
grub_uint32_t ebx;
grub_uint32_t ecx;
grub_uint32_t edx;
grub_uint32_t eip;
grub_uint32_t esi;
+ grub_uint32_t edi;
};
struct grub_relocator16_state