2017-05-08 113 views
0

既不調用init,也不調用start。我在每個開頭都放置了「PE_enter_debugger」,但測試機器不屬於調試器。內核擴展加載但不運行

我可以使用kextutil或kextload加載我的內核擴展,並在kextstat中顯示一段時間,但隨後消失。我認爲內核的一部分將其卸載。

$ kextstat | grep MY 
155 0 0xffffff7f82940000 0x2000  0x2000  com.mydomain.MY2000 (1) 420AB8E0-E204-3992-90D8-A55A488448E4 <133 4 3> 

我可以使用kextunload來卸載它。如果我第二次使用kextunload,它會抱怨找不到內核擴展。

kext中的每個文件和目錄都由具有組輪的root擁有。

kextutil -tn沒有發現任何問題。

我禁用了系統完整性保護,並啓用了調試模式,因此我可以使用兩臺機器調試器。我有另外兩個調用PE_enter_debugger()的內核擴展,它們工作。

MY2000是一款複合USB設備。這最終將成爲MY2000四個接口中三個的驅動器。第四個界面是一個具有Windows驅動程序安裝程序的小型存儲卷。

在我的Info.plist中,我嘗試了三種不同的IOProvider類:USBHostDevice,USBHostInterface和AppleUSBHostCompositeDevice。

(蘋果改變它的一些類的名字在埃爾卡皮坦我認爲,以前他們是USBDevice和的UsbInterface。)

<?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>en</string> 
    <key>CFBundleExecutable</key> 
    <string>$(EXECUTABLE_NAME)</string> 
    <key>CFBundleIdentifier</key> 
    <string>com.mydomain.MY2000</string> 
    <key>CFBundleInfoDictionaryVersion</key> 
    <string>6.0</string> 
    <key>CFBundleName</key> 
    <string>$(PRODUCT_NAME)</string> 
    <key>CFBundlePackageType</key> 
    <string>KEXT</string> 
    <key>CFBundleShortVersionString</key> 
    <string>1.0</string> 
    <key>CFBundleVersion</key> 
    <string>1</string> 
    <key>IOKitPersonalities</key> 
    <dict> 
     <key>MY2000</key> 
     <dict> 
      <key>IOKitDebug</key> 
      <integer>65535</integer> 
      <key>IOClass</key> 
      <string>com_mydomain_MY2000</string> 
      <key>CFBundleIdentifier</key> 
      <string>com.mydomain.MY2000</string> 
      <key>IOProviderClass</key> 
      <string>AppleUSBHostCompositeDevice</string> 
      <key>IOMatchCategory</key> 
      <string>com_mydomain_MY2000</string> 
      <key>idVendor</key> 
      <string>0x1234</string> 
      <key>idProduct</key> 
      <string>0x2000</string> 
      <key>bInterfaceClass</key> 
      <string>0x10</string> 
      <key>bInterfaceSubclass</key> 
      <string>0x0</string> 
      <key>bInterfaceProtocol</key> 
      <string>0x0</string> 
     </dict> 
    </dict> 
    <key>NSHumanReadableCopyright</key> 
    <string>Copyright © 2017 My Company. All rights reserved.</string> 
    <key>OSBundleLibraries</key> 
    <dict> 
     <key>com.doequalsglory.driver.IOProxyFramebuffer</key> 
     <string>1.0.0d1</string> 
     <key>com.apple.kpi.iokit</key> 
     <string>16.5</string> 
     <key>com.apple.kpi.libkern</key> 
     <string>16.5</string> 
    </dict> 
</dict> 
</plist> 

感謝您的幫助,您可以給我。

回答

1

Info.plist中有:

 <key>idVendor</key> 
     <string>0x1234</string> 
     <key>idProduct</key> 
     <string>0x2000</string> 

「字符串」 應爲 「整數」

 <key>idVendor</key> 
     <integer>1234</integer> 
     <key>idProduct</key> 
     <integer>29193</integer> 

在屬性列表編輯,更改默認字符串類型設置爲數字。

FACEPALM。

我不應該喝酒和編碼。

相關問題