summaryrefslogtreecommitdiff
path: root/com32/lib/syslinux/memmap.c
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 /com32/lib/syslinux/memmap.c
parentef45d17e31d591a579c1d51a5e6a026493465a64 (diff)
downloadsyslinux-652c3057145a41703e5e817d86b2584db9ab806d.tar.gz
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 'com32/lib/syslinux/memmap.c')
-rw-r--r--com32/lib/syslinux/memmap.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/com32/lib/syslinux/memmap.c b/com32/lib/syslinux/memmap.c
index 5a0a34f7..c5f1b251 100644
--- a/com32/lib/syslinux/memmap.c
+++ b/com32/lib/syslinux/memmap.c
@@ -46,6 +46,7 @@ struct e820_entry {
uint64_t start;
uint64_t len;
uint32_t type;
+ uint32_t extattr;
};
struct syslinux_memmap *syslinux_memory_map(void)
@@ -74,7 +75,7 @@ struct syslinux_memmap *syslinux_memory_map(void)
ireg.eax.l = 0xe820;
ireg.edx.l = 0x534d4150;
ireg.ebx.l = 0;
- ireg.ecx.l = 20;
+ ireg.ecx.l = sizeof(*e820buf);
ireg.es = SEG(e820buf);
ireg.edi.w[0] = OFFS(e820buf);
@@ -86,6 +87,12 @@ struct syslinux_memmap *syslinux_memory_map(void)
(oreg.ecx.l < 20))
break;
+ if (oreg.ecx.l >= 24)
+ e820buf->extattr = 1; /* Enabled, normal */
+
+ if (!(e820buf->extattr & 1))
+ continue;
+
type = e820buf->type == 1 ? SMT_FREE : SMT_RESERVED;
start = e820buf->start;
len = e820buf->len;