Sample driver fails to attach

Sample driver fails to attach

Post by Roar Lauritzse » Sat, 19 Jun 1999 04:00:00



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

 
 
 

Sample driver fails to attach

Post by Casper H.S. Dik - Network Security Engine » Wed, 23 Jun 1999 04:00:00


[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]


>I am trying to write a driver for a pci device on Solaris 7 but it does
>not get loaded by add_drv:
>/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
>There seems to bee two global undefined symbols which are needed, but
>without a name. What do I do?

You need to add the folloing compile time option:

        -xregs=no%appl

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

Sample driver fails to attach

Post by Roar Lauritzse » Thu, 24 Jun 1999 04:00:00



Quote:> You need to add the folloing compile time option:

>         -xregs=no%appl

Man, am I glad to have you guys out there. You know, these things are
totally undocumented to my knowledge (which is very small on this subject).
To summarize; If you want to compile a driver for a 64-bit Solaris 7
kernel, you need to use the following compiler options:

    -xarch=v9 -xregs=no%appl

Otherwise, when you run add_drv, you will get the message:

    drvconfig: Driver failed to attach

--
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

 
 
 

Sample driver fails to attach

Post by ASADA Kazuhi » Fri, 25 Jun 1999 04:00:00



> I compiled the sample driver "pio", with the compiler option
> -xarch=v9. This sample driver is supposed to be ready for 64 bit.

 If you compile plain pio sample code, please see README.

 SUNWddk/src/drivers/pio/README:

  DRIVER NAME:
        pio -- sample programmed I/O driver

 CAVEATS AND CONSTRAINTS:
        This sample code is written for hypothetical hardware and will not
        run on any platform.                                      ~~~~~~~~
        ~~~~~~~~~~~~~~~~~~~

 pio sample code is written for fiction device. If you want to attach
this driver, should be modify for real hardware.
--
ASADA Kazuhisa / TRUST SYSTEM INC., Osaka, Japan

 
 
 

1. Sample driver failing to attach.

Hi,

I think I saw a question similar to this one on this list before but I've
gone through the lot to no avail.

I've built a copy of the ramdisk driver (under solaris 7) that comes with
the sample drivers package from sun.  When i try to us add_drv ramdisk on
the ramdisk file (which has been copied to usr/kernek/drv) i get the
following error.

drvconfig: Driver (ramdisk) failed to attach
Warning: Driver (ramdisk) successfully added to system but failed to attach.

Has anyone any idea why this is so?

Thanks,
Diarmuid

2. how to get rid of automount

3. My first device driver, problems, devfsadm: driver failed to attach:

4. Is there support for integrated sound and video?

5. "driver failed to attach" error in Solaris 8, ppp-2.4.1

6. 1 gig HD HELP! Is there a HOWTO??

7. devfsadm: driver failed to attach

8. Zip + ppa = scsi boot timeout??

9. SOLVED: DGE-528T with RealTek 8169S driver failed to attach

10. devfsadm: driver failed to attach: nei

11. PPP-2.4.1 Solaris8 Driver Failed to Attach/ppp question

12. FreePPP devfsadm: driver failed to attach: ppp

13. OSS-driver failed to attach