diff options
author | hpa <hpa> | 2003-04-16 05:23:31 +0000 |
---|---|---|
committer | hpa <hpa> | 2003-04-16 05:23:31 +0000 |
commit | c7d546c885a172f9c5a26c984ae40bebe312b556 (patch) | |
tree | a940e6948bfb07cd6b5f101a5be3723be37c8413 | |
parent | 4aa7cdf63902a08079f8336541325d99f4e45e48 (diff) | |
download | syslinux-c7d546c885a172f9c5a26c984ae40bebe312b556.tar.gz |
Fix installing the E820 data into MEMDISK
-rw-r--r-- | memdisk/memdisk.asm | 6 | ||||
-rw-r--r-- | memdisk/setup.c | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/memdisk/memdisk.asm b/memdisk/memdisk.asm index 220db475..acad7132 100644 --- a/memdisk/memdisk.asm +++ b/memdisk/memdisk.asm @@ -7,7 +7,7 @@ ; A program to emulate an INT 13h disk BIOS from a "disk" in extended ; memory. ; -; Copyright (C) 2001 H. Peter Anvin +; Copyright (C) 2001-2003 H. Peter Anvin ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by @@ -308,7 +308,7 @@ int15_e820: jne .renew mov ebx,E820Table .renew: - add bx, byte 12 ; Advance to next + add bx,12 ; Advance to next mov eax,[bx-4] ; Type and eax,eax ; Null type? jz .renew ; If so advance to next @@ -323,7 +323,7 @@ int15_e820: sbb ecx,[bx-8] mov [es:di+8],eax ; Length (low) mov [es:di+12],ecx ; Length (high) - cmp dword [bx+8], byte -1 ; Type of next = end? + cmp dword [bx+8],-1 ; Type of next = end? jne .notdone xor ebx,ebx ; Done with table .notdone: diff --git a/memdisk/setup.c b/memdisk/setup.c index 524f3a46..6a6d99fc 100644 --- a/memdisk/setup.c +++ b/memdisk/setup.c @@ -599,7 +599,8 @@ uint32_t setup(syscall_t cs_syscall, void *cs_bounce) /* Copy driver followed by E820 table */ memcpy((void *)(driverseg << 4), &_binary_memdisk_bin_start, bin_size); - memcpy((void *)((driverseg << 4) + bin_size), ranges, (nranges+1)*3); + memcpy((void *)((driverseg << 4) + bin_size), ranges, + (nranges+1)*sizeof(ranges[0])); /* Install the interrupt handlers */ printf("old: int13 = %08x int15 = %08x\n", |