diff --git a/ChangeLog b/ChangeLog index 69d46b55c..6c9e3bf6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-09-03 Vladimir Serbinenko + + * grub-core/loader/i386/bsd.c (grub_freebsd_boot): Set %ebp to sane + value. + (grub_openbsd_boot): Likewise. + (grub_netbsd_boot): Likewise. + * grub-core/loader/i386/xnu.c (grub_xnu_boot_resume): Likewise. + (grub_xnu_boot): Likewise. + 2010-09-02 Vladimir Serbinenko * configure.ac: Clean LIBS variable after tests. diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c index cfea3b6a1..d72c8195a 100644 --- a/grub-core/loader/i386/bsd.c +++ b/grub-core/loader/i386/bsd.c @@ -746,6 +746,7 @@ grub_freebsd_boot (void) grub_memcpy (&stack[9], &bi, sizeof (bi)); state.eip = entry; state.esp = stack_target; + state.ebp = stack_target; stack[0] = entry; /* "Return" address. */ stack[1] = bootflags | FREEBSD_RB_BOOTINFO; stack[2] = bootdev; @@ -830,7 +831,8 @@ grub_openbsd_boot (void) #endif state.eip = entry; - state.esp = ((grub_uint8_t *) stack - (grub_uint8_t *) buf0) + buf_target; + state.ebp = state.esp + = ((grub_uint8_t *) stack - (grub_uint8_t *) buf0) + buf_target; stack[0] = entry; stack[1] = bootflags; stack[2] = openbsd_root; @@ -1045,6 +1047,7 @@ grub_netbsd_boot (void) state.eip = entry; state.esp = stack_target; + state.ebp = stack_target; stack[0] = entry; stack[1] = bootflags; stack[2] = 0; diff --git a/grub-core/loader/i386/xnu.c b/grub-core/loader/i386/xnu.c index 556f1dbf1..d35e9e0aa 100644 --- a/grub-core/loader/i386/xnu.c +++ b/grub-core/loader/i386/xnu.c @@ -836,6 +836,7 @@ grub_xnu_boot_resume (void) struct grub_relocator32_state state; state.esp = grub_xnu_stack; + state.ebp = grub_xnu_stack; state.eip = grub_xnu_entry_point; state.eax = grub_xnu_arg1; @@ -1114,6 +1115,7 @@ grub_xnu_boot (void) state.eip = grub_xnu_entry_point; state.eax = grub_xnu_arg1; state.esp = grub_xnu_stack; + state.ebp = grub_xnu_stack; return grub_relocator32_boot (grub_xnu_relocator, state); }