Subject: Do LKMs work *at*all* on powerpc platforms?
To: None <port-macppc@netbsd.org>
From: gabriel rosenkoetter <gr@eclipsed.net>
List: port-macppc
Date: 08/01/2000 01:47:43
I'm just getting this when I try to load one of the sample LKMs out of
/usr/share/lkm (I'm using misc in this example, but it's the same for
all three... well, haven't tried vfs, because I've already got kernfs
in my kernel on this machine; I'm rebuilding it now to try, but
without much hope):

achemar:misc/module# make load                                              [6]
modload -o miscmod -emiscmod combined.o
combined.o: In function `miscmod_handle':
combined.o(.text+0x4c): relocation truncated to fit: R_PPC_REL24 lkmexists
combined.o(.text+0x100): relocation truncated to fit: R_PPC_REL24 memcpy
combined.o(.text+0x12c): relocation truncated to fit: R_PPC_REL24 memcpy
combined.o(.text+0x148): relocation truncated to fit: R_PPC_REL24 printf
combined.o(.text+0x158): relocation truncated to fit: R_PPC_REL24 printf
combined.o(.text+0x168): relocation truncated to fit: R_PPC_REL24 printf
combined.o(.text+0x178): relocation truncated to fit: R_PPC_REL24 printf
combined.o(.text+0x1b4): relocation truncated to fit: R_PPC_REL24 memcpy
combined.o: In function `miscmod':
combined.o(.text+0x2cc): relocation truncated to fit: R_PPC_REL24 lkm_nofunc
combined.o(.text+0x2fc): relocation truncated to fit: R_PPC_REL24 lkmdispatch
combined.o: In function `misccall':
combined.o(.text+0x350): relocation truncated to fit: R_PPC_REL24 printf
combined.o(.text+0x360): relocation truncated to fit: R_PPC_REL24 printf
combined.o(.text+0x370): relocation truncated to fit: R_PPC_REL24 printf
modload: can't link `combined.o' creating `miscmod' bound to 0xe920d000
*** Error code 1

Stop.

Is NetBSD's LKM framework simply broken for ppcs? If so, that sucks.
What would it take to fix it? (I'm offering time, not money.)

Is the problem just what this lkm is trying to do (use a kernel
printf... if so, what about the memcopy?), or is it more profound (the
lkm libraries are somehow using assembler codes that don't jive with
powerpc)?

Yes, I'm running with options INSECURE, yes I tried in single-user
mode. (The errors for that are different and earlier anyway; the
module can't even reserve memory.) This same module loads perfectly on
my i386 laptop. Haven't tried on the sparcs I've got sitting around
here, but I could.

My first fear was that LKM was stupidly i386/alpha-specific, but that
can't be true considering m68k's iwm driver can function as an LKM...

Is this send-pr-able? I searched the PR db and on mail-index without
finding anything related.

Surely I'm not the first to try to use an LKM on a powerpc machine
(though I can vaguely conceive that I'm the first on macppc, even
that's a stretch... kernel devel had to happen *somehow*).

I guess I can do my work the old-fashioned way (straight in the kernel
source, recompiling, reinstalling, rebooting), but that's so
blunt-edged it makes me cringe.

       ~ g r @ eclipsed.net

PS, please keep at least my email address and preferably port-macppc
included; I'm not on port-powerpc. Thanks.