Re: getting a 10.4-updated ethernet driver to kextload successfully
Re: getting a 10.4-updated ethernet driver to kextload successfully
- Subject: Re: getting a 10.4-updated ethernet driver to kextload successfully
- From: Dean Reece <email@hidden>
- Date: Tue, 27 Sep 2005 14:54:15 -0700
It looks like you need to add "com.apple.kpi.iokit" "8.0.0".
The kext linking rules change when you use one of the "kpi"
libraries. The "old" rules were that you got all the symbols for the
things you explicitly listed in OSBundleLibraries PLUS you got all
the symbols from the libraries that those kexts depend on, etc...
That is, linking against a library gave you all everything in that
library's dependency graph. This was handy, but caused some
interesting compatibility problems. In particular, when a library
changed what it depended on, that could break kexts that were
dependent on inheriting those symbols.
With Tiger, we introduced the 8.0 kpi interfaces. Any kext linking
against a kpi set must be new (built on or after Tiger), and
therefore doesn't have any binary compatibility requirements prior to
Tiger. The presence of such a dependency switches over to the "new"
linking rule, which is you only get the symbols for the libraries
that you explicitly list. That means you have to explicitly include
IOKit now, which you were getting for free before because the
IONetworkingFamily pulled it in.
Make sense?
- Dean
On Sep 27, 2005, at 13:30, Michael Dautermann wrote:
Hi all,
I've stepped from the relatively sane & straightforward life of
application development into the wacky world of driver coding.
I have an old XCode project that built a virtual Ethernet driver.
I updated it for the new NKE internals (mbuf accessors, etc.), and
it compiled fine. When I try to kextload it though, it fails with
these missing symbols:
:; kextload -t Belcarra.USBLAN_netpart.kext
kextload: extension Belcarra.USBLAN_netpart.kext appears to be
valid
kld(): Undefined symbols:
_mbuf_data
_mbuf_len
_mbuf_next
I believe the problem comes down to the OSBundleLibraries included
in the plist file. Before I started mucking around with it, all
that was specified in the plist file was:
<key>com.apple.iokit.IONetworkingFamily</key>
<string>1.1</string>
Adding:
<key>com.apple.kpi.bsd</key>
<string>8.0.0</string>
<key>com.apple.kpi.libkern</key>
<string>8.0.0</string>
as with other sample NKEs makes the missing mbuf_* symbols go
away. Now I have dozens and dozens of missing symbols from the
IOKit family, some C++ mangled, some not:
_IOFreeAligned
_IOLockAlloc
_IOLockFree
...
...
__ZN10IOWorkLoop8workLoopEv
__ZN13IOEventSource10gMetaClassE
__ZN13IOEventSource11setWorkLoopEP10IOWorkLoop
__ZN13IOEventSource19signalWorkAvailableEv
...
...
_absolutetime_to_nanoseconds
_clock_get_uptime
_gIOServicePlane
_thread_block
I thought adding a more up-to-date IONetworking family might help:
<key>com.apple.iokit.IONetworkingFamily</key>
<string>1.5</string>
But this attempt didn't work either. Same dozens and dozens of
missing symbols.
I've checked the list archives, Google, sample source, et. al. but
no luck just yet. I'm sure somebody else has run into this problem
with kexts built with XCode. Which OSBundleLibraries should I be
including?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden