diff --git a/ChangeLog b/ChangeLog index 84aef90f2..679849158 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-02-29 Vladimir Serbinenko + + * grub-core/lib/i386/relocator16.S: Declare LOCAL(relocator16_end) + for local arithmetics. + Break %sp init into 2 instructions. + Add 0 byte at the end. + 2012-02-29 Vladimir Serbinenko * grub-core/disk/diskfilter.c (read_segment): Initialise err diff --git a/grub-core/lib/i386/relocator16.S b/grub-core/lib/i386/relocator16.S index d5f5f3f03..2b144fb70 100644 --- a/grub-core/lib/i386/relocator16.S +++ b/grub-core/lib/i386/relocator16.S @@ -102,12 +102,14 @@ LOCAL(cont3): .byte 0xb8 VARIABLE(grub_relocator16_keep_a20_enabled) .word 0 + test %ax, %ax jnz LOCAL(gate_a20_done) movw %cs, %ax movw %ax, %ss - leaw EXT_C(grub_relocator16_end) - LOCAL(base) + GRUB_RELOCATOR16_STACK_SIZE, %sp + leaw LOCAL(relocator16_end) - LOCAL(base), %sp + addw $GRUB_RELOCATOR16_STACK_SIZE, %sp /* second, try a BIOS call */ movw $0x2400, %ax @@ -283,4 +285,6 @@ LOCAL(gdt_end): VARIABLE(grub_relocator16_idt) .word 0 .long 0 +LOCAL(relocator16_end): VARIABLE(grub_relocator16_end) + .byte 0