Subject: Re: Potential fix for i386 Compaq/EISA machines' memory detection
To: None <port-i386@netbsd.org>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: port-i386
Date: 01/12/2003 17:29:04
--ELM739248659-1593-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII

Slight fix to previous - needed to use jnz, not jz. The compiled
bootblocks at the ftp server were updated.

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.org/
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-

--ELM739248659-1593-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=ISO-8859-2
Content-Disposition: attachment; filename=extmem.patch

Index: biosmemx.S
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/stand/lib/biosmemx.S,v
retrieving revision 1.2
diff -u -p -r1.2 biosmemx.S
--- biosmemx.S	1999/03/08 21:38:28	1.2
+++ biosmemx.S	2003/01/12 16:28:21
@@ -59,6 +59,19 @@ ENTRY(getextmem2)
 	int	$0x15
 	jc	err2
 
+/* some BIOSes return AX=BX=0; we must use CX, DX instead in that case */
+	test	%ax, %ax
+	jnz	afterquirk
+	test	%bx, %bx
+	jnz	afterquirk
+
+/* copy CX, DX to AX, BX respectively, so that rest of code DTRT */
+	data32
+	movl	%ecx, %eax	/* configured memory 1M to 16M, in K */
+	data32
+	movl	%edx, %ebx	/* configured memory above 16M, in 64K blocks*/
+
+afterquirk:
 	data32
 	movl	$0, %ecx
 	jmp ok2

--ELM739248659-1593-0_--