libdevinfo ライブラリは、プログラムからデバイスツリーの内容にアクセスするためのインタフェースを提供します。
prtconf(1M) コマンドはデバイスツリーのすべての内容を表示します。
/devices 階層は、デバイスツリーを表したものです。ls(1) コマンドを使用して階層を表示します。
libdevinfo ライブラリは、すべての公開デバイスの構成データにアクセスするためのインタフェースを提供します。インタフェースの一覧については、 libdevinfo(3LIB) のマニュアルページを参照してください。
次に抜粋した prtconf(1M) コマンドの例では、システム内のすべてのデバイスを表示しています。
Memory size: 128 Megabytes System Peripherals (Software Nodes): SUNW,Ultra-5_10 packages (driver not attached) terminal-emulator (driver not attached) deblocker (driver not attached) obp-tftp (driver not attached) disk-label (driver not attached) SUNW,builtin-drivers (driver not attached) sun-keyboard (driver not attached) ufs-file-system (driver not attached) chosen (driver not attached) openprom (driver not attached) client-services (driver not attached) options, instance #0 aliases (driver not attached) memory (driver not attached) virtual-memory (driver not attached) pci, instance #0 pci, instance #0 ebus, instance #0 auxio (driver not attached) power, instance #0 SUNW,pll (driver not attached) se, instance #0 su, instance #0 su, instance #1 ecpp (driver not attached) fdthree, instance #0 eeprom (driver not attached) flashprom (driver not attached) SUNW,CS4231 (driver not attached) network, instance #0 SUNW,m64B (driver not attached) ide, instance #0 disk (driver not attached) cdrom (driver not attached) dad, instance #0 sd, instance #15 pci, instance #1 pci, instance #0 pci108e,1000 (driver not attached) SUNW,hme, instance #1 SUNW,isptwo, instance #0 sd (driver not attached) st (driver not attached) sd, instance #0 (driver not attached) sd, instance #1 (driver not attached) sd, instance #2 (driver not attached) ... SUNW,UltraSPARC-IIi (driver not attached) SUNW,ffb, instance #0 pseudo, instance #0
/devices 階層では、デバイスツリーを表す名前空間が提供されます。次に示すのは、/devices 名前空間の短縮形の一覧です。このサンプル出力は、前に示したデバイスツリーの例と prtconf (1M) の出力に対応しています。
/devices /devices/pseudo /devices/pci@1f,0:devctl /devices/SUNW,ffb@1e,0:ffb0 /devices/pci@1f,0 /devices/pci@1f,0/pci@1,1 /devices/pci@1f,0/pci@1,1/SUNW,m64B@2:m640 /devices/pci@1f,0/pci@1,1/ide@3:devctl /devices/pci@1f,0/pci@1,1/ide@3:scsi /devices/pci@1f,0/pci@1,1/ebus@1 /devices/pci@1f,0/pci@1,1/ebus@1/power@14,724000:power_button /devices/pci@1f,0/pci@1,1/ebus@1/se@14,400000:a /devices/pci@1f,0/pci@1,1/ebus@1/se@14,400000:b /devices/pci@1f,0/pci@1,1/ebus@1/se@14,400000:0,hdlc /devices/pci@1f,0/pci@1,1/ebus@1/se@14,400000:1,hdlc /devices/pci@1f,0/pci@1,1/ebus@1/se@14,400000:a,cu /devices/pci@1f,0/pci@1,1/ebus@1/se@14,400000:b,cu /devices/pci@1f,0/pci@1,1/ebus@1/ecpp@14,3043bc:ecpp0 /devices/pci@1f,0/pci@1,1/ebus@1/fdthree@14,3023f0:a /devices/pci@1f,0/pci@1,1/ebus@1/fdthree@14,3023f0:a,raw /devices/pci@1f,0/pci@1,1/ebus@1/SUNW,CS4231@14,200000:sound,audio /devices/pci@1f,0/pci@1,1/ebus@1/SUNW,CS4231@14,200000:sound,audioctl /devices/pci@1f,0/pci@1,1/ide@3 /devices/pci@1f,0/pci@1,1/ide@3/sd@2,0:a /devices/pci@1f,0/pci@1,1/ide@3/sd@2,0:a,raw /devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a /devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a,raw /devices/pci@1f,0/pci@1 /devices/pci@1f,0/pci@1/pci@2 /devices/pci@1f,0/pci@1/pci@2/SUNW,isptwo@4:devctl /devices/pci@1f,0/pci@1/pci@2/SUNW,isptwo@4:scsi