aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-10-10 12:10:24 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-10-13 12:26:58 -0700
commit652c3057145a41703e5e817d86b2584db9ab806d (patch)
tree003b164e76dad49fe944c2053dad89208e93f7e2 /core
parentef45d17e31d591a579c1d51a5e6a026493465a64 (diff)
downloadsyslinux-elf-652c3057145a41703e5e817d86b2584db9ab806d.tar.gz
syslinux-elf-652c3057145a41703e5e817d86b2584db9ab806d.tar.xz
syslinux-elf-652c3057145a41703e5e817d86b2584db9ab806d.zip
Support "extended attributes" for INT 15h, AX=E820h
Some blithering idiot thought it was a good idea to introduce "extended attributes" for INT 15h, AX=E820h, and in doing so, breaking compatibility with ALL E820 users out there. F*cking morons. Implement handling of extended attributes in: - e820 parsing in the core - e820 parsing in libcom32 - e820 parsing *and proxying* in memdisk The latter is the really painful one. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core')
-rw-r--r--core/highmem.inc14
1 files changed, 12 insertions, 2 deletions
diff --git a/core/highmem.inc b/core/highmem.inc
index 1cd46dd9..7341bf27 100644
--- a/core/highmem.inc
+++ b/core/highmem.inc
@@ -47,7 +47,7 @@ get_e820:
.do_e820: mov eax,0000E820h
mov edx,534D4150h ; "SMAP" backwards
xor ecx,ecx
- mov cl,20 ; ECX <- 20
+ mov cl,24 ; ECX <- 24 (size of buffer)
mov di,E820Buf
int 15h
jnc .no_carry
@@ -58,6 +58,15 @@ get_e820:
.no_carry:
cmp eax,534D4150h
jne no_e820
+ cmp cl,24
+ jb .no_ext_attr
+ ;
+ ; Some blithering idiot added a whole new field to E820,
+ ; completely without regard for its implications...
+ ;
+ test byte [E820Buf+20],1 ; AddressRangeEnabled
+ jz .not_ram
+.no_ext_attr:
;
; Look for a memory block starting at <= 1 MB and continuing upward
;
@@ -70,6 +79,7 @@ get_e820:
; Non-memory range. Remember this as a limit; some BIOSes get the length
; of primary RAM incorrect!
;
+.not_ram:
cmp eax, (1 << 20)
jb .int_loop ; Starts in lowmem region
cmp eax,[E820Max]
@@ -142,7 +152,7 @@ got_highmem:
section .bss
alignb 4
-E820Buf resd 5 ; INT 15:E820 data buffer
+E820Buf resd 6 ; INT 15:E820 data buffer
E820Mem resd 1 ; Memory detected by E820
E820Max resd 1 ; Is E820 memory capped?
HighMemSize resd 1 ; End of memory pointer (bytes)