pengfeu
驱动牛犊
驱动牛犊
  • 注册日期2004-03-27
  • 最后登录2004-07-17
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1150回复:8

版主,高手,YMD1023等等帮我看看吧

楼主#
更多 发布于:2004-04-29 15:15
我编写的isa驱动只要求从io地址读取数据我定义了m_IoPortRange1为端口.我的serialread例程如下:
void Isa3Device::SerialRead(KIrp I)
{
NTSTATUS status = STATUS_SUCCESS;
// Declare a memory object
KMemory Mem(I.Mdl());
PUCHAR pBuffer = (PUCHAR) Mem.MapToSystemSpace();
ULONG   dwTotalSize = I.ReadSize(CURRENT);
ULONG   dwBytesRead = 0;
for(int i = 0;i<dwTotalSize;i++)
*pBuffer++ = m_IoPortRange1.inb(i);
I.Information() = dwTotalSize;
I.Status() = status;
PnpNextIrp(I);
}
无法从端口读取数据.请帮帮忙指点一下该如何改写serialread例程.
Ymd1023
驱动中牛
驱动中牛
  • 注册日期2002-11-22
  • 最后登录2008-05-07
  • 粉丝0
  • 关注0
  • 积分22分
  • 威望3点
  • 贡献值0点
  • 好评度2点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2004-04-29 16:13
sorry,我以前是搞硬件,也是现在才开始学写驱动的,而且用WINDRIVER。

---------------------------------------------
不好意思,实在无能为力!
YMD
pengfeu
驱动牛犊
驱动牛犊
  • 注册日期2004-03-27
  • 最后登录2004-07-17
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2004-04-29 17:12
你是用windriver吗??那能帮帮我怎么生成*inf文件呀??
Ymd1023
驱动中牛
驱动中牛
  • 注册日期2002-11-22
  • 最后登录2008-05-07
  • 粉丝0
  • 关注0
  • 积分22分
  • 威望3点
  • 贡献值0点
  • 好评度2点
  • 原创分0分
  • 专家分0分
地板#
发布于:2004-04-29 17:25
WINDRIVER启动后选择ISA设备不是有生成INF文件的按钮吗?
YMD
bingjie
驱动小牛
驱动小牛
  • 注册日期2001-08-15
  • 最后登录2007-11-29
  • 粉丝0
  • 关注0
  • 积分36分
  • 威望5点
  • 贡献值0点
  • 好评度3点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2004-04-29 17:26
;; YourDriver.inf

;; *********  PLEASE READ ***********
;; The wizard cannot create exact INF files for all buses and device types.
;; You may have to make changes to this file in order to get your device to
;; install. In particular, hardware IDs and logical configurations require
;; intervention.
;;
;; The Win2K DDK documentation contains an excellent INF reference.

;--------- Version Section ---------------------------------------------------

[Version]
Signature=\"$Windows 95$\"
Provider=%ProviderName%

; If device fits one of the standard classes, use the name and GUID here,
; otherwise create your own device class and GUID as this example shows.

Class=NewDeviceClass
ClassGUID={ff646f80-8def-11d2-9449-00105a075f6b}

;--------- SourceDiskNames and SourceDiskFiles Section -----------------------

; These sections identify source disks and files for installation.  They are
; shown here as an example, but commented out.

;[SourceDisksNames]
;1 = \"Install Disk\",Disk1,,

;[SourceDisksFiles]
;YourDriver.sys = 1,,

;--------- ClassInstall/ClassInstall32 Section -------------------------------

; Not necessary if using a standard class

; 9X Style
[ClassInstall]
Addreg=Class_AddReg

; NT Style
[ClassInstall32]
Addreg=Class_AddReg

[Class_AddReg]
HKR,,,,%DeviceClassName%
HKR,,Icon,,\"-18\"

;--------- DestinationDirs Section -------------------------------------------

[DestinationDirs]
YourDriver_Files_Driver = 10,System32\\Drivers

;--------- Manufacturer and Models Sections ----------------------------------

[Manufacturer]
%MfgName%=Mfg0

[Mfg0]
%DeviceDesc%=YourDriver_DDI, Your_DeviceID

;---------- DDInstall Sections -----------------------------------------------
; --------- Windows 9X -----------------

; Experimentation has shown that DDInstall root names greater than 19 characters
; cause problems in Windows 98

[YourDriver_DDI]
CopyFiles=YourDriver_Files_Driver
AddReg=YourDriver_9X_AddReg

[YourDriver_9X_AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,YourDriver.sys
HKR, \"Parameters\", \"BreakOnEntry\", 0x00010001, 0

; --------- Windows NT -----------------

[YourDriver_DDI.NT]
CopyFiles=YourDriver_Files_Driver
AddReg=YourDriver_NT_AddReg

[YourDriver_DDI.NT.Services]
Addservice = YourDriver, 0x00000002, YourDriver_AddService

[YourDriver_AddService]
DisplayName    = %SvcDesc%
ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
StartType      = 3                  ; SERVICE_DEMAND_START
ErrorControl   = 1                  ; SERVICE_ERROR_NORMAL
ServiceBinary  = %10%\\System32\\Drivers\\YourDriver.sys

[YourDriver_NT_AddReg]
HKLM, \"System\\CurrentControlSet\\Services\\YourDriver\\Parameters\",\\
\"BreakOnEntry\", 0x00010001, 0


; --------- Files (common) -------------

[YourDriver_Files_Driver]
YourDriver.sys

;--------- Strings Section ---------------------------------------------------

[Strings]
ProviderName=\"Your Company Name here\"
MfgName=\"Name of HW Manufacturer here\"
DeviceDesc=\"Description of Device here\"
DeviceClassName=\"Description of Device class here\"
SvcDesc=\"Description of NT service here\"
pengfeu
驱动牛犊
驱动牛犊
  • 注册日期2004-03-27
  • 最后登录2004-07-17
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2004-04-29 18:10
选不了,都是灰色的.
CYoung
驱动中牛
驱动中牛
  • 注册日期2003-06-10
  • 最后登录2005-01-04
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
6楼#
发布于:2004-04-29 21:19
*pBuffer++ = m_IoPortRange1.inb(i);

这里有问题
答得好的话,请兄弟们加点分,那是对我的肯定
SUNSHANGXIN
驱动老牛
驱动老牛
  • 注册日期2002-11-19
  • 最后登录2009-08-01
  • 粉丝0
  • 关注0
  • 积分21分
  • 威望19点
  • 贡献值0点
  • 好评度9点
  • 原创分0分
  • 专家分0分
7楼#
发布于:2004-04-30 02:11
 :(
[b]苍白的,不是文字,是人的思想 虚伪的,不是网络,是人的灵魂 伤心的,不是爱情,是人的心灵 难忘的,不是容貌,是人的思诀 黎明的曙光早已不见了夕日的辉煌 东方的日出早就失去了往日的灿烂 而我也尽脱了昨日的笑容去迎接明天的枯涩 [/b]
pengfeu
驱动牛犊
驱动牛犊
  • 注册日期2004-03-27
  • 最后登录2004-07-17
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
8楼#
发布于:2004-04-30 09:33
有问题的话,我该怎么更改这段语句呢?????
游客

返回顶部