From 982d5ea17847d1e27bb650d9a3205a368b197131 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20Januszewski?= Date: Wed, 27 Jan 2010 20:40:03 +0100 Subject: [PATCH] Check the EBDA is mapped before accessing it. The EBDA is the one region of memory which may not be mapped. If this is the case, and someone tries to access it, emit a proper warning. Thanks to Enrico Perla for spotting the problem. --- v86_mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v86_mem.c b/v86_mem.c index 23eb7c0..c492e92 100644 --- a/v86_mem.c +++ b/v86_mem.c @@ -44,7 +44,7 @@ void *vptr(u32 addr) { return (mem_vram + addr - VRAM_BASE); else if (addr < IVTBDA_SIZE) return (mem_low + addr); - else if (addr >= ebda_start && addr < ebda_start + ebda_size) + else if (mem_ebda && addr >= ebda_start && addr < ebda_start + ebda_size) return (mem_ebda + addr - ebda_start + ebda_diff); else { ulog(LOG_WARNING, "Trying to access an unsupported memory region at %x", addr); -- 2.11.4.GIT