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 for OpenBSD that takes <tt>dmesg</tt>
18 output on standard input and produces a human-friendly tree of devices
19 on standard output. Since it accepts any (OpenBSD) <tt>dmesg</tt>
20 output, you can use it to produce a tree of hardware on someone else's
21 system as well as examine your own.
24 <p>As an example, this is what it looks like on my Lemote Yeeloong:</p>
27 $ dmesg | devtree <br>
29 |-mainbus0 (Lemote Yeeloong)<br>
30 | |-apm0<br>
31 | |-bonito0 (memory and PCI-X controller, rev 1)<br>
32 | | |-pci0 (bus 0)<br>
33 | | |-auglx0 (AMD CS5536 Audio)<br>
34 | | | |-audio0<br>
35 | | |-ehci0 (NEC USB)<br>
36 | | | |-usb0 (USB revision 2.0)<br>
37 | | | |-uhub0 (NEC EHCI root hub)<br>
38 | | |-ehci1 (AMD CS5536 USB)<br>
39 | | | |-usb1 (USB revision 2.0)<br>
40 | | | |-uhub1 (AMD EHCI root hub)<br>
41 | | | |-umass0 (Generic USB2.0-CRW)<br>
42 | | | | |-scsibus0 (2 targets, initiator 0)<br>
43 | | | | |-sd0 (Generic-, Multi-Card, 1.00)<br>
44 | | | |-urtw0 (Realtek RTL8187B)<br>
45 | | |-glxpcib0 (AMD CS5536 ISA)<br>
46 | | | |-glxclk0 (clock, prof)<br>
47 | | | |-gpio1 (32 pins)<br>
48 | | | |-iic (not configured)<br>
49 | | | |-isa0<br>
50 | | | |-mcclock0 (port 0x70/2: mc146818 or compatible)<br>
51 | | | |-pckbc0 (port 0x60/5)<br>
52 | | | | |-pckbd0 (kbd slot)<br>
53 | | | | | |-wskbd0 (console keyboard, using wsdisplay0)<br>
54 | | | | |-pms0 (aux slot)<br>
55 | | | | |-wsmouse0 (mux 0)<br>
56 | | | |-ykbec0 (port 0x381/3)<br>
57 | | |-ohci0 (NEC USB)<br>
58 | | | |-usb2 (USB revision 1.0)<br>
59 | | | |-uhub2 (NEC OHCI root hub)<br>
60 | | |-ohci1 (AMD CS5536 USB)<br>
61 | | | |-usb3 (USB revision 1.0)<br>
62 | | | |-uhub3 (AMD OHCI root hub)<br>
63 | | |-pciide0 (AMD CS5536 IDE)<br>
64 | | | |-wd0 (Corsair Force 3 SSD)<br>
65 | | |-rl0 (Realtek 8139)<br>
66 | | | |-rlphy0 (phy 0: RTL internal PHY)<br>
67 | | |-smfb0 (Silicon Motion LynxEM+)<br>
68 | | |-wsdisplay0 (std, vt100 emulation)<br>
69 | |-cpu0 (STC Loongson2F CPU 796 MHz, STC Loongson2F FPU)<br>
70 |-softraid0<br>
71 | |-scsibus2 (256 targets)<br>
72 |-vscsi0<br>
73 |-scsibus1 (256 targets)<br>
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"-->