Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39b68976 authored by H. Peter Anvin's avatar H. Peter Anvin
Browse files

x86, setup: When probing memory with e801, use ax/bx as a pair



When we use BIOS function e801 to probe memory, we should use ax/bx
(or cx/dx) as a pair, not mix and match.  This was a typo during the
translation from assembly code, and breaks at least one set of
machines in the field (which return cx = dx = 0).

Reported-and-tested-by: default avatarChris Samuel <chris@csamuel.org>
Fix-proposed-by: default avatarThomas Meyer <thomas@m3y3r.de>
Link: http://lkml.kernel.org/r/1303566747.12067.10.camel@localhost.localdomain
parent 5dd12af0
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -91,7 +91,7 @@ static int detect_memory_e801(void)
	if (oreg.ax > 15*1024) {
	if (oreg.ax > 15*1024) {
		return -1;	/* Bogus! */
		return -1;	/* Bogus! */
	} else if (oreg.ax == 15*1024) {
	} else if (oreg.ax == 15*1024) {
		boot_params.alt_mem_k = (oreg.dx << 6) + oreg.ax;
		boot_params.alt_mem_k = (oreg.bx << 6) + oreg.ax;
	} else {
	} else {
		/*
		/*
		 * This ignores memory above 16MB if we have a memory
		 * This ignores memory above 16MB if we have a memory