11.02.2008
Temporary halt
9.08.2008
also
8.27.2008
WANTED: PIC driver...
8.19.2008
Staying late pays...
Thanks to simple, yet great advice by Andrew Turner concerning calls to openfirmware and utilizing *OF_buf, it seems that eventually I came to the point where the kernel panics due to the lack of PIC!:
===================
atomic_subtract_16(0)... panic: no PIC detected
KDB: enter: panic
[thread pid 0 tid 100000 ]
Stopped at 0x29587c: addi r0, r0, 0x0
===================
As you can see, the KDB by itself stops at this point, no crash at last:)
All thanks to the AT and the fact that I'm studying hard for the exam (Quantum Mechanics for PhD students....)
/*decr_init()*/
Some new things came up recentrly, I've added some code from NetBSD and commented out the decr_init() in cpu_startup(). Now, during the boot I've rached subsystem 3800000 , as last time w/o decr_init(), but this time it seems it entered the newbus!
==========================================
[thread pid 0 tid 100000 ]
Breakpoint at 0x4930d8: stwu r1, r1, -0x20
db>
nexus0: registered as a time-of-day clock (resolution 1000us)
nexus0:
nexus0:
nexus0:
nexus0:
nexus0:
nexus0:
nexus0:
nexus0:
nexus0:
nexus0:
nexus0:
sc0: no video adapter found.
nexus0:
done.
ofw_bus_gen_get_name(0)... cpu_exception:
SRR0 0x01035CFC SRR1 0x00003030 MSR 0x00003030
LR 0x0103E1E4 CTR 0x0101A5F0 CR 0x44002042 XER 0x20000000
DAR 0xD0004DDE DSISR 0x42000000 Type 3
GPR[] 0x00000007 0x00559EB4 0x00000000 0x00000000 0x07C05323 0x00000005 0x0000000D 0x0058EBB8
...
============================================
And again, the old friend. I can't spot the cause of those crashes. They always look the same, with the same content of SRR0,1 and MSR. Adding some stuff from NetBSD helped, but it only took it just a few steps further. Thus it must be something wih the OF, but what? This time it's nothing about the stack, because the registers contains some crazy addresses, neither form kernel, nor from the OF stack... During some previous tests I've encountered some crashes on instructions reading/writing to SPRG0 and IBAT4, in ofw_sprg_prepare(); and in
===========
from: src/sys/powerpc/aim/ofw_machdep.c
__asm __volatile( "\t"
"sync\n\t"
"mfmsr %0\n\t"
"mtmsr %1\n\t"
"isync\n"
: "=r" (oldmsr)
: "r" (ofmsr[0])
);
============
both in openfirmware()...
8.17.2008
odd discovery
I was fighting with the OF_peer() to check if it passes the openfirmware() call, which is OF entry and after lots of tries it seems that it does. It's very different from what I thought before. After using ofw_stack() from NetBSD in OF_peer() as it was done in OF_read()/OF_write(), that function seems to be working but the crash remains.
Here's the dump:
DEBUG 2
done.
subsystem 2100000
freebsd4_sigreturn(0)...
cpu_startup() DEBUG 0
** DEBUGL OF_printf(): after OF_peer() in decr_init()
cpu_exception:
SRR0 0x004A0DF0 SRR1 0x00003030 MSR 0x00003030
LR 0x01003ED8 CTR 0x00000000 CR 0x24002044 XER 0x0
DAR 0xD0004D3C DSISR 0x42000000 Type 3
========================
What is very strange, during the trace I've encountered the call to OF_write() just after OF_peer(), like there were _two_ calls to openfirmware() insted of one. And it's the second one that crashes... Now, what I don't get is where from this second call come ? There's no printf() around OF_peer()...:
========================
from: sys/dev/ofw/openfirm.c
phandle_t
OF_peer(phandle_t node)
{
static struct {
cell_t name;
cell_t nargs;
cell_t nreturns;
cell_t node;
cell_t next; }
args = {
(cell_t)"peer",
1,
1,
};
ofw_stack();
args.node = node;
if (openfirmware(&args) == -1)
return (-1);
return (args.next);
}
=========================