From owner-freebsd-arch@FreeBSD.ORG Fri Nov 5 19:05:00 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E3BF216A4CE for ; Fri, 5 Nov 2004 19:05:00 +0000 (GMT) Received: from mail5.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD7CE43D3F for ; Fri, 5 Nov 2004 19:05:00 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 5926 invoked from network); 5 Nov 2004 19:05:00 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 5 Nov 2004 19:04:59 -0000 Received: from [10.50.41.235] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id iA5J4oJo096288; Fri, 5 Nov 2004 14:04:56 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Willem Jan Withagen Date: Fri, 5 Nov 2004 14:00:34 -0500 User-Agent: KMail/1.6.2 References: <418AB176.9030604@withagen.nl> <200411041835.46465.jhb@FreeBSD.org> <418AC4B3.9020305@withagen.nl> In-Reply-To: <418AC4B3.9020305@withagen.nl> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200411051400.34684.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: "arch@freebsd.org" cc: freebsd-arch@FreeBSD.org Subject: Re: Booting questions .... X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Nov 2004 19:05:01 -0000 On Thursday 04 November 2004 07:09 pm, Willem Jan Withagen wrote: > John Baldwin wrote: > > On Thursday 04 November 2004 05:47 pm, Willem Jan Withagen wrote: > >>Hi, > >> > >>I'm looking for a place to sensibly insert memorytest routines.... > >> > >>Currently I'd like to do that not in the loader, but in the kernel where > >>memory is already setup to be one flat address space. This makes > >>programming a lot simpler. > > > > The loader does use a flat address space, it is just rooted at 0xa000 > > rather than 0x0, so you can't test the first few kb FWIW. > > Nice, > > But is it unsegmented? (perhaps I have a wrong idea of a flat address > space) Yes, it is unsegmented. You can translate physical addresses to virtual addresses using PTOV() and vice versa using VTOP(). > What I mean with this is that I can iterate from 0xa000 to 0xffffffff with > a "char *p" and do test_bytes( 0xa000, 0xffffffff, 0xff). (assuming this > all has memory) Yes. > Next is then which ranges are valid to test, and then things really start > to get complicated and arch dependant. Which is why I ended up in machdep.c > right after the setting up of the memory ranges. Heh, the above memory mapping is also i386 specific. Alpha only has a small bit of memory mapped in the loader, same with sparc64, etc. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org