aboutsummaryrefslogtreecommitdiffstats
path: root/memdisk
diff options
context:
space:
mode:
authorDuane Voth <duanev@io.com>2007-08-27 21:04:19 -0500
committerH. Peter Anvin <hpa@zytor.com>2007-08-27 22:29:45 -0700
commitf899b67e78b7fe108ee4c7820589b023fcc1827e (patch)
treef1cb4107c6edda8c616e65d2a541ba8c3c75b73b /memdisk
parentc30d91c73fa2e82a1f1ce7d2d2a177c00f95f0f2 (diff)
downloadsyslinux-elf-f899b67e78b7fe108ee4c7820589b023fcc1827e.tar.gz
syslinux-elf-f899b67e78b7fe108ee4c7820589b023fcc1827e.tar.xz
syslinux-elf-f899b67e78b7fe108ee4c7820589b023fcc1827e.zip
MEMDISK: Fix register messup in EDD
Hello all, I ran across a couple bugs in memdisk concerning hd images the other day. With the attached patch I've been able to successfully boot a 32MB gzipped hd image. (I'll put the image up for a short while at ftp://ftp.io.com/pub/usr/duanev/fdoshd.img.gz) The pxelinux.cfg entry I'm using is: label fdos kernel memdisk append keeppxe initrd=fdoshd.img.gz syslinux/memdisk is great, thanks Peter et. al.! -- Duane Voth duanev@io.com Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'memdisk')
-rw-r--r--memdisk/memdisk.asm15
1 files changed, 8 insertions, 7 deletions
diff --git a/memdisk/memdisk.asm b/memdisk/memdisk.asm
index fc46e844..a1713802 100644
--- a/memdisk/memdisk.asm
+++ b/memdisk/memdisk.asm
@@ -464,10 +464,10 @@ edd_setup_regs:
cmp dword [es:si+4],-1
je .linear_address
- movzx esi,word [es:si+4] ; Offset
+ movzx ebx,word [es:si+4] ; Offset
movzx edi,word [es:si+6] ; Segment
shl edi,4
- add esi,edi
+ add ebx,edi
jmp .got_address
.linear_address:
@@ -480,23 +480,24 @@ edd_setup_regs:
; no really better code available
jne .error
- mov esi,[es:si+16]
+ mov ebx,[es:si+16]
.got_address:
cmp dword [es:si+12],0 ; LBA too large?
jne .overrun
movzx ecx, word [es:si+2] ; Sectors to transfer
- mov edi,[es:si+8] ; Starting sector
- mov eax,edi
+ mov esi,[es:si+8] ; Starting sector
+ mov eax,esi
add eax,ecx
jc .overrun
cmp eax,[DiskSize]
ja .overrun
shl ecx,SECTORSIZE_LG2-2 ; Convert to dwords
- shl edi,SECTORSIZE_LG2 ; Convert to an offset
- add edi,[DiskBuf]
+ shl esi,SECTORSIZE_LG2 ; Convert to an offset
+ add esi,[DiskBuf]
+ mov edi,ebx
pop es
ret