📄 developing a device driver.htm
字号:
alt="[Next Section]" src="Developing a Device Driver_files/NEXT.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut6.html"><IMG
alt="[Next Chapter]" src="Developing a Device Driver_files/FF.gif" border=0></A>
<A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><IMG
alt=[Index] src="Developing a Device Driver_files/INDEX.gif" border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><IMG
alt=[Help] src="Developing a Device Driver_files/HELP.gif" border=0></A>
<P>
<HR>
<P>
<H3>2.1.3.3 Specifying Whether the Device Supports Byte
Stream Access </H3>
<P><A name=nx_id_53></A>Most devices support byte stream access. You can view
this access as sequentially accessing data through the device. For example, a
sequence of characters typed at a terminal constitutes a byte stream. Most block
devices can also be accessed in this manner. When a block device is accessed as
a stream of bytes, the access is typically called ``raw'' access. When accessed
this way, the data on the block device is accessed sequentially without any
underlying structure being placed on the data (for example, disk sectors).
<P>For the <TT>NONE</TT> device, the Yes box on the worksheet shown in <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut29.html#devcharac_wkshtfordevnone">Figure
C-5</A> is marked. <A name=SpecActionsonInterrupts></A>
<P>
<HR>
<P align=center><A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><IMG
alt="[Return to Library]" src="Developing a Device Driver_files/BOOKSHELF.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><IMG
alt=[Contents] src="Developing a Device Driver_files/TOC.gif" border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut5.html#DesSimple"><IMG
alt="[Previous Chapter]" src="Developing a Device Driver_files/REW.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut5.html#SpecWhetDevSuppByteStream"><IMG
alt="[Previous Section]" src="Developing a Device Driver_files/PREV.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut5.html#SpecHowDevReset"><IMG
alt="[Next Section]" src="Developing a Device Driver_files/NEXT.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut6.html"><IMG
alt="[Next Chapter]" src="Developing a Device Driver_files/FF.gif" border=0></A>
<A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><IMG
alt=[Index] src="Developing a Device Driver_files/INDEX.gif" border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><IMG
alt=[Help] src="Developing a Device Driver_files/HELP.gif" border=0></A>
<P>
<HR>
<P>
<H3>2.1.3.4 Specifying Actions to Take on Interrupts
</H3>
<P><A name=nx_id_54></A>Use this space on the worksheet in <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut29.html#devcharac_wkshtfordevnone">Figure
C-5</A> to summarize what the driver interrupt handlers will do when the device
generates an interrupt. For example, a terminal-type character driver's
interrupt handler can receive a character that was typed on a user's keyboard.
Typically, the interrupt handler must determine the source of the interrupt,
respond to the interrupt (for example, by reading in the data), and perform the
appropriate actions to cause the interrupt to be dismissed.
<P>Some other issues concerning interrupts are:
<UL>
<P>
<LI>Locking out interrupts when performing vulnerable operations
<P></P>
<LI>Not locking out interrupts for an extended period of time
<P></P>
<LI>Queueing the data so that the data-handling operation can be interrupted
</LI></UL>
<P>
<P>Because the <TT>NONE</TT> device has no underlying physical hardware, it
cannot generate interrupts. Therefore, this part of the worksheet shown in <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut29.html#devcharac_wkshtfordevnone">Figure
C-5</A> is left blank. <A name=SpecHowDevReset></A>
<P>
<HR>
<P align=center><A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><IMG
alt="[Return to Library]" src="Developing a Device Driver_files/BOOKSHELF.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><IMG
alt=[Contents] src="Developing a Device Driver_files/TOC.gif" border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut5.html#DesSimple"><IMG
alt="[Previous Chapter]" src="Developing a Device Driver_files/REW.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut5.html#SpecActionsonInterrupts"><IMG
alt="[Previous Section]" src="Developing a Device Driver_files/PREV.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut5.html#OtherDevChar"><IMG
alt="[Next Section]" src="Developing a Device Driver_files/NEXT.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut6.html"><IMG
alt="[Next Chapter]" src="Developing a Device Driver_files/FF.gif" border=0></A>
<A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><IMG
alt=[Index] src="Developing a Device Driver_files/INDEX.gif" border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><IMG
alt=[Help] src="Developing a Device Driver_files/HELP.gif" border=0></A>
<P>
<HR>
<P>
<H3>2.1.3.5 Specifying How to Reset the Device </H3>
<P><A name=nx_id_55></A><A name=nx_id_56></A>If the bus that the device
controller is connected to supports the reset function, the device driver must
be able to stop all current work and place the device connected to the
controller in a known, quiescent state.
<P>For example purposes, the <TT>NONE</TT> device can be connected to the
TURBOchannel bus. To keep the example driver simple, the reset function will not
be implemented as part of the <TT>/dev/none</TT> device driver. Thus, the
worksheet shown in <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut29.html#devcharac2_wkshtfordevnone">Figure
C-6</A> indicates that this characteristic is of no concern to the
<TT>/dev/none</TT> device driver. <A name=OtherDevChar></A>
<P>
<HR>
<P align=center><A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><IMG
alt="[Return to Library]" src="Developing a Device Driver_files/BOOKSHELF.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><IMG
alt=[Contents] src="Developing a Device Driver_files/TOC.gif" border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut5.html#DesSimple"><IMG
alt="[Previous Chapter]" src="Developing a Device Driver_files/REW.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut5.html#SpecHowDevReset"><IMG
alt="[Previous Section]" src="Developing a Device Driver_files/PREV.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut5.html#descruse_ofdev"><IMG
alt="[Next Section]" src="Developing a Device Driver_files/NEXT.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut6.html"><IMG
alt="[Next Chapter]" src="Developing a Device Driver_files/FF.gif" border=0></A>
<A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><IMG
alt=[Index] src="Developing a Device Driver_files/INDEX.gif" border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><IMG
alt=[Help] src="Developing a Device Driver_files/HELP.gif" border=0></A>
<P>
<HR>
<P>
<H3>2.1.3.6 Specifying Other Device Characteristics </H3>
<P>Use this space to identify other characteristics of the device that might
influence how you design your device driver. The worksheet shown in <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut29.html#devcharac2_wkshtfordevnone">Figure
C-6</A> is left blank to indicate that there are no other device characteristics
associated with the <TT>NONE</TT> device. <A name=descruse_ofdev></A>
<P>
<HR>
<P align=center><A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><IMG
alt="[Return to Library]" src="Developing a Device Driver_files/BOOKSHELF.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><IMG
alt=[Contents] src="Developing a Device Driver_files/TOC.gif" border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut5.html#DesSimple"><IMG
alt="[Previous Chapter]" src="Developing a Device Driver_files/REW.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut5.html#OtherDevChar"><IMG
alt="[Previous Section]" src="Developing a Device Driver_files/PREV.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut5.html#ListDevDocs"><IMG
alt="[Next Section]" src="Developing a Device Driver_files/NEXT.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut6.html"><IMG
alt="[Next Chapter]" src="Developing a Device Driver_files/FF.gif" border=0></A>
<A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><IMG
alt=[Index] src="Developing a Device Driver_files/INDEX.gif" border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><IMG
alt=[Help] src="Developing a Device Driver_files/HELP.gif" border=0></A>
<P>
<HR>
<P>
<H3>2.1.4 Describing Device Usage </H3>
<P><A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut29.html#devuse_wkshtfordevnone">Figure
C-7</A> shows the device usage information for the <TT>NONE</TT> device
associated with the <TT>/dev/none</TT> driver. <A name=nx_id_57></A>As the
worksheet shows, you gather the following information about device usage:
<UL>
<P>
<LI>The documentation you have on the device
<P></P>
<LI>The number of instances of this device type that can reside on the system
<P></P>
<LI>The purpose of the device </LI></UL>
<P><A name=ListDevDocs></A>
<P>
<HR>
<P align=center><A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digital_UNIX_Bookshelf.html"><IMG
alt="[Return to Library]" src="Developing a Device Driver_files/BOOKSHELF.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/TOC.html"><IMG
alt=[Contents] src="Developing a Device Driver_files/TOC.gif" border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut5.html#DesSimple"><IMG
alt="[Previous Chapter]" src="Developing a Device Driver_files/REW.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut5.html#descruse_ofdev"><IMG
alt="[Previous Section]" src="Developing a Device Driver_files/PREV.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut5.html#SpecNumofDeviceTypes"><IMG
alt="[Next Section]" src="Developing a Device Driver_files/NEXT.gif"
border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/drivertut6.html"><IMG
alt="[Next Chapter]" src="Developing a Device Driver_files/FF.gif" border=0></A>
<A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBVD-TE_html/INDEX.html"><IMG
alt=[Index] src="Developing a Device Driver_files/INDEX.gif" border=0></A> <A
href="http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.html"><IMG
alt=[Help] src="Developing a Device Driver_files/HELP.gif" border=0></A>
<P>
<HR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -