From ef74f1b6ead6ee8ab30bf2585a1e5ab3ea329a2c Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 26 Feb 2014 14:12:00 -0800 Subject: [PATCH] bios: Fix lowmem check The lowmem check was backwards and would report error when there wasn't any. This was missed because the Ctrl key check was *also* backwards and so the check would only be done when Ctrl was held down. Signed-off-by: H. Peter Anvin --- core/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/init.c b/core/init.c index f286622f..41e5fea1 100644 --- a/core/init.c +++ b/core/init.c @@ -21,7 +21,7 @@ static inline void check_escapes(void) KbdFlags = oreg.eax.b[0]; /* Ctrl->skip 386 check */ - if (oreg.eax.b[0] & 0x04) { + if (!(oreg.eax.b[0] & 0x04)) { /* * Now check that there is sufficient low (DOS) memory * @@ -35,7 +35,7 @@ static inline void check_escapes(void) mem = ((uint32_t)__lowmem_heap) + min_lowmem_heap + 1023; mem = mem >> 10; - if (mem < oreg.eax.w[0]) { + if (oreg.eax.w[0] < mem) { char buf[256]; snprintf(buf, sizeof(buf), -- 2.11.4.GIT