From owner-freebsd-hackers Sat May 27 17:22:17 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id RAA13421 for hackers-outgoing; Sat, 27 May 1995 17:22:17 -0700 Received: from ref.tfs.com (ref.tfs.com [140.145.254.251]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id RAA13415 for ; Sat, 27 May 1995 17:22:16 -0700 Received: (from julian@localhost) by ref.tfs.com (8.6.8/8.6.6) id RAA06523; Sat, 27 May 1995 17:21:45 -0700 From: Julian Elischer Message-Id: <199505280021.RAA06523@ref.tfs.com> Subject: Re: LINT additions To: bde@zeta.org.au (Bruce Evans) Date: Sat, 27 May 1995 17:21:45 -0700 (PDT) Cc: freebsd-hackers@FreeBSD.org, henrich@crh.cl.msu.edu In-Reply-To: <199505272301.JAA18466@godzilla.zeta.org.au> from "Bruce Evans" at May 28, 95 09:01:19 am Content-Type: text Content-Length: 2573 Sender: hackers-owner@FreeBSD.org Precedence: bulk > > ># MAXMEM Specified the maximum amount of ram in the system in kilobytes. Only > ># use this if your BIOS is broken (I.e. Compaq's). You can specify as > e.g., > > Actually, FreeBSD's determination of the memory size is broken. It doesn't > even use the BIOS except to print a warning if there is a conflict. The > memory size in the CMOS RAM has priority. There are conflicting standards > for the size in the CMOS RAM. > > ># large an amount as you expect will eventually be in the system, as > ># FreeBSD is smart enough to recompute the max memory size by scanning > ># for the presence of this much memory. > > It's not smart enough. Probing beyond the end of physical memory can cause > an NMI trap for a parity error. The first NMI trap is fatal. > > Bruce > in the OSF/1-386 code, I do the memeory probe WAAAYYYY early.. (while the bios can still run actually), while we are still running on the boot-codes segment descriptors etc.. and certainly before we are in paging mode.. This tests if the BIOS says we have > 63MB ram MASK lops off the top bits of the address (because we are still running away from our 'linked' address. It's not great, but it got my machines up and going julian /* * check to see if there is more ram beyond the end of extmem * because extmem can only show 64k in bios */ checkmoreram: pusha mov $EXT(extmem), %ebx /* passed in from the MACH bootblocks */ and $MASK, %ebx mov (%ebx),%eax /* XXX I must check about sign extension etc */ cmpl $0xfc00, %eax jge 1f #ifdef LOCORE_DEBUG mov $0x40,%ebx call output #endif /* LOCORE_DEBUG */ popa ret /* extmem not even full */ 1: movl $0x40ffffc, %edx /* point to the great unknown */ movl $(0xfc00), %ecx /* count of kB extmem*/ #ifdef LOCORE_DEBUG mov $0x61,%ebx call output #endif /* LOCORE_DEBUG */ 2: movl $0x5a5a5a5a,(%edx) /* put in a value */ movl 0,%eax /* XXX Need to try flush cache */ movl (%edx),%eax /* get value back */ cmpl $0x5a5a5a5a,%eax jne 3f addl $0x400,%ecx /* add 1 MB to the ram we trust */ addl $0x100000,%edx /* move pointer by 1MB too */ #ifdef LOCORE_DEBUG addl $0x1, %ebx call output #endif /* LOCORE_DEBUG */ jmp 2b /* go back and test the next MB */ 3: mov $EXT(extmem), %ebx and $MASK, %ebx mov %ecx,(%ebx) /* put back the new extmem value */ popa ret