Ronald G Minnich <[EMAIL PROTECTED]> writes:

> On Tue, 23 Oct 2001, Ollie Lho wrote:
> 
> > "Eric W. Biederman" wrote:
> > >
> > > To get this really useful I need a relocateable linuxBIOS, so I can
> > > use global variables both when running from the cache and when I have
> > > memory setup.  The most portable way to do this appears to be setting
> > > up page tables so I can use virtual addresses in linuxBIOS.
> > >    ^^^^^^^^^^^
> >
> > Are you sure about this ?? Why do you want a page table to use cache
> > as RAM ??
> 
> Another way to do it: set up a data segment (e.g. 0x18) so that virtual 0
> is at, e.g, physical 0xffff0000. Then all your 0-based memory references
> are off in the cache. At some point, RAM is up, so do another LGDT with
> segment 0x18 based at physical 0. Voila, all your references now work for
> RAM.

The challenge is when you want to access something outside of linuxBIOS.
Possibly we could keep a global pointer char *ram.  That we would update
at the same time.

> I think this is easier than page tables. At the same time, I don't think
> page tables are totally impossible, but they will grow linuxbios footprint
> and the type of errors we have to think about. So we should be careful.

Agreed, except that if this technique works on more than one processor
going with page tables gives us a portable option.

The other solution I have thought about is gcc -fPIC -static.
Allowing all of the code to be relocateable.  When I have messed with
that it looks like it works, but the code didn't run.

Anyway for the moment I'm off to write some C code that runs out of
cache...


Eric

Reply via email to