I’m fairly critical of the traditional UNIX idea that everything can be expressed in terms of files. Files are unstructured units of permanently accessible and sequentially organized data, which can be shrinked, grown and seeked through at will. Real-world computer hardware, on the other hand, is often better described in terms of fixed-size data structures of ill-known contents, which notify software of undergoing stuff through events (or, in hardware parlance, interrupts), and which predominantly communicate through streams of data even when they masquerade themselves as chunks of RAM.*
For this reason, computer hardware would be best abstracted as a special kind of object, which aside of methods and “normal” members also has event sources and sinks (think Qt signals and slots, C# delegates) and stream I/O (which can be emulated through virtual methods that pump data in and out, or return specially crafted stream objects which can be used to this end). This is not something which is easily expressed in terms of files.
That being said, I do see some value in having a universal way to index every system resource in a computer system. It makes sense, in particular, to have a universal way to express concepts such as “I have permission to access this resource”, “A resource has just been plugged in/taken out”, or “Here’s an extensive list of all the available system resources, which can be parsed hierarchically or searched by criteria”.
So, in the end, it seems to me that the most relevant option would be to have a virtual filesystem of objects, representing elementary system resources or organisational units thereof, which may or may not feature the appropriate open/read/write/seek interface required to call them a file. Does someone know if another OS has already attempted to use such an abstraction, or have additional thoughts on this concept?
* Try to address memory-mapped hardware using inappropriate memory alignment or integer sizes, or while forgetting CPU caching on, and you’ll see what I mean.