From: Chris E. <cem...@ch...> - 2000-04-29 15:34:59
|
On Fri, 28 Apr 2000, Jeff Dike wrote: > As far as I know, there are no ongoing porting efforts. Well, there's at least one now... [things which need to be done] > You need to get uml to compile with the include/asm-um/arch > link pointing to ../asm-ppc in your case. Almost all of the asm-um > headers just #include their arch equivalents. You'll need to find > the exceptions for ppc. > Once it compiles, look at all the places that registers are > referenced. These are in close proximity to ptrace calls, so > grepping for ptrace will show you where they are. Replace those > with the ppc equivalents. Well, I've tweaked things far enough to make vmlinux, although the runnable binary doesn't link so far. There are unresolved references to things like atomic_dec, atomic_inc, and local_bh_count. I'll look into those next. > Run it and watch it work :-) Once I get it to link, I'll find out how badly I've broken it. :-) > If you do start working on this, I need to know what you're running > into so I can start thinking about how to abstract the architecture > stuff out of the main code. So, keep me updated. Here are some notes from what I've done so far... General: I had to change the SUBARCH bit in the configuration, and the odd mention of i386 (eg -U__i386__ -> -U__powerpc). The linker script in arch/um also specified the architecture. Registers: There are some places where the code has to be changed quite a lot (eg special handling for segment registers), but a lot of the time it's just things like changing "UESP" to "PT_R1" or whatever it is. I haven't yet decided whether I think having constants like "UM_STACK_REGISTER" or "UM_RETURN_REGISTER", or whether it's better to keep the code entirely separate. The pt_regs structure (the ppc one, not the um one) is quite different (unsurprisingly). I've been using that in a few places instead of an array of length 17, eg the thread_struct. I can get away with this since the PT_foo defines for register offsets are documented as working with the pt_regs structure, but this isn't ideal. I haven't put much thought into it so far. The checksum.S linked to from the arch/ppc/lib didn't compile, since some of the redirected <asm/*.h> includes broke things. For now I've copied the file and included some stuff from <asm-ppc/*.h>. old-checksum.c doesn't exist in PPC, so I removed it from the Makefile. I found a typo in one of the PPC headers (SRGV_ACCERR instead of SEGV_ACCERR). Assuming I didn't manage to insert it accidentally myself, I should submit the patch to the kernel people, I suppose. > My current thinking is that we can put the machine dependent stuff > under a generic interface like the upper kernel does now. We'll > have arch/i386, arch/ppc, etc somewhere under the arch/um layer. I think that makes sense. I'll leave that until I have things working, though... > Longer term, this may get ported to other OS's, in which case the > host OS would be the visible architecture, and the arch/* that I > just described would move under os/linux or something. How far away is that? :-) Cheers, Chris -- Chris Emerson, obsessed Cambridge juggler E-mail: cem...@ch... Web page: http://www.chiark.greenend.org.uk/~cemerson/ |