Ethernet driver module compilation (8139too)
Hello,
My Linux 2.4.18 machine has 2 ethernet interfaces: eepro100 and 8139too.
I need to put a minur changes (printk messages) into those drivers, which are loaded as kernel modules .
I first changed the eepro then compiled it seperatly (with _DMODULE, -D__KERNEL and the correct path into /lib/modules/.....) and everything worked well (was able to see my printing through dmesg).
When I tried to change 8139too, it did not work -- not because of the code change -- rather , I had some
problems in compiling this module.
When i rebooted the machine the interfaces wer not up, and when I did lsmod 8139too was not there.
I then tried to manually install it (insmod) and was promp with unresolved external. I found out that
those unresolved belong to mii.o which was not loaded during the boot process.
When I changed to the original 8139too.o (luckily I have saved it ...) the machine is ok, mii.o
is loadede , and also 8139too.
I am sure the problem is in the way I compile this module , but i don't know what is missing ?
I have browsed many Makefiles and could not tell what flags make the 8139too.o tell the boot that
it needs mii.o . The modules.dep file create during boot tme shows that 8139too depends on mii.o,
but from some reason mii.o is ot loaded.
Maybe I can not compile kernel modules seperatly, i.e., kernel modules that are loaded during bot time ?
Obviosly i can do this procee manually: insmod mii, then 8139 and finally bring the interface up.
But, i really need to know what went wrong there
Any help will be much appreciated
Chava Leviatan
Chava,
Quoted 4 lines · Chava Leviatan
I then tried to manually install it (insmod) and was promp with unresolved external. I found out that
those unresolved belong to mii.o which was not loaded during the boot process.
Did you reboot the machine? Did you do depmod -ae?
Which symbols? What did the error message say exactly... What is the output of depmod -ae with the module installed?
--brian
Hi Brian,
I did reboot the machine, and saw that during boot time there is a call to depmod. I did depmod -ae as you've requested, and here are the results:
[root@NettGain root]# depmod -ae >chav.dat
depmod: /lib/modules/2.4.18-3/kernel/drivers/net/makefile.8139 is not an ELF file depmod: /lib/modules/2.4.18-3/kernel/drivers/net/makefile.eepro is not an ELF file depmod: *** Unresolved symbols in /lib/modules/2.4.18-3/kernel/drivers/net/8139too.o depmod: __netdev_watchdog_up depmod: flush_signals depmod: eth_type_trans depmod: mii_ethtool_sset depmod: __kfree_skb depmod: alloc_skb depmod: pci_register_driver depmod: mii_link_ok depmod: pci_free_consistent depmod: pci_enable_device depmod: pci_read_config_byte depmod: alloc_etherdev depmod: mii_ethtool_gset depmod: reparent_to_init depmod: cpu_raise_softirq depmod: free_irq depmod: unregister_netdev depmod: kill_proc depmod: iounmap depmod: pci_alloc_consistent depmod: interruptible_sleep_on_timeout depmod: __ioremap depmod: pci_read_config_word depmod: skb_copy_and_csum_dev depmod: register_netdev depmod: kfree depmod: pci_release_regions depmod: wait_for_completion depmod: request_irq depmod: mii_nway_restart depmod: netif_rx depmod: pci_unregister_driver depmod: skb_over_panic depmod: pci_set_master depmod: do_BUG depmod: rtnl_unlock depmod: pci_write_config_word depmod: daemonize depmod: jiffies depmod: softnet_data depmod: rtnl_lock depmod: printk depmod: complete_and_exit depmod: kernel_thread depmod: __const_udelay depmod: pci_request_regions
Please note that if I manually insmod mii , then the insmod 8139too passes w/o problems .
Chava
----- Original Message ----- From: "Brian F. G. Bidulock" <[email protected]>
To: "Chava Leviatan" <[email protected]>
Cc: <[email protected]>
Sent: Monday, May 29, 2006 10:13 AM
Subject: Re: Ethernet driver module compilation (8139too)
Quoted 15 lines
Chava,
Quoted 4 lines · Chava Leviatan
I then tried to manually install it (insmod) and was promp with unresolved external. I found out that
those unresolved belong to mii.o which was not loaded during the boot process.Did you reboot the machine? Did you do depmod -ae?
Which symbols? What did the error message say exactly... What is the output of depmod -ae with the module installed?
--brian
Chava,
Quoted 14 lines · Chava Leviatan
Hi Brian,
I did reboot the machine, and saw that during boot time there is a call to depmod.
I did depmod -ae as you've requested, and here are the results:
[root@NettGain root]# depmod -ae >chav.dat
depmod:/lib/modules/2.4.18-3/kernel/drivers/net/makefile.8139is not an ELF file
depmod:/lib/modules/2.4.18-3/kernel/drivers/net/makefile.eeprois not an ELF file
depmod: *** Unresolved symbols in/lib/modules/2.4.18-3/kernel/drivers/net/8139too.odepmod: __netdev_watchdog_up depmod: flush_signals
...
...
Quoted 1 line
depmod:
mii_ethtool_gset
...
...
Quoted 4 lines
Please note that if I manually insmod mii , then the insmod 8139too passes w/o problems .
I don't see how it could with all those depmod errors. Try doing this:
grep uregister_netdev /proc/ksyms
If you get something like this:
c0194ef0 unregister_netdev_Rc45f34ea c01d5270 unregister_netdevice_notifier_Rfe769456 c01d6ca0 unregister_netdevice_R52c1d940
then your kernel has versioned symbols.
In which case, you are probably missing
-DMODVERSIONS -include linux/modversions.h
from your compile statement.
Hope that helps.
--brian
Hi Brian ,
Thanks alot ! This exactly the line I was missing at my makefile ! Now it works ...
Chava
----- Original Message ----- From: "Brian F. G. Bidulock" <[email protected]>
To: "Chava Leviatan" <[email protected]>
Cc: <[email protected]>
Sent: Monday, May 29, 2006 11:53 AM
Subject: Re: Ethernet driver module compilation (8139too)
Quoted 56 lines
Chava,
Quoted 14 lines · Chava Leviatan
Hi Brian,
I did reboot the machine, and saw that during boot time there is a call to depmod.
I did depmod -ae as you've requested, and here are the results:
[root@NettGain root]# depmod -ae >chav.dat
depmod:/lib/modules/2.4.18-3/kernel/drivers/net/makefile.8139is not an ELF file
depmod:/lib/modules/2.4.18-3/kernel/drivers/net/makefile.eeprois not an ELF file
depmod: *** Unresolved symbols in/lib/modules/2.4.18-3/kernel/drivers/net/8139too.odepmod: __netdev_watchdog_up depmod: flush_signals...
...Quoted 1 line
depmod:
mii_ethtool_gset...
...Quoted 4 lines
Please note that if I manually insmod mii , then the insmod 8139too passes w/o problems .
I don't see how it could with all those depmod errors. Try doing this:
grep
uregister_netdev/proc/ksymsIf you get something like this:
c0194ef0unregister_netdev_Rc45f34ea
c01d5270unregister_netdevice_notifier_Rfe769456
c01d6ca0unregister_netdevice_R52c1d940then your kernel has versioned symbols.
In which case, you are probably missing
-DMODVERSIONS -include
linux/modversions.hfrom your compile statement.
Hope that helps.
--brian
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Quoted 2 lines · Chava Leviatan
Thanks alot ! This exactly the line I was missing at my makefile ! Now it works ...
That should be done by the kernel makefile. Your real problem seems to be that you were attempting to use your own makefile instead of the kernel's.
Signature · 1 line
dwmw2
test
test