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

📄 developing a device driver.mht

📁 What is this ``device driver stuff anyway? Here s a very short introduction to the concept.
💻 MHT
📖 第 1 页 / 共 5 页
字号:
D-TE_html/FF.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/INDEX.html"><IMG=20
alt=3D[Index]=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/INDEX.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.h=
tml"><IMG=20
alt=3D[Help]=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/HELP.GIF"=20
border=3D0></A>=20
<P>
<HR>

<P>
<H3>2.1.1.1&nbsp;&nbsp;&nbsp;&nbsp;Specifying the Host CPU or CPUs on =
Which Your=20
Driver Operates </H3>
<P>For example purposes, the <TT>/dev/none</TT> driver will be developed =
for use=20
on a DEC 3000 Model 500 AXP Workstation. (Note, however, that the=20
<TT>/dev/none</TT> device driver cannot run on this CPU because it does =
not=20
control an actual hardware device.) <A name=3Dnx_id_34></A><A =
name=3Dnx_id_35></A>
<P>The goal should always be to write any device driver to operate on =
more than=20
one CPU hardware platform, so you should be aware of any differences =
presented=20
by different CPU architectures. By identifying the hardware platforms =
you want=20
the driver to operate on, you can address any driver design decisions =
related to=20
the CPU hardware architecture. This identification can help you =
determine=20
whether one driver, with appropriate conditional compilation statements, =
can=20
handle the CPU hardware platforms you want the driver to operate on. You =
might=20
decide that it would be easier to write two device drivers.=20
<P><A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut6.html#CPUIssues">Section=20
3.1</A> discusses some device driver design issues that are affected by =
CPU=20
architectures. <A name=3DSpecOperateSys></A>
<P>
<HR>

<P align=3Dcenter><A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digita=
l_UNIX_Bookshelf.html"><IMG=20
alt=3D"[Return to Library]"=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/BOOKSHELF.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/TOC.html"><IMG=20
alt=3D[Contents]=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/TOC.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut5.html#DesSimple"><IMG=20
alt=3D"[Previous Chapter]"=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/REW.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut5.html#SpecHostCPU"><IMG=20
alt=3D"[Previous Section]"=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/PREV.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut5.html#SpecBus"><IMG=20
alt=3D"[Next Section]"=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/NEXT.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut6.html"><IMG=20
alt=3D"[Next Chapter]"=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/FF.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/INDEX.html"><IMG=20
alt=3D[Index]=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/INDEX.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.h=
tml"><IMG=20
alt=3D[Help]=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/HELP.GIF"=20
border=3D0></A>=20
<P>
<HR>

<P>
<H3>2.1.1.2&nbsp;&nbsp;&nbsp;&nbsp;Specifying the Operating System or =
Systems on=20
Which Your Driver Operates </H3>
<P><A name=3Dnx_id_36></A>The <TT>/dev/none</TT> driver will be =
developed for use=20
on the Digital UNIX operating system. This is an important consideration =
because=20
data structures and kernel interfaces differ among operating systems. =
For=20
example, device drivers developed for Digital UNIX systems initialize a=20
<TT>driver</TT> structure, while drivers developed for other versions of =
UNIX=20
systems would initialize a different structure. This identification can =
help you=20
determine the amount of work that is involved in porting an existing =
device=20
driver from some other UNIX operating system to the Digital UNIX =
operating=20
system.=20
<P><A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut7.html#PortingDevDrvs">Section=20
4.1</A> provides information to help you understand the tasks involved =
in=20
porting from ULTRIX to Digital UNIX systems. <A name=3DSpecBus></A>
<P>
<HR>

<P align=3Dcenter><A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digita=
l_UNIX_Bookshelf.html"><IMG=20
alt=3D"[Return to Library]"=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/BOOKSHELF.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/TOC.html"><IMG=20
alt=3D[Contents]=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/TOC.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut5.html#DesSimple"><IMG=20
alt=3D"[Previous Chapter]"=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/REW.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut5.html#SpecOperateSys"><IMG=20
alt=3D"[Previous Section]"=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/PREV.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut5.html#identstand_devdrv"><IMG=20
alt=3D"[Next Section]"=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/NEXT.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut6.html"><IMG=20
alt=3D"[Next Chapter]"=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/FF.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/INDEX.html"><IMG=20
alt=3D[Index]=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/INDEX.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.h=
tml"><IMG=20
alt=3D[Help]=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/HELP.GIF"=20
border=3D0></A>=20
<P>
<HR>

