Copyright ©1995 by NeXT Computer, Inc.  All Rights Reserved.

IOConfigTable



Inherits From: Object
Declared In: driverkit/IOConfigTable.h



Class Description

IOConfigTable is used at both kernel and user level to get configuration information about particular devices and the system as a whole. Which IOConfigTables a software module can obtain, as well as the way it obtains them, depends on whether the module is a driver and whether it's at user or kernel level.

IODevices inside and outside the kernel can get their own IOConfigTables using IODeviceDescription's configTable method. User-level programs can use the methods newForDriver:unit:, newDefaultTableForDriver:, tablesForBootDrivers, and tablesForInstalledDrivers to get IOConfigTables for specific drivers. Both user-level and kernel-level modules can use newFromSystemConfig to get an IOConfigTable that describes the system-wide configuration.

Each IOConfigTable describes one hardware device. Thus, each IOConfigTable (except the system-wide one) corresponds to one IODevice object, which may or may not exist at the time the IOConfigTable is created. At least one IOConfigTable can be created for each driver that's listed in the system-wide IOConfigTable as an active or boot driver. Specifically, each IOConfigTable corresponds to an Instancen.table file in the driver's bundle. See Chapter 4, "Configuring Drivers," for more information on driver bundles.

Note:  From an IODevice's viewpoint, its IOConfigTable doesn't change. The IOConfigTable keeps the values that were in the corresponding Instancen.table when the driver was loaded. To see changes in Instancen.table, the driver must be reloaded. However, the user-level version of driver IOConfigTables can be synchronized with the corresponding Instancen.table at any time. This means that a user-level program might see different values in a driver's IOConfigTable than the driver sees.



Instance Variables

None declared in this class.



Method Types

Creating and freeing instances + newForDriver:unit:
+ newDefaultTableForDriver:
+ newFromSystemConfig
+ tablesForBootDrivers
+ tablesForInstalledDrivers
free
Getting information valueForStringKey:
Getting the driver bundle driverBundle



Class Methods

newDefaultTableForDriver:unit:
+ newDefaultTableForDriver:(const char *)driverName

Creates, if necessary, and returns the default IOConfigTable for the specified driver. The driverName corresponds to the value returned by IODevice's name class method.

Note:  This method can be used only by user-level programs.



newForDriver:unit:
+ newForDriver:(const char *)driverName unit:(int)unit

Creates, if necessary, and returns the IOConfigTable for the specified driver and unit. The driverName and unit values correspond to the values returned by IODevice's name class method and unit instance method, respectively.

Note:  This method can be used only by user-level programs.



newFromSystemConfig
+ newFromSystemConfig

Creates, if necessary, and returns the IOConfigTable describing the system-wide configuration. This IOConfigTable's values are initialized at boot time, and don't change until the system is rebooted.



tablesForBootDrivers
+ (List *)tablesForBootDrivers

Creates, if necessary, and returns IOConfigTables, one for each device that was loaded into the system at boot time. This method might return some IOConfigTables that aren't returned by tablesForInstalledDrivers, since this method detects drivers that were loaded due to user action at boot time.

Note:  This method can be used only by user-level programs.



tablesForInstalledDrivers
+ (List *)tablesForInstalledDrivers

Creates, if necessary, and returns IOConfigTables, one for each device that has been loaded into the system. This method knows only about those devices that are specified with the system configuration table's "Active Drivers" and "Boot Drivers" keys. It does not detect drivers that were loaded due to user action at boot time. To get the IOConfigTables for those drivers, you can use tablesForBootDrivers.

Note:  This method can be used only by user-level programs.



Instance Methods

driverBundle
(NXBundle *)driverBundle

Creates, if necessary, and returns the NXBundle corresponding to the driver this IOConfigTable describes. The bundle corresponds to the driver's .config directory under /usr/Devices.

Note:  This method can be used only by user-level programs.



free
free

Frees the object and returns nil.



valueForStringKey:
(const char *)valueForStringKey:(const char *)key

Returns the string value associated with the specified key. Kernel-level drivers should free this string when it's no longer needed, using freeString:. User-level programs should not free this string.