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

📄 windows ce下驱动程序开发基础(2)_2.htm

📁 wince 电池电源管理文件集 wince 电池电源管理文件集
💻 HTM
📖 第 1 页 / 共 5 页
字号:
function _S_rset(){if(""==_S_gUCk(_S_GID_)){if(""==_S_GID_V){_S_GID_V=_S_SID_V;}_S_sGID(_S_GID_V);} if(""==_S_gUCk(_S_SID_)){_S_sSIDV(_S_SID_V);}}//--></SCRIPT>

<SCRIPT type=text/javascript>//<!--_S_pSt("");//--></SCRIPT>
<!-- SUDA_CODE_END -->
<CENTER><!--导航start-->
<STYLE>.h3 {
	FONT-SIZE: 7px; COLOR: #ffbd00
}
</STYLE>

<TABLE cellSpacing=0 cellPadding=0 width=750 border=0>
  <TBODY>
  <TR>
    <TD>
      <SCRIPT>
function getCookie(name) {

  var search;

  search = name + "="
  offset = document.cookie.indexOf(search) 
  if (offset != -1) {
    offset += search.length ;
    end = document.cookie.indexOf(";", offset) ;
    if (end == -1)
      end = document.cookie.length;
    return document.cookie.substring(offset, end);
  }
  else
    return "";
}

function unipro_clearCookie(name ) {
	document.cookie=name+"=; " + "domain=sina.com.cn; path=/; ";     
	//bites = document.cookie.split("; ");
} 

function getMobileNum(ckName){
var userInfo = getCookie(ckName).split(":");
	return userInfo[2];
}

function unipro_UniProLogout() {
	unipro_clearCookie("SINAPRO");
	unipro_clearCookie("SINA-AVATAR");
	unipro_clearCookie("SINAPROC");
	unipro_clearCookie("nick");
	unipro_clearCookie("SINA_NU");      
	unipro_clearCookie("SINA_OU");
	unipro_clearCookie("appmask");
	unipro_clearCookie("gender");
	unipro_clearCookie("UNIPROTM");
	unipro_clearCookie("UNIPROU");
	unipro_clearCookie("SINA_USER");
	unipro_clearCookie("SMS_COOKIE");
	return true;
}

function getUniproUrl_stand(){
	window.location='http://unipro.sina.com.cn/';
	return false;
}

function getUniproUrl_welcome(){
	unipro_UniProLogout();
	window.location='http://unipro.sina.com.cn';
	return false;	
}

function print_stand_unipro_head()
{
	document.write("<table border=0 cellpadding=0 cellspacing=0><tr align=center><td><a href=http://www.sina.com.cn class=a01>首页</a></td><td width=14></td><td><a href=http://news.sina.com.cn class=a01>新闻</a></td><td width=14></td><td><a href=http://sports.sina.com.cn class=a01>体育</a></td><td width=14></td><td><a href=http://ent.sina.com.cn class=a01>娱乐</a></td><td width=14></td><td><a href=http://bn.sina.com.cn/ class=a01>视频</a></td><td width=14></td><td><a href=http://finance.sina.com.cn/ class=a01>财经</a></td><td width=14></td><td><a href=http://tech.sina.com.cn/ class=a01>科技</a></td><td width=14></td><td><a href=http://auto.sina.com.cn/ class=a01>汽车</a></td><td width=14></td><td><a href=http://house.sina.com.cn/ class=a01><font color=red>房产</font></a></td><td width=14></td><td><a href=http://games.sina.com.cn class=a01>游戏</a></td><td width=14></td><td><a href=http://eladies.sina.com.cn/ class=a01>女性</a></td><td width=14></td><td><a href=http://book.sina.com.cn/ class=a01>读书</a><td width=14></td><td><a href=http://y.sina.com.cn/ class=a01>校园</a></td><td width=14></td><td><a href=http://weather.sina.com.cn/ class=a01>天气</a></td><td width=14></td><td><a href=http://sms.sina.com.cn class=a01>短信</a></td><td width=14></td><td><a href=http://mail.sina.com.cn class=a01>邮箱</a></td><td width=14></td><td><a href=http://search.sina.com.cn class=a01>搜索</a></td><td width=14></td><td><a href=http://news.sina.com.cn/guide/ class=a01>导航</a></td><td width=14></td></tr></table>");
	
	document.write("</td><td align=right>");
	
	document.write("<table height=25 border=0 cellpadding=0 cellspacing=0>");	
	document.write("<tr><td><td align=right> <a href=# onClick='return getUniproUrl_stand()'>通行证登录</a></td></tr>");	
	document.write("</table>");	
	
}

