[PATCH] Open Firmware device tree virtual filesystem

David Miller davem at davemloft.net
Mon Jan 1 23:30:43 EST 2007


From: Benjamin Herrenschmidt <benh at kernel.crashing.org>
Date: Tue, 02 Jan 2007 15:05:59 +1100

> It has proved a good idea in general as I can easily get an exact
> device-tree dump from users by asking for a tarball of /proc/device-tree
> and in some case, the data in there -is- binary (For example, the EDID
> properties for monitors left by video drivers, or things like that).

Yes and with openpromfs I can get the EDID too :-)

root at sunset:/proc/openprom/pci at 1f,700000/SUNW,XVR-100 at 3# cat edid 
00ffffff.ffffff00.4dd9d000.67175700.2d0d0103.0e321f78.eacea9a3.574c9926.19484cbd.ee80a940.81808140.01010101.01010101.0101734b.80a072b0.2a4080d0.1300ef35.1100001c.483f4030.62b03240.40c01300.ef351100.001e0000.00fd0037.411e5f14.000a2020.20202020.000000fc.0053444d.2d503233.32570a20.202000af
root at sunset:/proc/openprom/pci at 1f,700000/SUNW,XVR-100 at 3# 

I think there is high value in an OFW filesystem representation
that gives you _EXACTLY_ what the OFW command line prompt does
when you try to traverse the device tree from there, and that
is what openpromfs tries to do.

If you want raw access, use a character device or a similar auxilliary
access to the data items.  Another idea is to provide a seperate file
operation (such as ioctl) on the OFW property files in order to fetch
things raw and in binary.

When I get some binary data out of a procfs or sysfs file I feel like
strangling somebody.  I'm grovelling around in a filesystem from the
command line so that I can get some information as a user.  If you
don't give me text I can't tell what the heck it is.

Simple system tools should not need to interpret binary data in
order to provide access to simple structured data like this, that's
just stupid.



More information about the Devel mailing list