|
From: Brian T. <tea...@ya...> - 2005-03-20 18:02:22
|
I want to ask the help of anyone who has worked, or is
working, on the
low-level kernel stuff for the NS1000, or powerpc
stuff in general.
For the last month or so, I've been trying to port the
NS1000 changes
into the 2.6 kernel. I ported everything back to 4.15
so I could switch
over to the 2.5 branch, and from there I applied all
the vanilla kernel
patches up to 2.6.4, fixing compile errors and other
stuff along the
way. The NS will at least recognize the images as
valid, but then the
kernel itself fails in various ways.
The last version I got to work properly was 2.5.10.
Somewhere between
there and 2.5.30, the boot sequence stopped working.
I've put in some
serial debugging messages similar to the what the
networkstation patch
does to the boot code, and so I've got it narrowed
down to where the
problem occurs.
In 2.5.30, the bootloader runs, accepts the command
line, unzips the
kernel image to 0x00000000, and passes control to
_start in
arch/ppc/kernel/head.S. It runs through mmu_off,
flush_tlbs, etc. . .,
up to turn_on_mmu. At this point, it sets the bits to
enable memory
mapping, and jumps to start_here via an rfi
instruction. That is where
it fails.
I have verified that the kernel is running at physical
location
0x00000000, not 0xc0000000. I have verfied that the
BAT registers are
0x00000002 (lower) and 0xc0001ffe (upper), which means
the mmu should
map calls in the 0xc0000000 range down to 0x00000000.
I checked the
value of the msr register just before the rfi, and it
does in fact have
MSR_DR and MSR_IR turned on. I've also tried this:
mfmsr r0
ori r0,r0,MSR_DR|MSR_IR
mtmsr r0
bl start_here
but that seems to die immediately after the mtmsr.
If I don't change the msr, and just do a plain old bl
to start_here, it
does get there, although it dies shortly after that
since by then it
needs the mmu.
I've tried all kinds of other stuff, and I just don't
get it. Comparing
the disassembled kernels using objdump -d, I can see
that these sections
of code are byte-for-byte identical (except for a
slightly different
address of start_here) to 2.4.x and 2.5.10, both of
which work. I don't
see what's going on here; it seems like there must be
something going on
in the processor that my documentation doesn't show.
I don't have a
JTAG debugger and I haven't had any luck getting the
kgdb kernel
debugger to work.
I'm just doing this for fun, so there's no urgent need
here. I'm going
to keep plugging away at this, and if I ever actually
get a 2.6 kernel
going, I'll put a patch up here. Until then, if
anyone has any advise,
I'd appreciate it.
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
|