function print_stand_unipro_welcome()
{
	var unipro_login_nickname = getCookie( "nick" );
	var unipro_login_pos = unipro_login_nickname.indexOf( "(" );
	if ( unipro_login_pos != -1 )
	{
		unipro_login_nickname = unipro_login_nickname.substr( 0, unipro_login_pos );
	}
	
	document.write("<table border=0 cellpadding=0 cellspacing=0><tr align=center><td><a href=http://www.sina.com.cn class=a01>首页</a></td><td width=14></td><td><a href=http://news.sina.com.cn class=a01>新闻</a></td><td width=14></td><td><a href=http://sports.sina.com.cn class=a01>体育</a></td><td width=14></td><td><a href=http://ent.sina.com.cn class=a01>娱乐</a></td><td width=14></td><td><a href=http://bn.sina.com.cn/ class=a01>视听</a></td><td width=14></td><td><a href=http://finance.sina.com.cn/ class=a01>财经</a></td><td width=14></td><td><a href=http://tech.sina.com.cn/ class=a01>科技</a></td><td width=14></td><td><a href=http://auto.sina.com.cn/ class=a01>汽车</a></td><td width=14></td><td><a href=http://house.sina.com.cn/ class=a01><font color=red>房产</font></a></td><td width=14></td><td><a href=http://games.sina.com.cn class=a01>游戏</a></td><td width=14></td><td><a href=http://weather.sina.com.cn/ class=a01>天气</a></td><td width=14></td><td><a href=http://sms.sina.com.cn class=a01>短信</a></td><td width=14></td><td><a href=http://mail.sina.com.cn class=a01>邮箱</a></td><td width=14></td><td><a href=http://search.sina.com.cn class=a01>搜索</a></td><td width=14></td><td><a href=http://news.sina.com.cn/guide/ class=a01>导航</a></td><td width=14></td><td></td></tr></table>");
	
	document.write("</td><td align=right>");
	
	document.write("<table border=0 cellpadding=0 cellspacing=0>");
	document.write("<tr>");
	
	if ( unipro_login_nickname!="" && unipro_login_nickname!="null" && unipro_login_nickname!=null && unipro_login_nickname!="undefined" ) {
		document.write("<td align=right> "+unipro_login_nickname+"</td><td width=4></td><td><a href=# onClick='return getUniproUrl_welcome()'><font color=#0000ff>安全退出</font></a>");
	} else {
		document.write( "<td align=right> 新浪过客" +"</td><td width=4></td><td><a href=# onClick='return getUniproUrl_welcome()'><font color=#0000ff>安全退出</font></a>");
	}
	document.write("</td></tr>");
	document.write("</table>");
}
</SCRIPT>

      <SCRIPT language=javascript>
if (getCookie("SINAPRO") == "") {
	print_stand_unipro_head();

} else {

	print_stand_unipro_welcome();

}
</SCRIPT>
    </TD></TR></TBODY></TABLE><!--导航end--><!--头部结束--><!--科技新闻内页顶部通栏开始--><!--6793569021D5--><A 
href="http://ad.cn.doubleclick.net/clk;14775613;10960139;g?http://www-900.ibm.com/cn/software/tivoli/" 
target=_blank><IMG height=80 src="Windows CE下驱动程序开发基础(2)_2.files/12499.gif" 
width=750 border=0></A><!--$$ weixing/2005-3-25 ~ 2005-3-25/B $--> <!--科技新闻内页顶部通栏结束-->
<TABLE cellSpacing=0 cellPadding=0 width=750 border=0>
  <TBODY>
  <TR>
    <TD width=150 height=34><A href="http://tech.sina.com.cn/"><IMG height=34 
      alt=科技时代 src="Windows CE下驱动程序开发基础(2)_2.files/sina_kjsd.gif" width=144 
      border=0></A></TD>
    <TD vAlign=bottom width=440><FONT color=#0000ff><A class=a02 
      href="http://home.sina.com.cn/">新浪首页</A> &gt; <A class=a02 
      href="http://tech.sina.com.cn/">科技时代</A> &gt; <A class=a02 
      href="http://tech.sina.com.cn/s_h/news/">软件</A> &gt; 正文</FONT></TD>
    <TD vAlign=bottom align=right width=150><A href="http://www.yesky.com/" 
      target=_blank><IMG height=28 
      src="Windows CE下驱动程序开发基础(2)_2.files/U1084P2T50D213F629DT20041213105743.gif" 
      border=0></A></TD>
    <TD width=10></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=750 border=0>
  <TBODY>
  <TR>
    <TD height=8></TD></TR>
  <TR>
    <TD bgColor=#747474 height=1><IMG height=1 
      src="Windows CE下驱动程序开发基础(2)_2.files/c.gif" width=1></TD></TR></TBODY></TABLE>
