FreeBSD on an Efika
Peter Grehan
grehan at freebsd.org
Thu Dec 21 20:29:37 PST 2006
Hi Andrew,
>> I'll have a look at this today. Debugging could be difficult. When
>>you get the crash, is there a panic backtrace ? The SRR* registers
>>should be printed if that is the case.
>
> I get no output on either the screen or the serial line. After about
> 30s the computer reboots. It prints around 80 chars of a mixture of
> ASCII and binary and enters SmartFirmware (Open Firmware implementation)
Alright, no clues there :(
I went through the TLB data-load miss exception handler and it looks
fine. Once upon a time there was a bdneq macro in locore.S :)
Here's my suggested strategy:
- stick with the msgbuf-removed printf so you can get console output.
- write your favourite 0xdeadbeef-style pattern into the first word of
the physical address of the message buffer.
- read it back through the virtual address and verify that it is this
pattern.
- write a different pattern to the phys address and verify it again
thorugh the virt address.
If it hangs on the second read as before, then it's time to try
something different:
- create an exception handler that is identical to the existing
trapcode asm, but with 3 additional instructions prepended to clear the
GPR0-3 shadowing
mfmsr %r0
xoris %r0,%r0,PSL_TGPR at h
mtmsr %r0
/* fall through to trapcode */
- copy this to the TLB miss exception vectors. On a trap, you will
now end up in powerpc/trap.c:trap(), and can put in code to catch the
TLB miss vectors. At this point, it's worth dumping the DCMP, DMISS,
HASH1 and HASH2 spr's using the C-callable mfspr() routine. You can then
try implementing the TLB load routine in C, and verify that it does what
you think.
If this eventually works (and it will only work until the loading of
the stack in the low-level trapcode itself has a TLB miss), it's then
time to return to the ASM code.
One other way to verify that the ASM code did the right thing is to
examine the PTE in the pteg table and see if it's R bit was set: the ASM
code for the data-miss routine does this.
later,
Peter.
More information about the freebsd-ppc
mailing list