Appleの「カーネル拡張」チュートリアルをやろうとしています。プロジェクト ファイルを作成し、Info.plist を作成し、ビルドし、kextlibs を使用して依存関係を学習し、それらを Info.plist に追加し、再ビルドし、/tmp にコピーし、kextutil を使用してテストしました。これまでのところすべて順調です。ただし、kext をロードしようとすると、start/stop/probe 関数が呼び出されないようです。IOLog メッセージが /var/log/system.log に表示されません。
実際、system.log には何も表示されません。sysctl -w debug.kextlog=0x0007780E で kext ロギングを有効にすると、kernel.log が記録されます。kernel.log には、「Kext ch.digorydoo.driver.XinputDevice は依存関係を正常に解決しました」と表示されます。次に、「ロードされていないkextとその他の未使用データをフラッシュしています。」多分私のクラスはすぐにフラッシュされますか?
私のクラスは kextstat の最後に表示されますが、参照はありません。ioclasscount と同じです。ioreg で、自分のクラスが表示されません。
IOProviderClass を IOResources に設定したので、常に参照が必要ですよね? IOMatchCategory を適切に設定しました。
何か助けて?!?! どうもありがとう!
編集: ここに私の Info.plist があります:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>ch.digorydoo.driver.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>IOKitPersonalities</key>
<dict>
<key>Generic Xinput Gamepad</key>
<dict>
<key>CFBundleIdentifier</key>
<string>ch.digorydoo.driver.${PRODUCT_NAME:rfc1034identifier}</string>
<key>IOProviderClass</key>
<string>IOResources</string>
<key>IOMatchCategory</key>
<string>ch_digorydoo_driver_XinputDevice</string>
<key>IOClass</key>
<string>ch_digorydoo_driver_XinputDevice</string>
<key>IOKitDebug</key>
<integer>65535</integer>
</dict>
</dict>
<key>OSBundleLibraries</key>
<dict>
<key>com.apple.kpi.iokit</key>
<string>10.8</string>
<key>com.apple.kpi.libkern</key>
<string>10.8</string>
<key>com.apple.kpi.mach</key>
<string>10.8</string>
</dict>
</dict>
</plist>