当前位置:首页 » 编程博文
开发技术指南» 文章正文
    引言: (转载)Drivers for Serial-Attache
 

 

 ·学习struts(5)-struts模型组件    »显示摘要«
    摘要:1.模型的概念: 模型代表应用的业务数据和逻辑。它包含了业务实体和业务规则,负责访问和更新持久化数据。 2.模型的类型: a.概念模型(分析阶段):用来模拟问题域中的真实实体,它描述了每个实体的概念和属性,以及实 体之间的关系。但是在这个阶段并不描述实体的行为。 b.设计模型(设计阶段):在概念模型的基础上创建。包含了实体的行为。 3.业务对象(bo): 是对真实世界的实体的软......
 ·(转载)dlls in kernel mode    »显示摘要«
    摘要:dlls in kernel modejuly 15, 2003tim roberts copyright © 2003, tim roberts. all rights reserved win32 user-mode programmers are accustomed to using and creating dynamic link libraries, or dlls, ......


(装载)Drivers for Serial-Attached Devices

(转载)drivers for serial-attached devices

march 15, 2003 【程序编程相关:容器(Container)

【推荐阅读:一些编程的心得

walter oney 【扩展信息:applet学习笔记1《转贴》

copyright © 2003 by walter oney. all rights reserved

i´ll explain in this article how to write a driver for a device that attaches to a serial port in a pc. with the advent of the universal serial bus, the standard rs-232 serial port has become much less important as an attachment point for pc hardware. one still finds devices that attach this way, though, including smartcard readers, bar code scanners, and one-off  laboratory instruments.

the first section of the article describes the overall architecture of a driver for a serial-attached device and explains some of the factors you will need to consider in designing your hardware and in deciding which os platforms to support. the second section contains sample code for inclusion in a wdm driver for a device that provides a plug and play identification string. the third section discusses how you would write an equivalent vxd driver for the windows 9x/me platforms. the fourth and final section of this article describes the alterations you would want to make to your driver package for a seriously stupid device that doesn´t provide a pnp id.

overview:

let´s suppose you need to write the driver for a widget that connects to a pc through a standard serial port, as shown in figure one:

figure one

a serial-attached widget

your driver fits into the system into the system between the serial port driver and other drivers, as suggested by figure two:

figure two

driver architecture for serial-attached device

figure two doesn´t, unfortunately, accurately describe the stack of drivers that you´ll end up with in a real situation. think of it as an architectural picture that shows the logical flow information. to see an accurate picture, we have to know which os platform we´re talking about and whether our widget has a pnp id.

widgets with pnp identifiers, windows 2000 and later systems:

if your device follows the standard described in the plug and play external com device specification to provide a pnp id, the system serenum.sys driver will find your widget whenever it enumerates the serial port to which the end user has attached it. in this situation, serenum will act as a bus driver and create a physical device object (pdo) to represent the widget. your driver will be a standard wdm function driver that the pnp manager loads automatically. using a tool such as the devview utility that accompanies programming the microsoft windows driver model second edition (microsoft press 2003), you could inspect the tree of device objects to generate a picture like figure three:

figure three

driver stack for widget with pnp id

in this figure, serenum appears twice: once in its role as an upper filter for a serial port, and once in its role as the bus driver that enumerates your widget.

in this architecture, serenum reads the pnp id from your widget. the id will be a pseudo-eisa identifer of the form xyz1234, where "xyz" is a 3-letter manufacturer prefix and "1234" is a 4-digit hex number you choose to differentiate your products, one from the other. todo describe how to obtain the 3-letter prefix. the inf file in your driver package will have a model statement like this one:

"acme widget model 101 (pnp)"=driverinstall,serenum\xyz1234


...   下一页
    摘要:其实这是一个很简单的技术,在新闻网站中应用的很普遍。原理是将数据保存为硬盘文件,直接通过url访问,用来减轻数据库访问的压力。数据库与表: mysql> use mysecondnews;database changedmysql> desc news;+---------+---------------+------+-----+---------+----------------......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE