summaryrefslogtreecommitdiff
path: root/mbr
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-07-11 16:51:46 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-07-11 16:51:46 -0700
commit289d77c6733182088953a02b9c09776272b04203 (patch)
tree9dc01c98f1c63122b74dd827e336e70af69931cb /mbr
parenta9a2963de68bfb52c51c793c5325608a99f60d91 (diff)
downloadsyslinux-289d77c6733182088953a02b9c09776272b04203.tar.gz
MBR: Don't clobber %eax before entering CBIOS code
Diffstat (limited to 'mbr')
-rw-r--r--mbr/mbr.S8
1 files changed, 5 insertions, 3 deletions
diff --git a/mbr/mbr.S b/mbr/mbr.S
index 9e89b37c..b9729eb8 100644
--- a/mbr/mbr.S
+++ b/mbr/mbr.S
@@ -80,8 +80,10 @@ next:
shrw %cx /* Bit 0 = fixed disk subset */
jnc 1f
- /* We have EBIOS; patch in jump to skip over read_sector_cbios */
- movw $0xeb+((read_common-read_sector_cbios-2)<< 8), (read_sector_cbios)
+ /* We have EBIOS; patch in the following code at
+ read_sector_cbios: movb $0x42, %ah ; jmp read_common */
+ movl $0xeb42b4+((read_common-read_sector_cbios-4) << 24), \
+ (read_sector_cbios)
1:
popw %dx
@@ -120,9 +122,9 @@ read_sector:
pushw $1 /* Sector count */
pushw $16 /* Size of packet */
movw %sp, %si
- movb $0x42, %ah
/* This chunk is skipped if we have ebios */
+ /* Do not clobber %eax before this chunk! */
read_sector_cbios:
divl (secpercyl)
shlb $6, %ah