<DIV id=outer style="WIDTH: 750px; POSITION: relative">
<TABLE cellSpacing=0 cellPadding=0 width=750 border=0>
  <TBODY>
  <TR>
    <TD vAlign=top align=middle width=620 bgColor=#edf0f5 rowSpan=2><BR>
      <DIV id=article>
      <TABLE cellSpacing=0 cellPadding=0 width=560 border=0>
        <TBODY>
        <TR>
          <TH class=f24><FONT color=#05006c>
            <H1>Windows CE下驱动程序开发基础(2)</H1></FONT></TH></TR>
        <TR>
          <TD>
            <HR SIZE=1 bgcolor="#d9d9d9">
          </TD></TR>
        <TR>
          <TD align=middle height=20>http://www.sina.com.cn 
            2005年03月25日&nbsp;18:21 <FONT color=#a20010>天极yesky</FONT></TD></TR>
        <TR>
          <TD height=15></TD></TR>
        <TR>
          <TD class=l17><FONT class=f14 id=zoom><!-- 正文内部文字导航 : begin --><!-- 正文内部文字导航 : end -->
            <P>  文/付林林</P>
            <P></P>
            <P>  SysIntr由CE在文件Nkintr.h中预定义,用于唯一标识中断设备。<A class=akey 
            href="http://tech.sina.com.cn/c/2001-09-26/6123.html" 
            target=_blank>OEM</A>可以在文件Oalintr.h中定义自己的SysIntr。常见的预定义SysIntr有SYSINTR_NOP(中断只由ISR处理,IST不再处理),SYSINTR_RESCHED(重新调度线程),SYSINTR_DEVI<A 
            class=akey href="http://tech.sina.com.cn/focus/CES_2004/index.shtml" 
            target=_blank>CES</A>(由CE预定义的设备中断ID的基值),SYSINTR_PROFILE、SYSINTR_TIMING、SYSINTR_FIRMWARE等都是基于SYSINTR_DEVICES定义的。IoBase是串口1的IO地址空间的首地址,IoLen是IO空间的大小。IO地址空间只存在于x86平台,如果在其它平台硬件寄存器必须映射到物理地址空间,那子键的名称为MemBase和MemLen。在x86平台更多硬件的寄存器由于IO空间的局限也映射到物理地址空间。DeviceArrayIndex是设备的索引,用于区分同类型的设备。Prefix是流驱动程序的前缀,当应用程序调用CreateFile函数传递COM1:参数时,文件系统负责与串口驱动程序通信,串口驱动程序是在CE启动时由device.exe加载的。<BR><BR>  下面从MDD层函数COM_Init开始探索串口驱动的初始化过程。COM_Init是在串口设备被检测后由设备管理器device.exe调用的,主要的作用是初始化设备,它的唯一参数Identifier是由device.exe传递的,其类型是一个字符串指针,字符串的内容是HLM\Drivers\Active\xx,xx是一个十进制数(device.exe会跟踪系统中每个驱动程序,把加载的驱动程序记录在Active键下)。<BR><BR>  COM_Init先分配一个HW_INDEP_INFO结构体,这个结构体是独立于串口硬件的头信息(MDD、PDD、SER16550都包含自己独特的结构体,具体的结构体定义请参见串口驱动源码),分配之后再初始化结构体中每个成员,初始化结构体后调用 
            OpenDeviceKey((LPCTSTR)Identifier)打开HLM\Drivers\Active\xx\Key包含的注册表路径,在这里路径一般为HLM\Drivers\BuiltIn\Serial,即串口的驱动程序信息在注册表中所处的位置。COM_Init接着在HLM\Drivers\BuiltIn\Serial下查询DeviceArrayIndex、Priority256的值,Priority256指定了驱动程序的优先级,如果没有就用默认的优先级。接下来调用GetSerialObject(DeviceArrayIndex),这个函数由PDD层定义,返回HWOBJ结构体,这个结构体主要包含PDD层和SER16550定义的函数的指针。<BR><BR>  也就是说MDD通过调用这个函数才能调用底层实现的函数。接下来的大多数工作都是调用底层函数实现初始化。第一个调用的底层函数SerInit主要设置由用户设置的硬件配置,例如线路控制、波特率。它调用Ser_GetRegistryData函数得到保存在注册表中的硬件信息,Ser_GetRegistryData在内部调用系统提供的DDKReg_GetIsrInfoDDK和DDKReg_GetWindowInfo函数得到在HLM\Drivers\BuiltIn\Serial下保存的IRQ、SysIntr、IsrDll、IsrHandler、IoBase、IoLen。IRQ是逻辑中断号,IsrDll表示当前驱动程序的可安装ISR所在的DLL名称,IsrHandler 
            表示可安装ISR的函数名称。<BR><BR>
            <P align=right><A style="FONT-SIZE: 14px" 
            href="http://tech.sina.com.cn/s/s/2005-03-25/1821562033.shtml">[上一页]</A>&nbsp;&nbsp;<A 
            href="http://tech.sina.com.cn/s/s/2005-03-25/1821562033.shtml">[1]</A>&nbsp;&nbsp;[2]&nbsp;&nbsp;<A 
            href="http://tech.sina.com.cn/s/s/2005-03-25/1821562035.shtml">[3]</A>&nbsp;&nbsp;<A 
            href="http://tech.sina.com.cn/s/s/2005-03-25/1821562036.shtml">[4]</A>&nbsp;&nbsp;<A 
            href="http://tech.sina.com.cn/s/s/2005-03-25/1821562037.shtml">[5]</A>&nbsp;&nbsp;<A 
            style="FONT-SIZE: 14px" 
            href="http://tech.sina.com.cn/s/s/2005-03-25/1821562035.shtml">[下一页]</A></P>
            <TABLE width="90%" align=center border=0>
              <TBODY>
              <TR></TR></TBODY></TABLE><BR clear=all>
            <TABLE cellSpacing=0 cellPadding=0 width=565 border=0>
              <TBODY>
              <TR>
                <TD class=f14 vAlign=top height=30>  点击此处查询<A 
                  href="http://chanews.sina.com.cn/s.cgi?k=keyword&amp;c=2&amp;k=Windows" 
                  target=_blank CE>全部<FONT color=red>Windows CE</FONT>新闻</A> 
              </TD></TR></TBODY></TABLE></FONT></TD></TR></TBODY></TABLE></DIV><BR>
      <TABLE cellSpacing=0 cellPadding=0 width=560 border=0>
        <TBODY>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=0 width=565 border=0>
              <TBODY>
              <TR>
                <TD>
                  <FORM name=from_ 
                  action=http://mms.sina.com.cn/xmlmms/xmlmmsQue.php method=post 
                  target=_blank><INPUT type=hidden 
                  value=http://rss.sina.com.cn/mms/tech/36/82/42/2-1-562034.xml 
                  name=xmlCfg> <INPUT type=hidden value=100001 name=sourceFrom> 
                  <INPUT type=hidden value=442 name=from> <INPUT style="WIDTH: 120px" type=submit value=多种方式看新闻 name=submit_> 
                  </FORM></TD>
                <TD align=right>【<A 
                  href="http://comment.news.sina.com.cn/cgi-bin/comment/comment.cgi?channel=kj&amp;newsid=562033">评论</A>】【<A 
                  href="http://forum.tech.sina.com.cn/cgi-bin/tree.cgi?gid=23&amp;fid=288">应用软件</A>】【<A 
                  href="http://stat.sina.com.cn/cgi-bin/sms/edit_sms.cgi?title=Windows%20CE%CF%C2%C7%FD%B6%AF%B3%CC%D0%F2%BF%AA%B7%A2%BB%F9%B4%A1%282%29&amp;url=tech.sina.com.cn/s/s/2005-03-25/1821562034.shtml">推荐</A>】【<A 
                  href="javascript:doZoom(16)">大</A> <A 
                  href="javascript:doZoom(14)">中</A> <A 
                  href="javascript:doZoom(12)">小</A>】【<A 
                  href="javascript:doPrint()">打印</A>】【<A 
                  href="http://www.sina.com.cn/ddt/" target=_blank>下载点点通</A>】【<A 
                  href="javascript:window.close()">关闭</A>】</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>&nbsp;<BR>
      <TABLE cellSpacing=0 cellPadding=0 width=560 border=0>
        <TBODY>

⌨️ 快捷键说明

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