aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhpa <hpa>2001-01-19 22:07:24 +0000
committerhpa <hpa>2001-01-19 22:07:24 +0000
commit4af8c7190cfdbe1c05cf65b408e3abdde91b0667 (patch)
tree94ae5b62eb9b98f5570fb6404ca4d4cf53f5a21e
parentf4df265e7f15e5a4f305f5c4f686a80ad916409d (diff)
downloadsyslinux.git-4af8c7190cfdbe1c05cf65b408e3abdde91b0667.tar.gz
syslinux.git-4af8c7190cfdbe1c05cf65b408e3abdde91b0667.tar.xz
syslinux.git-4af8c7190cfdbe1c05cf65b408e3abdde91b0667.zip
Bug fixes (we hope!) to both the E820 and new A20 code.
-rw-r--r--ldlinux.asm24
-rw-r--r--pxelinux.asm24
2 files changed, 22 insertions, 26 deletions
diff --git a/ldlinux.asm b/ldlinux.asm
index 575a8fb6..5319598b 100644
--- a/ldlinux.asm
+++ b/ldlinux.asm
@@ -1842,18 +1842,16 @@ get_e820:
; Look for a memory block starting at <= 1 MB and continuing upward
;
cmp dword [E820Buf+4], byte 0
- ja .int_loop ; Start >= 4 GB
- mov edx,[E820Buf]
- cmp edx, (1 << 20)
- ja .int_loop
- mov eax, 0FFFFFFFFh
+ ja .int_loop ; Start >= 4 GB?
+ mov edx, (1 << 20)
+ sub edx, [E820Buf]
+ jb .int_loop ; Start >= 1 MB?
+ mov eax, 0FFFFFFFFh
cmp dword [E820Buf+12], byte 0
ja .huge ; Size >= 4 GB
mov eax, [E820Buf+8]
-.huge: mov ecx, (1 << 20)
- sub ecx, edx
- sub eax, ecx ; Adjust size to start at 1 MB
- jb .int_loop ; Completely below 1 MB
+.huge: sub eax, edx ; Adjust size to start at 1 MB
+ jbe .int_loop ; Completely below 1 MB?
; Now EAX contains the size of memory 1 MB...up
cmp dword [E820Buf+16], byte 1
@@ -2565,8 +2563,8 @@ try_enable_a20:
;
; If the A20 type is known, jump straight to type
;
- movzx si,byte [ss:A20Type]
- jmp word [si+A20List]
+ movzx bp,byte [ss:A20Type]
+ jmp word [bp+A20List] ; Implicit ss: because of bp
;
; First, see if we are on a system with no A20 gate
@@ -2684,8 +2682,8 @@ disable_a20:
;
; call try_wbinvd
- movzx si,[ss:A20Type]
- jmp word [si+A20DList]
+ movzx bp,byte [ss:A20Type]
+ jmp word [bp+A20DList] ; Implicit ss: because of bp
a20d_bios:
mov ax,2400h
diff --git a/pxelinux.asm b/pxelinux.asm
index 812bf434..c4844a73 100644
--- a/pxelinux.asm
+++ b/pxelinux.asm
@@ -1462,18 +1462,16 @@ get_e820:
; Look for a memory block starting at <= 1 MB and continuing upward
;
cmp dword [E820Buf+4], byte 0
- ja .int_loop ; Start >= 4 GB
- mov edx,[E820Buf]
- cmp edx, (1 << 20)
- ja .int_loop
- mov eax, 0FFFFFFFFh
+ ja .int_loop ; Start >= 4 GB?
+ mov edx, (1 << 20)
+ sub edx, [E820Buf]
+ jb .int_loop ; Start >= 1 MB?
+ mov eax, 0FFFFFFFFh
cmp dword [E820Buf+12], byte 0
ja .huge ; Size >= 4 GB
mov eax, [E820Buf+8]
-.huge: mov ecx, (1 << 20)
- sub ecx, edx
- sub eax, ecx ; Adjust size to start at 1 MB
- jb .int_loop ; Completely below 1 MB
+.huge: sub eax, edx ; Adjust size to start at 1 MB
+ jbe .int_loop ; Completely below 1 MB?
; Now EAX contains the size of memory 1 MB...up
cmp dword [E820Buf+16], byte 1
@@ -2146,8 +2144,8 @@ try_enable_a20:
;
; If the A20 type is known, jump straight to type
;
- movzx si,byte [ss:A20Type]
- jmp word [si+A20List]
+ movzx bp,byte [ss:A20Type]
+ jmp word [bp+A20List] ; Implicit ss: because of bp
;
; First, see if we are on a system with no A20 gate
@@ -2265,8 +2263,8 @@ disable_a20:
;
; call try_wbinvd
- movzx si,[ss:A20Type]
- jmp word [si+A20DList]
+ movzx bp,byte [ss:A20Type]
+ jmp word [bp+A20DList] ; Implicit ss: because of bp
a20d_bios:
mov ax,2400h