阅读:850回复:2
高手指点:quickvxd对isa卡终端加载后,没有响应。
我的一计数卡对isa卡端中断12进行的虚拟化,在示波器上可以看见每秒100个中断,程序也加载上了,但是没有中断响应 ,能帮我找下原因吗
原码如下: .h文件 #define MY_IRQ 11 class MyHwInt:public VSharedHardwareInt { public: MyHwInt():VSharedHardwareInt(MY_IRQ,0,0,0){} virtual BOOL OnSharedHardwareInt(VMHANDLE); } ; class WintDevice : public VDevice { public: virtual BOOL OnSysDynamicDeviceInit(); virtual BOOL OnSysDynamicDeviceExit(); virtual DWORD OnW32DeviceIoControl(PIOCTLPARAMS pDIOCParams); }; class WintVM : public VVirtualMachine { public: WintVM(VMHANDLE hVM); }; class WintThread : public VThread { public: WintThread(THREADHANDLE hThread); }; .cpp文件 #include<VSD.h> THREADHANDLE TheThread=0; MyHwInt *pMyInt; PVOID CallBackApc=0; int x=0; WintVM::WintVM(VMHANDLE hVM) : VVirtualMachine(hVM) {} WintThread::WintThread(THREADHANDLE hThread) : VThread(hThread) {} BOOL WintDevice::OnSysDynamicDeviceInit() { return TRUE; } BOOL WintDevice::OnSysDynamicDeviceExit() { return TRUE; } DWORD WintDevice::OnW32DeviceIoControl(PIOCTLPARAMS pDIOCParams) { switch(pDIOCParams->dioc_IOCtlCode) { case DIOC_OPEN: pMyInt=new MyHwInt(); if(!pMyInt||!pMyInt->hook()) { return -1; } return 0; case DIOC_CLOSEHANDLE: if(pMyInt) delete pMyInt; return 0; case ADDRESSPASS: CallBackApc=pDIOCParams->dioc_InBuf; TheThread=Get_Cur_Thread_Handle(); return 0; default : return -1; } return 0; } BOOL MyHwInt::OnSharedHardwareInt(VMHANDLE hVM) { x++; if(x>=100) { VWIN32_QueueUserApc(CallBackApc, (DWORD)&x, TheThread); VSD_Bell(); x=0; } sendPhysicalEOI(); return 0; } ring3层文件我使用bcb编的 HANDLE hDevice; hDevice=CreateFile(\"\\\\\\\\.\\\\Clock.vxd\",0,0,0,CREATE_ALWAYS,FILE_FLAG_DELETE_ON_CLOSE,0); if(hDevice==INVALID_HANDLE_VALUE) { ShowMessage(\"aaaaa\"); Edit1->Text=GetLastError(); } if(!DeviceIoControl(hDevice,ADDRESSPASS,CallBackAPC,0,0,0,0,0)) { ShowMessage(\"bbbbb\"); } while(true) { SleepEx(INFINITE,true) ; } CloseHandle(hDevice); 显示中断已经加载上了,但没响应 |
|
沙发#
发布于:2003-08-01 16:22
你把8259 IMR寄存器的值读出来看一下。
|
|
|
板凳#
发布于:2003-08-03 11:09
能指点一下怎么读吗?
|
|