> DeviceFS
Title: DeviceFS
Author: David De Vorchik
History:
27-Apr-91 DDV Created.NB: This document forms part of a set of documents describing DeviceFS, its
DeviceFS provides a standardised interface to devices within the RISC OS environment. Device drivers are declared within the system and they are seen as objects within the 'devices:' filing system.
Streams can be opened for input or output (as supported) onto these objects within the directory structure. A device is given the device file type of &FCC. A device adopts the access rights relevant to its input or output capabilities.
A device driver is simply a set of routines that handle the input or output of data. The device can specifiy if it would like to be buffered, but it will never know if this is the case. Devices have access to the special field passed on opening a stream, this can be used to pass extra information about opening streams and configuration required, for instance a serial device may contain its setup within the special field string.
DeviceFS provides a way of calling devices, DeviceFS_CallDevice with a reason code and control registers. All devices have to support a set of system specific calls, but have a range of reason codes available for their own use. This could be used for controlling a scanner or what ever.
DeviceFS currently only supports stream devices, block devices have yet to be implemented.
The kernel based device drivers have now been exported to use the DeviceFS interface, this includes serial and parallel. These devices are replaceable modules within the RISC OS ROM set and provide working examples of how device drivers should be developed.
Most filing system operations can be performed on objects, it is not possible to create objects within the directory structure which are not devices, nor is it possible to delete objects. Data transfer operations are supported though.