MBR: Handle the stack in read_sector correctly...
authorH. Peter Anvin <hpa@zytor.com>
Wed, 11 Jul 2007 23:41:52 +0000 (16:41 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 11 Jul 2007 23:41:52 +0000 (16:41 -0700)
mbr/mbr.S

index 50e038a..43b2983 100644 (file)
--- a/mbr/mbr.S
+++ b/mbr/mbr.S
@@ -111,7 +111,7 @@ next:
  */
 read_sector:
        pushal
-       movw    %sp, %si
+       movw    %sp, %bp
        xorl    %edx, %edx
        movw    $bootsec, %bx
 read_sector_cbios:
@@ -133,11 +133,12 @@ read_sector_ebios:
        pushw   %bx     /* Buffer offset */
        pushw   $1      /* Sector count */
        pushw   $16     /* Size of packet */
+       movw    %sp, %si
        movb    $0x42, %ah
 read_common:
        movb    (driveno), %dl
        int     $0x13
-       movw    %si, %sp
+       movw    %bp, %sp
        popal
        ret