Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Nov 2004 01:09:23 +0100
From:      Willem Jan Withagen <wjw@withagen.nl>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: Booting questions ....
Message-ID:  <418AC4B3.9020305@withagen.nl>
In-Reply-To: <200411041835.46465.jhb@FreeBSD.org>
References:  <418AB176.9030604@withagen.nl> <200411041835.46465.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?418AC4B3.9020305>