使用Xcode Cocoa应用程序创建设备驱动程序

时间:2011-10-14 09:49:37

标签: cocoa xcode4 device-driver iokit kernel-extension

    Hi Friends..
    I am try  to create a Device driver Application In X-Code, From This Link:- http://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/KEXTConcept/KEXTConceptIOKit/iokit_tutorial.html I Got little bit Idea. Based on that I completed 

1)Create a New Project
    2)Edit the Information Property List
    3)Fill in the Header File
    4)Implement the Driver’s Entry Points.

    The Fifth Step is:  **Add Library Declarations**
    That mention like this .
    At this stage of creating your driver, you need to find out what those libraries are. The best way to do so is to run the kextlibs tool on your built kext and copy its output into your kext’s Info.plist file.

    But I a can't understand this lines,more over I can't fount $MyDriver/Build/Debug Folder. I opened Info.Plist file On Terminal I got Kext File . now I trying this in X-Code 4.

如果有任何人对此有所了解请给出一些提示.. 谢谢你的重播

1 个答案:

答案 0 :(得分:0)

请注意,只有在为驱动程序实现代码后才能运行kextlibs,并且它会成功构建。一旦你有了这么远,在XCode:

  • 构建你的kext
  • 在项目的文件树中,找到'products'
  • 下的kext
  • 打开一个终端窗口,键入kextlibs后跟一个空格。
  • 从XCode拖动kext并将其拖放到终端窗口
  • 按Enter键,几秒钟后您应该得到如下输出:
    For all architectures:
        com.apple.iokit.IOStorageFamily = 1.6.3
        com.apple.kpi.bsd = 10.8
        com.apple.kpi.iokit = 10.8
        com.apple.kpi.libkern = 10.8
        com.apple.kpi.mach = 10.8

然后将这些库标识符和版本添加到Info.plist并重建。请注意,如果您希望kext在早期版本的Mac OS X上运行,而不是正在运行的系统,则需要提供较旧的库版本。 (理想情况下,通过在最旧的支持版本上运行kextlibs)