1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="I/O Package (Device Drivers)"
25 TITLE="I/O Package (Device Drivers)"
29 HREF="io-user-api.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
71 HREF="io-user-api.html"
84 NAME="IO-PACKAGE-INTRO">Chapter 14. Introduction</H1
86 >The I/O package is designed as a general purpose framework for
87 supporting device drivers. This includes all classes of
88 drivers from simple serial to networking stacks and beyond.</P
90 >Components of the I/O package, such as device drivers, are
91 configured into the system just like all other components.
92 Additionally, end users may add their own drivers to this set.</P
94 >While the set of drivers (and the devices they represent) may be
95 considered static, they must be accessed via an opaque
96 “handle”. Each device in the system has a unique name and
100 > function is used to map that
101 name onto the handle for the device. This “hiding” of the
102 device implementation allows for generic, named devices, as well as
103 more flexibility. Also, the <TT
107 function provides drivers the opportunity to initialize the device
108 when usage actually starts.</P
110 >All devices have a name. The standard provided devices use names such
113 >“/dev/console”</TT
117 >“/dev/serial0”</TT
121 >“/dev/”</TT
122 > prefix indicates that this is
123 the name of a device.</P
125 >The entire I/O package API, as well as the standard
126 set of provided drivers, is written in C. </P
128 >Basic functions are provided to send data to and receive data
129 from a device. The details of how this is done is left to the device [class] itself.
130 For example, writing data to a block device like a disk drive may
131 have different semantics than writing to a serial port. </P
133 >Additional functions are provided to manipulate the state
134 of the driver and/or the actual device. These functions
135 are, by design, quite specific to the actual driver. </P
137 >This driver model supports layering; in other words, a device
138 may actually be created “on top of” another device.
139 For example, the “tty” (terminal-like) devices are
140 built on top of simple serial devices. The upper layer then has
141 the flexibility to add features and functions not found at the lower
142 layers. In this case the “tty” device provides
143 for line buffering and editing not available from the simple serial
146 >Some drivers will support visibility of the layers they depend
147 upon. The “tty” driver allows information about
148 the actual serial device to be manipulated by passing get/set
149 config calls that use a serial driver “key” down
150 to the serial driver itself. </P
157 SUMMARY="Footer navigation table"
186 HREF="io-user-api.html"
196 >I/O Package (Device Drivers)</TD