Get_module / put_module linker undefined reference

Hi, i’m going to write a driver for my d-link dfe-690txd pcmcia ethernet card (it is based on a realtek 8139 chip).
I’ve written a simple program in C that scan the pci list and return a list of vendor id and device id and (if found) the irq of the d-link card.
However, when compiling the program gcc output the following:

/tmp/ccilfp64.o: In function `main':
/tmp/ccilfp64.o(.text+0x2a): undefined reference to `get_module'
/tmp/ccilfp64.o(.text+0x2a): undefined reference to `put_module'
collect2: ld returned 1 exit status

I’ve tried to compile this code with a makefile, then manually with gcc, also using -lroot and/or -ldevice. Results doesn’t change.
If i compile it with the “kernel_intel” as an object passed to gcc (or as a library), the compiler error disappear, but i’m unable to execute the produced output file.
(I’ve also checked if this could be a permission problem, but the execute bit are all set).

Could you give me some suggestion on how to resolve this (or where i can read something in order to resolve the problem myself)?

PS: Sorry for my bad english.

Greetings,
Domenico.

medevil wrote:
Hi, i'm going to write a driver for my d-link dfe-690txd pcmcia ethernet card (it is based on a realtek 8139 chip). I've written a simple program in C that scan the pci list and return a list of vendor id and device id and (if found) the irq of the d-link card. However, when compiling the program gcc output the following:
/tmp/ccilfp64.o: In function `main':
/tmp/ccilfp64.o(.text+0x2a): undefined reference to `get_module'
/tmp/ccilfp64.o(.text+0x2a): undefined reference to `put_module'
collect2: ld returned 1 exit status

I’ve tried to compile this code with a makefile, then manually with gcc, also using -lroot and/or -ldevice. Results doesn’t change.
If i compile it with the “kernel_intel” as an object passed to gcc (or as a library), the compiler error disappear, but i’m unable to execute the produced output file.
(I’ve also checked if this could be a permission problem, but the execute bit are all set).

Could you give me some suggestion on how to resolve this (or where i can read something in order to resolve the problem myself)?

PS: Sorry for my bad english.

Greetings,
Domenico.

Right now this forum is probably not the best place to post "driver development" questions :slight_smile:

If you have the Haiku source already, I would highly suggest you look through the Haiku network drivers, and use them as a starting guide (you will want to use jam and the Haiku build system):

http://www.haiku-os.org/wiki/index.php?title=Getting_Haiku

there is an rtl8139 driver already in the repo - I don’t know how complex a PC-card driver is, but maybe you can add your informatino to the existing driver. I’m not sure Haiku has complete PCMCIA bus support yet either.

http://svn.berlios.de/viewcvs/haiku/haiku/trunk/src/add-ons/kernel/drivers/network/

Finally, it would be much better for you to ask driver development questions on the mailing list (I would recommend the network team list for now):

http://www.freelists.org/list/openbeosnetteam