Fix installing the E820 data into MEMDISK
authorhpa <hpa>
Wed, 16 Apr 2003 05:23:31 +0000 (05:23 +0000)
committerhpa <hpa>
Wed, 16 Apr 2003 05:23:31 +0000 (05:23 +0000)
memdisk/memdisk.asm
memdisk/setup.c

index 220db47..acad713 100644 (file)
@@ -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:
index 524f3a4..6a6d99f 100644 (file)
@@ -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",