From owner-freebsd-arch@FreeBSD.ORG Fri Nov 5 00:09:25 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 A154216A4CE; Fri, 5 Nov 2004 00:09:25 +0000 (GMT) Received: from freebee.digiware.nl (dsl439.iae.nl [212.61.63.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB36243D48; Fri, 5 Nov 2004 00:09:24 +0000 (GMT) (envelope-from wjw@withagen.nl) Received: from [212.61.27.71] (dual.digiware.nl [212.61.27.71]) by freebee.digiware.nl (8.12.10/8.12.10) with ESMTP id iA509N5p017724; Fri, 5 Nov 2004 01:09:23 +0100 (CET) (envelope-from wjw@withagen.nl) Message-ID: <418AC4B3.9020305@withagen.nl> Date: Fri, 05 Nov 2004 01:09:23 +0100 From: Willem Jan Withagen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: John Baldwin References: <418AB176.9030604@withagen.nl> <200411041835.46465.jhb@FreeBSD.org> In-Reply-To: <200411041835.46465.jhb@FreeBSD.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 00:09:25 -0000 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) 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) test_bytes( char *start, char* end, char mask) { char *save; while (start < end ) { *start = mask; start++; } start = save; while (start < end ) { if (*start != mask) error(start); start++; } } 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. --WjW