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

next in thread | previous in thread | raw e-mail | index | archive | help
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 <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



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