But I receive status=0xC0000034.
Currently I think that I don’t use information from IrpStack->Parameters.StartDevice*. And I don’t know if I shoud add something into INF file.
Could somebody explain me how to register an ISR?
You cannot fill in a resource structure and get an interrupt, or any
other resource for that matter. You need to specify the device and have
the system provide you the resources, or if it is non-PMP use LogConfig
in the INF file to specify the interrupt vector. Note: if there is no
device and you are trying to be clever and use an INT instruction quit
now, you aren’t going to have good results.
> Hellow. > I have a task: write a driver capable to accept an interrupt. > For two wiks I’ve been studing the Toaster example from WDK and changed it as: > - in bus driver where IRP_MN_QUERY_RESOURCE_REQUIREMENTS for child’s PDO fill IO_RESOURCE_REQUIREMENTS_LIST structure as > > resourceList->ListSize = resourceListSize; > resourceList->AlternativeLists = 1; > resourceList->InterfaceType = ProcessorInternal; > resourceList->BusNumber = 0; > resourceList->List[0].Version = 1; > resourceList->List[0].Revision = 1; > resourceList->List[0].Count = 1; > descriptor = resourceList->List[0].Descriptors; > descriptor->Type = CmResourceTypeInterrupt; > descriptor->ShareDisposition = CmResourceShareDeviceExclusive; > //descriptor->Flags = ???; > descriptor->u.Interrupt.MinimumVector = 0; > descriptor->u.Interrupt.MaximumVector = 0xFF; > > - in functional driver for a device in IRP_MN_START_DEVICE handler add > > intParams.Version = CONNECT_LINE_BASED; > intParams.LineBased.PhysicalDeviceObject = DeviceObject; > intParams.LineBased.InterruptObject = &DeviceData->InterruptObject; > intParams.LineBased.ServiceRoutine = ToasterInterruptService; > intParams.LineBased.ServiceContext = DeviceData; > intParams.LineBased.SpinLock = NULL; > intParams.LineBased.SynchronizeIrql = 0; > intParams.LineBased.FloatingSave = FALSE; > > status = IoConnectInterruptEx(&intParams); > > But I receive status=0xC0000034. > Currently I think that I don’t use information from IrpStack->Parameters.StartDevice*. And I don’t know if I shoud add something into INF file. > Could somebody explain me how to register an ISR? > > Thank you.
Done Burn, thank you for fast answer! But could you be more concrete.
I don’t want to use INT instruction. May be I will write some virtual device to Bochs. But now I want to study how it works.
I have read that to make system provide me some resources I have to fill IO_RESOURCE_REQUIREMENTS_LIST structure in IRP_MN_QUERY_RESOURCE_REQUIREMENTS handler. More over in Toaster example one could see how author claim for port in such a handler. I have just rewrite CmResourceTypePort to CmResourceTypeInterrupt.
Could You please provide some example of using IoConnectInterruptEx for registring an ISR in PnP driver?
Virtual drivers can’t get resources, port, io it interrupts. What you see in toaster is quite old and only works on 32 bit systems. As don said, you are in the wrong path.
d
debt from my phone
From: xxxxx@gmail.com
Sent: 8/27/2012 6:34 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] IoConnectInterruptEx - how to use
Done Burn, thank you for fast answer! But could you be more concrete.
I don’t want to use INT instruction. May be I will write some virtual device to Bochs. But now I want to study how it works.
I have read that to make system provide me some resources I have to fill IO_RESOURCE_REQUIREMENTS_LIST structure in IRP_MN_QUERY_RESOURCE_REQUIREMENTS handler. More over in Toaster example one could see how author claim for port in such a handler. I have just rewrite CmResourceTypePort to CmResourceTypeInterrupt.
Could You please provide some example of using IoConnectInterruptEx for registring an ISR in PnP driver?
The pcidrv sample in the Win7 WDK shows how to use IoConnectInterrupt,
the Ex versions are just an extension. First since it is obvious you
are still learning this stuff, why are you using WDM instead of KMDF.
The number of cases to use WDM in a driver is extremely limited, and
throw in for a real device and they become too small to care. As Doron
already pointed out you can’t just grab an interrupt in a bus driver,
and the code in toaster should really be removed.
If you want to play with a real device, either get the OSR test board,
or a NIC compatible with PCIDRV and go at it. But for your own sanity
and for code quality in general, use KMDF.
> Done Burn, thank you for fast answer! But could you be more concrete. > 1. I don’t want to use INT instruction. May be I will write some virtual device to Bochs. But now I want to study how it works. > 2. I have read that to make system provide me some resources I have to fill IO_RESOURCE_REQUIREMENTS_LIST structure in IRP_MN_QUERY_RESOURCE_REQUIREMENTS handler. More over in Toaster example one could see how author claim for port in such a handler. I have just rewrite CmResourceTypePort to CmResourceTypeInterrupt. > 3. Could You please provide some example of using IoConnectInterruptEx for registring an ISR in PnP driver?
Hellow.
I have another quastion. I’m studding a PCIDRV example. And I cann’t to install it (neither KMDF no WDM). I’m trying to update driver for ethernet controller, choose file from disk and point to genpci.inf. But I get notification something like this: there’s no driver found in a folder compatible with this device. Or something like that.
More interestigly that I could use toaster’s bus driver for ethernet controller. Even more if I choose toaster.inf it uses bus.inf instead (they are in same directory).
How should I install this driver?
Thank you.
Did you modify the INF file to include your PCI ID in it?
Calvin
On Mon, Sep 3, 2012 at 6:19 AM, wrote:
> Hellow. > I have another quastion. I’m studding a PCIDRV example. And I cann’t to > install it (neither KMDF no WDM). I’m trying to update driver for ethernet > controller, choose file from disk and point to genpci.inf. But I get > notification something like this: there’s no driver found in a folder > compatible with this device. Or something like that. > More interestigly that I could use toaster’s bus driver for ethernet > controller. Even more if I choose toaster.inf it uses bus.inf instead (they > are in same directory). > How should I install this driver? > Thank you. > > — > NTDEV is sponsored by OSR > > For our schedule of WDF, WDM, debugging and other seminars visit: > http://www.osr.com/seminars > > To unsubscribe, visit the List Server section of OSR Online at > http://www.osronline.com/page.cfm?name=ListServer >
Thank you, it’s work! I’ve changed PCI\VEN_8086&DEV_1229 to my own. But driver could not be installed due to absence of WdfConinstaller01009.dll. I’ll try to dill with it.
WdfConinstaller01009.dll could be found into \7600.16385.1\redist\wdf\amd64. And driver installation have been started. But failed with BSOD and bug check 0x50 - PAGE_FAULT_IN_NONPAGED_AREA. So I will start debugging the driver.