[syslinux:syslinux-5.xx] bios: Fix lowmem check

syslinux-bot for H. Peter Anvin hpa at linux.intel.com
Wed Feb 26 14:15:05 PST 2014


Commit-ID:  ef74f1b6ead6ee8ab30bf2585a1e5ab3ea329a2c
Gitweb:     http://www.syslinux.org/commit/ef74f1b6ead6ee8ab30bf2585a1e5ab3ea329a2c
Author:     H. Peter Anvin <hpa at linux.intel.com>
AuthorDate: Wed, 26 Feb 2014 14:12:00 -0800
Committer:  H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Wed, 26 Feb 2014 14:12:00 -0800

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 <hpa at linux.intel.com>

---
 core/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/init.c b/core/init.c
index f286622..41e5fea 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),


More information about the Syslinux-commits mailing list