The hwconfig command returns the configuration information
contained in the configuration string device /dev/string/cfg or
in the file specified on the command line with
the -f option.
Using combinations of the remaining options, the user
can view as much information as needed from the configuration
string. The display format is as follows:
device_name base+finish vec dma rest
where:
device_name
is the name of the device driver.
base+finish
are the starting and the finishing addresses of the driver working space.
vec
is the interrupt vector number in decimal.
dma
is the DMA channel number.
rest
is a possibly empty list of parameter=value pairs.
The default hwconfig display looks similar to this:
The configuration string device
/dev/string/cfg is written to by the boot
program. Thus, the hwconfig report is up to
date when the system is rebooted into either system maintenance
or multiuser mode.
Options
-n
The device name is always printed out.
-l
The long format of the device configuration content, with a label
for each entry, is used. This is the default.
-h
Use the short format, with headers instead of labels.
-c
Check for device conflicts, including I/O addresses, DMA channels,
and interrupt vectors which are being used by more than one driver.
-q
Check quietly for device conflicts; display nothing.
When both -c and -q are given, display conflicts only.
-ffile
Use file as the input file instead of the default
/dev/string/cfg.
param
Show all values of param throughout the configuration
string device. param can be any valid system parameter.
The current valid system parameters are:
name, base, offset, vec, dma,
unit, type, nports,
hds, cyls, secs, and drvr.
param=val
Show only information from the line where param equals
the value val.
The -n, -l and -h options are in increasing overriding power.
That is, if -n and -l are both specified,
-l is used.
param on its own indicates a query for its corresponding value(s),
whereas param=value indicates a
matching <token,val> pair in the input file.
-l is used by default if there are no queries and no explicit option.
Command-line queries, that is, those with parameters only,
are always displayed in long format.
Exit values
hwconfig returns 0 for success, 1 for conflicts detected, 2 for
invalid arguments.
Examples
hwconfig -f /usr/adm/hwconfig
The entire contents of the file
/usr/adm/hwconfig are printed.
hwconfig base
All the values of the base parameter found
in /dev/string/cfg are printed.
hwconfig -f conf base=300 vec=19
All entries in conf that match the
base and vec values given
are printed.
hwconfig name=floppy base
The name and value of base in /dev/string/cfg
for the drivers with the name floppy
are printed for all entries.
hwconfig -n base dma
The device name associated with the base and dma is displayed.
For example,
name=scsi base=0x234 dma=4
hwconfig base dma vec=4
The base and dma values of all /dev/string/cfg
entries with matching vec=4 are printed.
hwconfig -l base dma vec=4
Similar to hwconfig -l vec=4
except that base and dma values are printed first.
hwconfig -h
Everything is printed in the long format, with a header similar to
the one shown at boot time.
All queries are ignore, but matching is performed on token values. For example,
hwconfig -h vec=4 dma=1
prints in long format, with headers, all those entries with
vec=4 and dma=1
hwconfig -ch
displays /dev/string/cfg in an easy-to-read tabular format and
checks for device conflicts.
Limitations
Information about conflicts is purely advisory because hwconfig can
only report about hardware devices which have been correctly recognized by a
kernel driver.
/dev/string/cfg is normally readable by all users;
however, the system administrator may change its permissions.