Port-powerpc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Relocating an amigappc kernel by the boot loader



On Tue, Feb 16, 2010 at 11:19:21AM +0100, Frank Wille wrote:
> ... does *not* work! :(

> First it seemed to work fine, but when using commands like "vmstat -m"
> I'm getting trouble. Programs which are accessing the kernel's nlists
> through the kvm(3) interface fail miserably, because the file /netbsd is
> not relocated to the same address space as the current kernel in RAM.

I don't think this is a really bad problem. After all, some of
NetBSD's install media don't have any valid kernel on / at all;
same for some netboot setups. Only a few commands fail; normal use
and setup (including networking etc.) is proven to work, because
install works that way.

Now, for the added comfort - can we do the following?

1. make your kernel relocate for it's compile-time starting address;
this is just a constant to add (and it will be relocated for you, too),
so you can execute 2. repeatedly.

2. provide a tool (hm, would a wrapper around objcopy be enough?) to 
relocate the kernel to the address actually used.

(Actually - if BlizzardPPC had a fixed address, I wouldn't bother with
2., but provide fora method to build the kernel for a starting address as
a kernel option. But as I understand there are several possibilities
depending on memory configuration?)

> Other options:
> 
> - Turning on the MMU early to translate all addresses doesn't work either,
>   as exception handling and pmap may disable the MMU.

It has been suggested to me to "fix the pmap so nothing bad happens 
then." I don't remember whether we'd need additional cache/tlb flushing,
in which case this woul be too expensive...

Regards,
        -is


Home | Main Index | Thread Index | Old Index