|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: marco (slash
arbornet.org)Date: Tue Feb 05 2002 - 22:32:40 CST
I am writing (at least trying to!) a pseudo device using a MISC LKM on
oBSD 3.0. I was using an online article as the sample code and it kept
crashing my kernel so I decided to use the supplied code which lives in
/usr/share/lkm/misc/module. This had the same effect as the online
article one. At this point I figured it was me and I started messing
around a little more. What I get out of my output is that there is a new
method of doing a LKM_E_LOAD however I have not found any docs on this.
I am about to dive into the kernel source to figure this out but if
someone ran into this before please send me a pointer.
Maybe it is also an idea to modify the code in /usr/share/lkm/misc in
future releases to reflect this.
I used the supplied code in /usr/share/lkm/misc/module as an example.
screen output:
[root
corona module]# make
cc -O2 -D_KERNEL -I/sys -c miscmod.c
cc -O2 -D_KERNEL -I/sys -c misccall.c
ld -r -o combined.o miscmod.o misccall.o
[root
corona module]# make load
modload -o miscmod -emiscmod combined.o
modload: module failed to load using new version; trying old version:
Feb 5 22:11:26 corona /bsd:
Invalid argument
Feb 5 22:11:26 corona /bsd: Sample Loaded miscellaneous module (system
call)
Feb 5 22:11:27 corona /bsd: Copyright (c) 1993
Feb 5 22:11:27 corona /bsd: Terrence R. Lambert
Feb 5 22:11:27 corona /bsd: All rights reserved
Feb 5 22:11:27 corona /bsd: uvm_fault(0xf78dcf18, 0x0, 0, 1) -> e
Trace in ddb:
uvm_fault(0xf78dcf18, 0x0, 0, 1) -> e
kernel: page fault trap, code=0
_lkmunreserve (...) at _lkmunreserve+0x1f
_lkmioctl (...) at _lkmioctl+0x433
dmesg
OpenBSD 3.0-current (GENERIC) #7: Sun Dec 2 19:24:16 CST 2001
root
corona:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel Pentium III (Coppermine) ("GenuineIntel" 686-class) 647 MHz
cpu0:
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,SYS,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,F
XSR,SIMD
real mem = 402087936 (392664K)
avail mem = 366768128 (358172K)
using 4933 buffers containing 20205568 bytes (19732K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+(00) BIOS, date 07/26/01, BIOS32 rev. 0
0xffe90
apm0 at bios0: Power Management spec V1.2
apm0: battery life expectancy 100%
apm0: AC on, battery charge high, estimated 5:09 hours
pcibios0 at bios0: rev. 2.1
0xf0000/0x10000
pcibios0: PCI IRQ Routing Table rev. 1.0
0xfbd20/128 (6 entries)
pcibios0: PCI Interrupt Router at 000:07:0 ("Intel 82371 PCI-ISA and
IDE" rev 0x00)
pcibios0: PCI bus #3 is the last bus
bios0: ROM list: 0xc0000/0x10000
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "Intel 82443BX PCI-AGP" rev 0x03
ppb0 at pci0 dev 1 function 0 "Intel 82443BX AGP" rev 0x03
pci1 at ppb0 bus 1
vga1 at pci1 dev 0 function 0 "ATI Mobility 1" rev 0x64
wsdisplay0 at vga1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
cbb0 at pci0 dev 3 function 0 "Texas Instruments PCI1225 PCI-CardBus"
rev 0x01: irq 11
cbb1 at pci0 dev 3 function 1 "Texas Instruments PCI1225 PCI-CardBus"
rev 0x01: irq 11
pcib0 at pci0 dev 7 function 0 "Intel 82371AB PIIX4 ISA" rev 0x02
pciide0 at pci0 dev 7 function 1 "Intel 82371AB IDE" rev 0x01: DMA,
channel 0 wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: <IC25N030ATDA04-0>
wd0: 16-sector PIO, LBA, 28615MB, 16383 cyl, 16 head, 63 sec, 58605120
sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
pciide0: channel 1 ignored (disabled)
uhci0 at pci0 dev 7 function 2 "Intel 82371AB USB" rev 0x01: irq 11
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: vendor 0x0000 UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
"Intel 82371AB Power Mgmt" rev 0x03 at pci0 dev 7 function 3 not
configured
"ESS Maestro 3" rev 0x10 at pci0 dev 8 function 0 not configured
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 2 device 0 cacheline 0x8, lattimer 0x20
pcmcia0 at cardslot0
cardslot1 at cbb1 slot 1 flags 0
cardbus1 at cardslot1: bus 3 device 0 cacheline 0x8, lattimer 0x20
pcmcia1 at cardslot1
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
sysbeep0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
npx0 at isa0 port 0xf0/16: using exception 16
pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
biomask 4840 netmask 4840 ttymask 58c2
pctr: 686-class user-level performance counters enabled
mtrr: Pentium Pro MTRR support
dkcsum: wd0 matched BIOS disk 80
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302
an0 at pcmcia1 function 0 "Cisco Systems, 340 Series Wireless LAN
Adapter": address 00:40:96:44:e1:3b
Regards,
/marco
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]