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

Ignatios Souvatzis wrote:

On 17.02.10 10:28:34 you wrote:

> [..vmstat -m..]
> That's a serious bug, because *any* user of kvm could do the same
> by careful selection of access patterns. If you can find out where
> the crash happens, we could maybe extract a test program that
> doesn't rely on a wrongly-linked kernel to expose the bug, for
> testing other ppc architectures.

I could not easily reproduce this crash, but something which is similarly
bad happens: when I have a /netbsd kernel with VA=0 and run "vmstat -m", I
get the following output:

Memory statistics by bucket size
    Size   In Use   Free   Requests   HighWater   Couldfree
      16        0     -1         -1       -1          -1
      32        0     -1         -1       -1          -1
  524288        0     -1         -1       -1          -1

Memory usage type by bucket size
    Size  Type(s)

...and then the process hangs.

I made the same experiment with NetBSD/ofppc. Booting a valid kernel but
using a VA=0 kernel for vmstat, using the -N option. The "Memory statistics
by bucket size" looks the same, but then the output continues, printing
lots of garbabe characters.

I guess you should be able to reproduce that with any port when using -N and
feeding a bad kernel.

>> I guess the relocation tool should work under NetBSD, not AmigaOS (or
>> both?).
> Both.

Ok. I just finished the tool and it works fine. The source can be found at
for anybody interested.

I have also uploaded the latest gobsdppc which relocates the kernel while

>> Maybe we could even check the kernel automatically during multi-
>> user boot and relocate it, when its VMA doesn't match the loaded
>> kernel?
> I don't like that much. It requires a writable root file system
> and a writeable kernel (think file flags!). 
> Such stuff should only be done by people who are aware of it. And
> not to their working copy of the kernel directly.

Ok. Agreed.

> Btw - what about a bootblock? I suspect, now that we have a two-stage
> loader for Amiga, the first stage could be the same as the m68k first
> stage, and only the 2nd stage would know about PPC.

Yes, that would be nice.

The bootblock loader is definitely the way to go. My modified gobsd is just
an intermediate solution to get the kernels loaded now.

But I don't think I will look at the bootblock code as long as the kernel is
not stable enough. There still seem to be DMA problems with sbic(4) and
cbiiisc(4) which corrupt my filesystem.

> [..BPPC RAM..]
> oh.... sort of make sense. We should document that somewhere in
> the source tree, to avoid mailing list adventure games by future
> amiga(|ppc) archeologists.

I will do that.

Frank Wille

Home | Main Index | Thread Index | Old Index