SYSTEM SOFTWARE
DEVICE DRIVERS
The EUROS port driver concept
Modern operating systems use new concepts to categorize the wide variety of peripheral chips and to vastly simplify writing and maintaining driver software.
For the real-time operating system EUROS the "Port Driver concept" was implemented for this purpose. The name "Port Driver" is used for a system object that describes the characteristics of a hardware module by software and provides a standardized software interface. In that sense a Port Driver represents an elementary driver that describes the characteristics of the peripheral controller without adding further "intelligence".
Within the EUROS port driver concept physical modules are represented by hierarchically arranged objects (cluster concept), respecting their specific characteristics (e.g. number of channels). The illustration shows the hierarchical structure of Port Driver objects.
Each higher-level element implements all commonly required functions of the layers below. This is true independent from the level of the element itself. The user usually addresses the lowest element in the hierarchy; when the requested function is not implemented there, the request is redirected to the level above.
Input/output routines are a good example: they are usually implemented at the highest level; their implementation, their access modes (direct I/O or memory-mapped I/O), possibly required delays etc. are identical for all members of this tree.
Resource manager concept
Under EUROS, driver programs in the classical sense are reduced to Resource Managers ("protocol machines"), which coordinate the access to a class of devices (similar physical units). A Resource Manager of this kind is completely hardware independent. Execution of hardware specific services as well as interrupt control is done by a Port Driver.
The object-oriented design of EUROS simplifies categorizing and identifying Resource Managers. System objects of the type Resource Manager are created and contain functionality (called "protocol") that implements the specific characteristics of a transfer mechanism, e.g. character-oriented transmission or IrDA protocol.
Linking Port Drivers and Resource Managers
A Resource Manager is linked to a suited Port Driver at run-time using EUROS system calls. This way a Resource Manager reserves the Port Driver so that it can no longer be used directly by user tasks. The link to the Port Driver can be released or rearranged at run-time. Great flexibility is achieved with these mechanisms, allowing free interaction between a pool of Resource Managers and a pool of Port Drivers.
POSIX
The POSIX interface was introduced to enable operating system independent transactions with hardware. It represents a generalized I/O interface that allows hardware access at a logical level.
Since POSIX addresses files only and since EUROS allows I/O operations for Port Drivers, Resource Managers or a file system, it was necessary to implement a switching layer. It's called "POSIX switch" and redirects I/O requests to the underlying components.
The illustration shows how the POSIX switch redirects I/O calls to the correct EUROS object. After analyzing the type of the specified I/O object the switch redirects the request either to a file system, to a Resource Manager or to a Port Driver.
Advantages of the EUROS Port Driver Concept
The introduction of the Port Driver concept offers actual simplification of real-time application development.
The EUROS Port Driver:
- covers fully the characteristics of the hardware chip by software
- offers a standardized software interface
- handles interrupt-driven control of a specific chip thus helping extending the functionality of an operating system to basic features, namely reentrancy and real-time capability.
The Resource Manager:
- is the base for implementing hardware independent driver packages
- is entirely written in C language, contains no hardware dependencies and can be easily ported.
- Because of the way of linking of the Port Driver and the Resource Manager there is no need to adapt the Resource Manager when developing a port driver for a new peripheral controller. This reduces development cost noticeably.