1 <!--#include virtual="/doctype.txt"-->
4 <!--#include virtual="/head.shtml"-->
8 <!--#include virtual="/header.shtml"-->
10 <!--#include virtual="/navigation.shtml"-->
14 <h1>Printing device trees on OpenBSD</h1>
17 I've written a small Perl utility that takes <tt>dmesg</tt> output on
18 standard input and produces a human-friendly tree of devices on
19 standard output. Since it accepts any <tt>dmesg</tt> output, you can
20 use it to produce a tree of hardware on someone else's system as well
24 <p>As an example, this is what it looks like on my Lemote Yeeloong:</p>
29 |-mainbus0 (Lemote Yeeloong)
31 | |-bonito0 (memory and PCI-X controller, rev 1)
33 | | |-auglx0 (AMD CS5536 Audio)
36 | | | |-usb0 (USB revision 2.0)
37 | | | |-uhub0 (NEC EHCI root hub)
38 | | |-ehci1 (AMD CS5536 USB)
39 | | | |-usb1 (USB revision 2.0)
40 | | | |-uhub1 (AMD EHCI root hub)
41 | | | |-umass0 (Generic USB2.0-CRW)
42 | | | | |-scsibus0 (2 targets, initiator 0)
43 | | | | |-sd0 (Generic-, Multi-Card, 1.00)
44 | | | |-urtw0 (Realtek RTL8187B)
45 | | |-glxpcib0 (AMD CS5536 ISA)
46 | | | |-glxclk0 (clock, prof)
47 | | | |-gpio1 (32 pins)
48 | | | |-iic (not configured)
50 | | | |-mcclock0 (port 0x70/2: mc146818 or compatible)
51 | | | |-pckbc0 (port 0x60/5)
52 | | | | |-pckbd0 (kbd slot)
53 | | | | | |-wskbd0 (console keyboard, using wsdisplay0)
54 | | | | |-pms0 (aux slot)
55 | | | | |-wsmouse0 (mux 0)
56 | | | |-ykbec0 (port 0x381/3)
58 | | | |-usb2 (USB revision 1.0)
59 | | | |-uhub2 (NEC OHCI root hub)
60 | | |-ohci1 (AMD CS5536 USB)
61 | | | |-usb3 (USB revision 1.0)
62 | | | |-uhub3 (AMD OHCI root hub)
63 | | |-pciide0 (AMD CS5536 IDE)
64 | | | |-wd0 (Corsair Force 3 SSD)
65 | | |-rl0 (Realtek 8139)
66 | | | |-rlphy0 (phy 0: RTL internal PHY)
67 | | |-smfb0 (Silicon Motion LynxEM+)
68 | | |-wsdisplay0 (std, vt100 emulation)
69 | |-cpu0 (STC Loongson2F CPU 796 MHz, STC Loongson2F FPU)
71 | |-scsibus2 (256 targets)
73 |-scsibus1 (256 targets)
76 <p>Source and a man page are available under the
77 <a href="http://git.sjm.so/?p=openbsd-goodies.git;a=tree;f=devtree;hb=HEAD">WTFPL</a>
79 <a href="git://git.sjm.so/openbsd-goodies.git">git://git.sjm.so/openbsd-goodies.git</a>
80 (or view it on <a href="http://git.sjm.so/?p=openbsd-goodies.git;a=tree;f=devtree;hb=HEAD">GitWeb</a>)
86 <!--#include virtual="/footer.shtml"-->