Examining Driver Personality Information

本文介绍如何通过检查设备驱动程序中的驱动个性信息来获取描述设备所需的键和值。具体方法包括查看存储在磁盘上的内核扩展文件(KEXT),以及使用Property List Editor等工具打开XML格式的信息属性列表。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Examining Driver Personality Information

Another way to get the keys and values you need to describe a device is to examine the driver personality information in a device’s on-disk driver.

Before a device driver is loaded, it is stored on disk or in ROM as a kernel extension, or KEXT. KEXTs are usually located in /System/Library/Extensions. A KEXT file on disk is a bundle that contains other files and folders. Each driver KEXT includes an information property list, in XML format, typically in a file named Info.plist. The property list includes one or more driver personalities—dictionaries whose properties specify which devices the driver is suitable to manage.

A KEXT usually stores its Info.plist file in its Contents directory. You can examine its property list with the Property List Editor application (which is located in /Developer/Applications), by displaying it in the Terminal application (using more or another text-display command), or by opening the property list with an application such as Xcode. Listing 3-3 shows a partial dictionary listing for the AppleFWAudio driver. It contains keys such as the class key and the provider class key, as well as values for these keys (the strings “AppleFWAudioDevice” and “IOFireWireAVCUnit,” respectively).

Listing 3-3  A partial listing of the personality dictionary for the AppleFWAudio driver

    <key>IOKitPersonalities</key>
    <dict>
        <key>AppleFWAudioDevice (AVC)</key>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>com.apple.driver.AppleFWAudio</string>
            <key>IOClass</key>
            <string>AppleFWAudioDevice</string>
            <key>IOProviderClass</key>
            <string>IOFireWireAVCUnit</string>
            ...
        </dict> ...

By examining a driver’s personality dictionary, your application can determine the keys and values to put in a matching dictionary to specify that driver’s device.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值