⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hw activities.htm

📁 What is this ``device driver stuff anyway? Here s a very short introduction to the concept.
💻 HTM
📖 第 1 页 / 共 3 页
字号:
interface cause the bus configuration code to correctly attach device
controllers to their respective buses.
<a name="WhenWritingprobeInter"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="HW%20activities_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="HW%20activities_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#HWComponents"><img src="HW%20activities_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#SpecifyBusDeviceIsOn"><img src="HW%20activities_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#WhenDMADoneByDevice"><img src="HW%20activities_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut23.html"><img src="HW%20activities_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="HW%20activities_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="HW%20activities_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h3>
16.1.3.2&nbsp;&nbsp;&nbsp;&nbsp;Writing probe and slave Interfaces
</h3>
<p>
<a name="nx_id_680"></a>
When writing
<tt>probe</tt>
and
<tt>slave</tt>
interfaces, you need to consider the bus on which the driver will
operate.
The bus affects the formal parameters you specify for these
interfaces.
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut11.html#ImplementTheProbeRtn">Section 7.1</a>
and
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut11.html#ImplemenTheslaveRoutine">Section 7.4</a>
show you how to set up
<tt>probe</tt>
and
<tt>slave</tt>
interfaces for the TURBOchannel bus.
<a name="nx_id_681"></a>
<a name="nx_id_682"></a>
See the bus-specific driver manual to learn how to set up these
interfaces for the bus your driver operates on.
<a name="WhenDMADoneByDevice"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="HW%20activities_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="HW%20activities_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#HWComponents"><img src="HW%20activities_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#WhenWritingprobeInter"><img src="HW%20activities_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#TheDevice"><img src="HW%20activities_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut23.html"><img src="HW%20activities_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="HW%20activities_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="HW%20activities_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h3>
16.1.3.3&nbsp;&nbsp;&nbsp;&nbsp;A Device Does Direct Memory Access
</h3>
<p>
Some devices are capable of directly accessing memory, generally to
transfer large blocks of data.
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut22.html#DMAandNonDMADevices">Section 16.1.4.5</a>
discusses DMA as it relates to devices.
<a name="TheDevice"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="HW%20activities_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="HW%20activities_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#HWComponents"><img src="HW%20activities_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#WhenDMADoneByDevice"><img src="HW%20activities_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#TheDeviceRegisters"><img src="HW%20activities_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut23.html"><img src="HW%20activities_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="HW%20activities_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="HW%20activities_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h3>
16.1.4&nbsp;&nbsp;&nbsp;&nbsp;Device
</h3>
<p>
<a name="nx_id_683"></a>
A device (often referred to as a peripheral device)
can be a printer, an acquisition
device, terminal, and so forth.
Whatever the device is, it has:
</p><ul>
<p></p><li>
One or more device registers for communicating with other hardware
<p></p></li><li>
The ability (in most devices) to generate interrupts
</li></ul><p>
Major distinctions between devices are the type of device (block,
character, or network) and whether the device is capable of directly
accessing memory.
A direct memory access (DMA) device is one that can directly access
(read from and write to) CPU memory, without CPU intervention.
Non-DMA devices cannot directly access CPU memory. 
<a name="nx_id_684"></a>
</p><p>
The following sections briefly discuss the device registers, block and
character devices, terminal devices, network devices, and DMA and
non-DMA devices.
<a name="TheDeviceRegisters"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="HW%20activities_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="HW%20activities_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#HWComponents"><img src="HW%20activities_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#TheDevice"><img src="HW%20activities_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#BlockandCharDrvs"><img src="HW%20activities_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut23.html"><img src="HW%20activities_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="HW%20activities_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="HW%20activities_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h3>
16.1.4.1&nbsp;&nbsp;&nbsp;&nbsp;Device Registers
</h3>
<p>
<a name="nx_id_685"></a>
A device register is commonly referred to as a control status register,
or CSR.
The device register can be used to:
</p><ul>
<p></p><li>
Control what a device does
<p></p></li><li>
Report the status of a device
<p></p></li><li>
Transfer data to or from the device
</li></ul><p>
<a name="nx_id_686"></a>
The device register can be in the device or in a separate controller.
In most cases, the location of the device register is of no concern to
the device driver writer.
</p><p>
The types of device registers can vary widely, depending on the device
used.
Most devices have multiple registers.
A device register can be read-only, such as for device status or the
results of an I/O operation; it can be a write-only command/control
register; or it can be both readable and writeable.
</p><p>
It is often the case that after writing to a read/write register, the
subsequent read from it will return a completely different value.
The read value will be defined to be a status or result, while the write
value will be command or control information to the device.
In many cases, reading a control status register once will clear that
register's values.
A second read may, in fact, return unexpected or unwanted results.
See the documentation for the device to determine if this situation
exists.
</p><p>
Digital provides the
<tt>read_io_port</tt>
and
<tt>write_io_port</tt>
interfaces to read and write data from a device register located in
the bus I/O or memory address space.
These interfaces make the device driver more portable across different
bus architectures, different CPU architectures, and different CPU types
within the same CPU architecture.
<a name="BlockandCharDrvs"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="HW%20activities_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="HW%20activities_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#HWComponents"><img src="HW%20activities_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#TheDeviceRegisters"><img src="HW%20activities_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#TerminalDrvs"><img src="HW%20activities_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut23.html"><img src="HW%20activities_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="HW%20activities_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="HW%20activities_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h3>
16.1.4.2&nbsp;&nbsp;&nbsp;&nbsp;Block and Character Devices
</h3>
<p>
<a name="nx_id_687"></a>
A block device is one that is designed to operate in terms of the block
I/O supported by Digital UNIX.
It is accessed through the buffer cache.
A block device has an associated block device driver that performs
I/O by using file system block-sized buffers
from a buffer cache supplied by the kernel.
Block device drivers
are particularly well-suited for disk drives,
the most common block devices.
</p><p>
A character device is any device that can have streams of characters
read from or written to it.
A character device has a character device driver associated with it that
can be used for a device such as a
line printer that handles one character at a time.
However, character drivers are not limited to performing I/O a single
character at a time (despite the name ``character'' driver).
For example, tape drivers frequently perform I/O in 10K chunks.
A character device driver can also be used where it is
necessary to copy data directly to or from a user process.
Because of their flexibility in handling I/O, many drivers are character
drivers.
Line printers, interactive terminals, and graphics
displays are
examples of devices that require character device drivers.
<a name="nx_id_688"></a>
<a name="nx_id_689"></a>
<a name="TerminalDrvs"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="HW%20activities_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="HW%20activities_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#HWComponents"><img src="HW%20activities_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#BlockandCharDrvs"><img src="HW%20activities_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#NetworkDrvs"><img src="HW%20activities_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut23.html"><img src="HW%20activities_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="HW%20activities_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="HW%20activities_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h3>
16.1.4.3&nbsp;&nbsp;&nbsp;&nbsp;Terminal Devices
</h3>
<p>
<a name="nx_id_690"></a>
A terminal device is a special type of character device that can
have streams of characters read from or written to it.
Terminal devices have terminal (character) device drivers associated with them.
<a name="nx_id_691"></a>
A terminal device driver is actually a character device driver
that handles I/O character processing for a
variety of terminal devices.
Like
any character device, a terminal device can accept or supply
a stream of data based on a
request from a user process.
It cannot be mounted as a file system and, therefore, does not use
data caching.
<a name="NetworkDrvs"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="HW%20activities_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="HW%20activities_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#HWComponents"><img src="HW%20activities_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#TerminalDrvs"><img src="HW%20activities_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#DMAandNonDMADevices"><img src="HW%20activities_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut23.html"><img src="HW%20activities_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="HW%20activities_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="HW%20activities_files/HELP.GIF" alt="[Help]" border="0"></a>
</p><p></p><hr><p>
</p><h3>
16.1.4.4&nbsp;&nbsp;&nbsp;&nbsp;Network Devices
</h3>
<p>
<a name="nx_id_692"></a>
A network device is any device associated with network activities and
is responsible for both transmitting and receiving frames to and from
the network medium.
Network devices have network device drivers associated with them.
<a name="nx_id_693"></a>
A network device driver attaches a network subsystem to a network
interface, prepares the network interface for operation, and governs the
transmission and reception of network frames over the network interface.
<a name="nx_id_694"></a>
<a name="DMAandNonDMADevices"></a>
</p><p></p><hr><p align="center">
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><img src="HW%20activities_files/BOOKSHELF.GIF" alt="[Return to Library]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><img src="HW%20activities_files/TOC.GIF" alt="[Contents]" border="0"></a>
<a href="#HWComponents"><img src="HW%20activities_files/REW.GIF" alt="[Previous Chapter]" border="0"></a>
<a href="#NetworkDrvs"><img src="HW%20activities_files/PREV.GIF" alt="[Previous Section]" border="0"></a>
<a href="#HardwareActiv"><img src="HW%20activities_files/NEXT.GIF" alt="[Next Section]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut23.html"><img src="HW%20activities_files/FF.GIF" alt="[Next Chapter]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><img src="HW%20activities_files/INDEX.GIF" alt="[Index]" border="0"></a>
<a href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><img src="HW%20activities_files/HELP.GIF" alt="[Help]" border="0"></a>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -