1f6aa8b33e11ac20110841872539a5eb5a0615b2
[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 
28 root
29   |-mainbus0 (Lemote Yeeloong)
30   |  |-apm0
31   |  |-bonito0 (memory and PCI-X controller, rev 1)
32   |  |  |-pci0 (bus 0)
33   |  |     |-auglx0 (AMD CS5536 Audio)
34   |  |     |  |-audio0
35   |  |     |-ehci0 (NEC USB)
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)
49   |  |     |  |-isa0
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)
57   |  |     |-ohci0 (NEC USB)
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)
70   |-softraid0
71   |  |-scsibus2 (256 targets)
72   |-vscsi0
73      |-scsibus1 (256 targets)
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>