next up previous contents
Next: Example directory structure Up: Filesystem for USB Previous: Virtual Filesystems

USBFS

Having seen the idea behind a virtual filesystem, it is straightforward to see the motivation behind using USBFS and making it a virtual filesystem. USBFS tries to make all attached USB devices seem like traditional files to go with the UNIX philosophy. It dynamically keeps track of devices that are attached to, or removed from the bus. The idea behind USBFS is an extension of the devfs filesystem, which provided devices the capability to dynamically update their status as and when they were attached or removed. This is in contrast to the old unix philosophy of using nodes inside /dev. This approach suffered from the fact that there never had to be any correspondence between an entry in /dev and a physical device on the machine. Often huge number of nodes are present in /dev with node entries being created for every conceivable scenario, but rarely ever used. USBFS being dynamically updated, does not have this problem.
Apart from the aspect of providing a cleaner filesystem, USBFS also makes drivers aspect of things much more transparent. all USB devices have the same major number, making the use of them to determine the drivers impractical. Instead, the filesystem decides the association based on the description the device returns on enumeration and the list of registered drivers. Apart from this aspect, USB drivers work in the same way as conventional drivers, with functions being defined for open,read,write ,ioctl etc.
next up previous contents
Next: Example directory structure Up: Filesystem for USB Previous: Virtual Filesystems
Bhanu Nagendra P.
2003-07-28