a240b54050625c02ea433aa13e06e866128332c1
[www.git] / projects / openbsd_devtree.shtml
1 <!--#include virtual="/doctype.txt"-->
2 <html>
3
4 <!--#include virtual="/head.shtml"-->
5
6 <body>
7
8 <!--#include virtual="/header.shtml"-->
9
10 <!--#include virtual="/navigation.shtml"-->
11
12 <div id="content">
13
14 <h1>Printing device trees on OpenBSD</h1>
15
16 <p>
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
21 as examine your own.
22 </p>
23
24 <p>As an example, this is what it looks like on my Lemote Yeeloong:</p>
25
26 <code>
27 $ dmesg | devtree <br>
28 root<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>
74 </code>
75
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>
78 from
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>)
81 .
82 </p>
83
84 </div>
85
86 <!--#include virtual="/footer.shtml"-->
87
88 </body>
89
90 </html>