阅读:1164回复:8
版主,高手,YMD1023等等帮我看看吧
我编写的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例程. |
|
沙发#
发布于:2004-04-29 16:13
sorry,我以前是搞硬件,也是现在才开始学写驱动的,而且用WINDRIVER。
--------------------------------------------- 不好意思,实在无能为力! |
|
|
板凳#
发布于:2004-04-29 17:12
你是用windriver吗??那能帮帮我怎么生成*inf文件呀??
|
|
地板#
发布于:2004-04-29 17:25
WINDRIVER启动后选择ISA设备不是有生成INF文件的按钮吗?
|
|
|
地下室#
发布于: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\" |
|
5楼#
发布于:2004-04-29 18:10
选不了,都是灰色的.
|
|
6楼#
发布于:2004-04-29 21:19
*pBuffer++ = m_IoPortRange1.inb(i);
这里有问题 |
|
|
7楼#
发布于:2004-04-30 02:11
:(
|
|
|
8楼#
发布于:2004-04-30 09:33
有问题的话,我该怎么更改这段语句呢?????
|
|