Subject: LKMs not working...
To: None <netbsd-help@NetBSD.ORG>
From: Donald J. Maddox <root@rhiannon>
List: port-amiga
Date: 02/27/1996 00:38:48
    I haven't tried to use any LKMs in quite a while (since before the 
1.1 upgrade), but I decided to play around the Amiga audio LKM yesterday, 
and, in the process, discovered that LKMs simply don't work on my machine 
anymore, and I cannot figure out what the problem is...  Any attempt to 
load an LKM with modload fails with 'operation not permitted'.

    This doesn't just apply to the audio LKM hack...  I also tried the 
example LKMs in /usr/share/lkm with the same results.  I completely 
reinstalled the 1.1 distribution, booted the 1.1 install kernel, and 
STILL got the same results.  What am I doing wrong?

BTW...  options LKM *is* defined in my kernel (and in the INSTALL kernel, I 
believe).

rhiannon# ls -l /dev/lkm
crw-r----- 1 root kmem 24, 0 Feb 26 20:45 /dev/lkm

rhiannon# ls -l /sbin/modload
-r-xr-xr-x 1 bin bin 40960 Nov 24 14:52 /sbin/modload

rhiannon# ktrace -d modload -o lkm_audio -e lkm_audio audio.o
modload: can't reserve memory: Operation not permitted

rhiannon# kdump | more

   288 ktrace   RET   ktrace 0
   288 ktrace   CALL  __sysctl(0xdfff3bc,0x2,0xb116,0xdfff3c4,0,0)
   288 ktrace   RET   __sysctl 4
   288 ktrace   CALL  break(0xb150)
   288 ktrace   RET   break 0
   288 ktrace   CALL  break(0xbffc)
   288 ktrace   RET   break 0
   288 ktrace   CALL  break(0xdffc)
   288 ktrace   RET   break 0
   288 ktrace   CALL  execve(0xdfff434,0xdfff89c,0xdfff8b8)
   288 ktrace   NAMI  "/sbin/modload"
   288 modload  EMUL  "netbsd"
   288 modload  RET   execve 0
   288 modload  CALL  open(0x226f,0x2,0)
   288 modload  NAMI  "/dev/lkm"
   288 modload  RET   open 3
   288 modload  CALL  sigprocmask(0x1,0x80000)
   288 modload  RET   sigprocmask 0
   288 modload  CALL  vfork
   288 modload  RET   vfork 289/0x121
   288 modload  CALL  sigaction(0x2,0xdfff104,0xdfff0f8)
   288 modload  RET   sigaction 0
   288 modload  CALL  sigaction(0x3,0xdfff0fc,0xdfff0f0)
   288 modload  RET   sigaction 0
   288 modload  CALL  wait4(0x121,0xdfff134,0,0)
   288 modload  RET   wait4 289/0x121
   288 modload  CALL  sigprocmask(0x3,0)
   288 modload  RET   sigprocmask 524288/0x80000
   288 modload  CALL  sigaction(0x2,0xdfff104,0xdfff0f8)
   288 modload  RET   sigaction 0
   288 modload  CALL  sigaction(0x3,0xdfff0fc,0xdfff0f0)
   288 modload  RET   sigaction 0
   288 modload  CALL  open(0xdfff947,0,0)
   288 modload  NAMI  "lkm_audio"
   288 modload  RET   open 4
   288 modload  CALL  read(0x4,0xdfff80c,0x20)
   288 modload  GIO   fd 4 read 32 bytes
       "\0\M^G\^A\v\0\0 \0\0\0 \0\0\0\0\0\0\0\M-#\M-$\0\0\^N\M-r\0\0\0\0\0\0\0\
	\0"
   288 modload  RET   read 32/0x20
   288 modload  CALL  close(0x4)
   288 modload  RET   close 0
   288 modload  CALL  ioctl(0x3,0xc0104b00 ,0xb14c)
   288 modload  RET   ioctl -1 errno 1 Operation not permitted
   288 modload  CALL  write(0x2,0xdffee98,0x9)
   288 modload  GIO   fd 2 wrote 9 bytes
       "modload: "
   288 modload  RET   write 9
   288 modload  CALL  write(0x2,0xdffeeac,0x14)
   288 modload  GIO   fd 2 wrote 20 bytes
       "can't reserve memory"
   288 modload  RET   write 20/0x14
   288 modload  CALL  write(0x2,0xdffee90,0x2)
   288 modload  GIO   fd 2 wrote 2 bytes
     .
     .
     .

<Rest deleted for the sake of brevity>