I am trying to write a driver for a pci device on Solaris 7 but it does
not get loaded by add_drv:
# add_drv foo
drvconfig: Driver (foo) failed to attach
Warning: Driver (foo) successfully added to system but failed to attach
I have studied some previous postings on this subject and I am now
convinced that I am running with a 64-bit kernel and that that is why it
didn't work at first. So, just to get _something_ working, I compiled
the sample driver "pio", with the compiler option -xarch=v9. This sample
driver is supposed to be ready for 64 bit. I then renamed it "foo" and
put it in /kernel/drv/sparcv9, and tried add_drv again:
# add_drv foo
/kernel/drv//sparcv9/foo: undefined symbol
/kernel/drv//sparcv9/foo: undefined symbol
WARNING: mod_load: cannot load module 'foo'
drvconfig: Driver (foo) failed to attach
Warning: Driver (foo) successfully added to system but failed to attach
It seems to complain about two undefined symbols, but which ones? If I
refer to a fictional function, such as "foobar", in the source code, I
get the following message:
# add_drv foo
/kernel/drv//sparcv9/foo: undefined symbol
/kernel/drv//sparcv9/foo: undefined symbol
/kernel/drv//sparcv9/foo: undefined symbol foobar
WARNING: mod_load: cannot load module 'foo'
drvconfig: Driver (foo) failed to attach
Warning: Driver (foo) successfully added to system but failed to attach
It seems to me that the missing symbols are nameless and I don't know
what to do to avoid references to them. I compiled the sample driver
"ae" in the same fashion with -xarch=v9, and the same thing happened. To
look at the symbol table I ran the command:
# ld -D symbols,detail -r -o sparc/foo sparc/foo.o
I get a very long list of symbols, but symbols 31 and 32 look
suspicious:
debug: symbol[30]=ddi_soft_state_fini (global); adding
debug: entered 0x000000000000 0x000000000000 FUNC GLOB 0 UNDEF REF_REL_NEED
debug: symbol[31]= (global); adding
debug: entered REG_G2 0x000000000000 REGI GLOB 0 UNDEF REF_REL_NEED
debug: symbol[32]= (global); adding
debug: entered REG_G3 0x000000000000 REGI GLOB 0 UNDEF REF_REL_NEED
There seems to bee two global undefined symbols which are needed, but
without a name. What do I do?
--
Roar A. Lauritzsen, M.Sc. Tel: +47 23 23 84 26
Senior Systems Engineer Fax: +47 23 23 84 01
Fast Search & Transfer ASA Mobile: +47 91 16 21 10
P.O.Box 1677 Vika, NO-0120 Oslo, Norway Home: http://www.fast.no