<P>
<H3>2.1.1.3&nbsp;&nbsp;&nbsp;&nbsp;Specifying the Bus or Buses to Which =
Your=20
Driver Connects </H3>
<P><A name=3Dnx_id_37></A>You must identify the bus to which the device =
controller=20
is connected. Different buses require different approaches to writing =
the=20
driver. For example, a VMEbus device driver writer must know how to =
allocate the=20
VMEbus address space. This task is not applicable for drivers that =
operate on=20
other buses. On the other hand, you may want to write one device driver =
that=20
operates on several different bus architectures if these bus =
architectures=20
exhibit enough common features. For Digital-implemented buses =
(specifically, the=20
EISA, ISA, PCI, and TURBOchannel), you should be able to write one =
device driver=20
that operates on all of these buses by observing the design issues =
summarized in=20
<A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut6.html#BusIssues">Section=20
3.2</A>.=20
<P><A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut29.html#hostsys2_wkshtfordevnone">Figure=20
C-2</A> shows that for example purposes the <TT>/dev/none</TT> driver =
operates=20
on the TURBOchannel bus. <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut11.html#MultipleBusIssues">Section=20
7.1.1</A> discusses multiple bus issues related to implementing a =
<TT>probe</TT>=20
interface. <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut11.html#SetUpProbeRtnHandleMultBuses">Section=20
7.1.4</A> discusses how to set up a <TT>probe</TT> interface to handle =
multiple=20
buses. <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut11.html#MultipleBusIssuesSlave">Section=20
7.4.1</A> discusses multiple bus issues related to implementing a =
<TT>slave</TT>=20
interface.=20
<P>Note that the worksheet shown in <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut29.html#hostsys2_wkshtfordevnone">Figure=20
C-2</A> provides a space for pseudodevice drivers. A pseudodevice =
driver, such=20
as the <TT>pty</TT> terminal driver, is structured like any other =
driver. The=20
difference is that a pseudodevice driver does not operate on a bus and =
does not=20
control a hardware device. <A name=3Dnx_id_38></A>This book does not =
specifically=20
address pseudodevice drivers; however, <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut28.html#SrcListfordevexpseudo">Section=20
B.2</A> provides a source listing for an example pseudodevice driver =
called=20
<TT>/dev/edpseudo</TT>. <A name=3Dnx_id_39></A><A =
name=3Didentstand_devdrv></A>
<P>
<HR>

<P align=3Dcenter><A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/Digita=
l_UNIX_Bookshelf.html"><IMG=20
alt=3D"[Return to Library]"=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/BOOKSHELF.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/TOC.html"><IMG=20
alt=3D[Contents]=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/TOC.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut5.html#DesSimple"><IMG=20
alt=3D"[Previous Chapter]"=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/REW.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut5.html#SpecBus"><IMG=20
alt=3D"[Previous Section]"=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/PREV.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut5.html#SpecNamingScheme"><IMG=20
alt=3D"[Next Section]"=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/NEXT.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut6.html"><IMG=20
alt=3D"[Next Chapter]"=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/FF.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/INDEX.html"><IMG=20
alt=3D[Index]=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/INDEX.GIF"=20
border=3D0></A> <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/HELP.h=
tml"><IMG=20
alt=3D[Help]=20
src=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUBV=
D-TE_html/HELP.GIF"=20
border=3D0></A>=20
<P>
<HR>

<P>
<H3>2.1.2&nbsp;&nbsp;&nbsp;&nbsp;Identifying the Standards Used in =
Writing the=20
Driver </H3>
<P><A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut29.html#devdrvstand_wkshtfordevnone">Figure=20
C-3</A> and <A=20
href=3D"http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/HTML/AA-PUB=
VD-TE_html/drivertut29.html#devdrvstand2_wkshtfordevnone">Figure=20
C-4</A> show the device driver conventions worksheet for the =
<TT>/dev/none</TT>=20
driver. <A name=3Dnx_id_40></A>As the worksheets show:=20
<UL>
  <P>
  <LI>You specify a naming scheme.=20
  <P></P>
  <LI>You choose an approach for writing comments and documentation. =
</LI></UL>
<P><A name=3DSpecNamingScheme></A>
<P>
<HR>

⌨️ 快捷键说明

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