Synthetic file system
In computer science, a synthetic file system is a hierarchical interface to objects that appears in the tree of the disk-based filesystem. The nodes in the synthetic file system may be access with the same system calls or utility programs as regular files and directories.
The benefit of synthetic file systems is that well known file system semantics can be reused for a universal and easy to implement approach to interprocess communication. Clients simply perform simple file operations and do not have to implement complex message encoding and passing methods and other aspects of protocol engineering. For most operations, common file utilities can be used, so even scripting is quite easy.
Examples
/proc filesystem
In the Unix-world, there is commonly a special filesystem mounted at /proc. This filesystem is implemented within the kernel and publishes a lot of information about running processes. For each running process, there's a directory (named by the process ID), containing detailed information about the process: status, open files, memory maps, mounts, etc.
Linux /sys filesystem
The /sys filesystem on Linux is a counterpart to /proc, which provides a lot of (non-process related) detailed information about the in-kernel status to userspace, eg. devices, busses and loaded modules.
ObexFS
This FUSE-based filesystem provides access to OBEX objects via a filesystem. So applications can work on remote objects via the OBEX protocol as they were simply (local) files.
Plan9 file servers
On the Plan9 operating system family, the concept of synthetic filesystem is used as a generic IPC method. Contrary to most other operating systems, Plan9's design is heavily distributed: while in other OS worlds, there are many (and often large) libraries and frameworks for common things, Plan9 encapsulates them into fileservers. The most important benefit is that applications can much simpler and services run network and platform agnostic - they can reside on virtually any host and platform in the network, and virtually any kind of network, as long the fileserver can be mounted by the application.
Plan9 drives this concept very excessively: even most operating system services, eg. hardware access and networking stack are presented as fileservers. This way it's trivial to use these resources remotely (eg. one host directly accessing another host's block devices or network interfaces) without the need of additional protocols.
Embedded systems
Debugging embedded systems or even system-on-chip (SoC) devices is widely known to be difficult.[citation needed] Several protocols have been implemented to provide direct access to in-chip devices, but they tend to be proprietary, complex and hard to handle.
Based on 9P, Plan9's network filesystem, studies suggest using synthetic filesystems as universal access scheme to those information. The major benefit is that 9P is very simple and so quite easy to implement in hardware and can be easily used and over virtually any kind of network (from a serial link up to the internet).
9forge project
The 9forge project develops service interfaces for many kind of common applications (eg. Browsers, Mail-Clients, Office suites) based on 9P-speaking synthetic filesystems and also ports some applications to use them.
One current point of work is the Mozilla suite, which shall do things like message storage and profile handling via fileservers. At time of writing this article, the project is still in an early stage.
Arguments for using synthetic filesystems
The major point might be flexibility and easy access to service oriented architectures. Once a noticeable number of applications use this scheme, the overall overhead (code, resource consumption, maintenance work) can be reduced significantly
Many general arguments for SOAs also apply here.
Arguments against synthetic filesystems
Filesytem semantics do not fit all application scenarios. For example complex Remote procedure calls with many parameters tend to be hard to map to filesystem schemes,[citation needed] and may require application redesign.
External links
- BROWN, Geoffrey: On-Chip Filesystems to support Complex Embedded Systems
- PISUPATI, Bhani N.: A virtual filesystem framework to support embedded software development
- PATIL, Ameet; FREEMAN, Michael; GAO, Rui; BAILEY: Implementing the Styx network protocol in hardware
- MINNICH, Ron: Why Plan9 is not dead and we can learn from it