Legacy Driver on XP

I have a customer with a NT4.0 legacy driver, they wish to run on Windows XP
embeded. In debugging the driver, the calls to HalGetInterruptVector and
IoConnectInterrupt work correctly but no interrupts ever get signalled. For
a lot of reasons, it is not desirable to make this a PNP driver, and there
is little value in an embedded device. So can someone suggest a reason
this legacy driver would not work with Windows XP?


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting

I’ve seen this before on some platforms which drove me nuts years ago. The
reason is that HalAssigneSlotResources return bogus IRQ information but
HalGetInterruptVector seems happy with it. On W2k/xp IIRC, HAL does not seem
to enable the interrupt mask on (a)PIC if no Isr is connected to that pin,
so I saw the hardware is firing interupts in the scope but ISR is not called
and PC won’t lock.

Things even strange is HalAssigneSlotResources may return different IRQ info
if I net start/stop the driver several times in a row. Eventually I have to
make it WDM to fix it.

Calvin

Calvin Guan Software Engineer
ATI Technologies Inc. www.ati.com

-----Original Message-----
From: Don Burn [mailto:xxxxx@acm.org]
Sent: Monday, August 09, 2004 4:32 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Legacy Driver on XP

I have a customer with a NT4.0 legacy driver, they wish to
run on Windows XP
embeded. In debugging the driver, the calls to
HalGetInterruptVector and
IoConnectInterrupt work correctly but no interrupts ever get
signalled. For
a lot of reasons, it is not desirable to make this a PNP
driver, and there
is little value in an embedded device. So can someone
suggest a reason
this legacy driver would not work with Windows XP?


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@ati.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

RE: [ntdev] Legacy Driver on XPExcept the information into
HalGetInterruptVector is correct, just the interrupt routine is never
entered, even though an interrupt is generated.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting

“Calvin Guan” wrote in message news:xxxxx@ntdev…
I’ve seen this before on some platforms which drove me nuts years ago. The
reason is that HalAssigneSlotResources return bogus IRQ information but
HalGetInterruptVector seems happy with it. On W2k/xp IIRC, HAL does not seem
to enable the interrupt mask on (a)PIC if no Isr is connected to that pin,
so I saw the hardware is firing interupts in the scope but ISR is not called
and PC won’t lock.
Things even strange is HalAssigneSlotResources may return different IRQ info
if I net start/stop the driver several times in a row. Eventually I have to
make it WDM to fix it.
Calvin
-
Calvin Guan Software Engineer
ATI Technologies Inc. www.ati.com
> -----Original Message-----
> From: Don Burn [mailto:xxxxx@acm.org]
> Sent: Monday, August 09, 2004 4:32 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Legacy Driver on XP
>
>
> I have a customer with a NT4.0 legacy driver, they wish to
> run on Windows XP
> embeded. In debugging the driver, the calls to
> HalGetInterruptVector and
> IoConnectInterrupt work correctly but no interrupts ever get
> signalled. For
> a lot of reasons, it is not desirable to make this a PNP
> driver, and there
> is little value in an embedded device. So can someone
> suggest a reason
> this legacy driver would not work with Windows XP?
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@ati.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Hi!

Hm. Does it work under windows 2000? Have you tried other HALs (Standard
PC,
…)? Is that driver doing a resource-request (IoAssignResources) and then
using the returned data to setup the interrupt or is it just connecting
the
interrupt to a “known value”.
And have you checked that the device really has an interrupt pending (if
the device supports some kind of interrupt-pending-flag)?
Dumb questions, I know, but you never know :slight_smile:

Regards,
Paul Groke

I have a customer with a NT4.0 legacy driver, they wish to run on
Windows XP
embeded. In debugging the driver, the calls to HalGetInterruptVector
and
IoConnectInterrupt work correctly but no interrupts ever get signalled.
For
a lot of reasons, it is not desirable to make this a PNP driver, and
there
is little value in an embedded device. So can someone suggest a reason
this legacy driver would not work with Windows XP?


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting

Answers inline:

wrote in message news:xxxxx@ntdev…
> Hi!
>
> Hm. Does it work under windows 2000? Have you tried other HALs (Standard
> PC,
> …)?

The system requires Embedded, it works on NT4.0 embedded, but there is no
2000 Embedded so can’t even try.

Is that driver doing a resource-request (IoAssignResources) and then
> using the returned data to setup the interrupt or is it just connecting
> the
> interrupt to a “known value”.

It is using the known value method, since this is a custom singel board
computer.

> And have you checked that the device really has an interrupt pending (if
> the device supports some kind of interrupt-pending-flag)?

The interrupt pending flag is present and on, but the device does not
interrupt.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

Hi again Don!

Is that driver doing a resource-request (IoAssignResources) and then
> using the returned data to setup the interrupt or is it just
connecting
> the
> interrupt to a “known value”.

It is using the known value method, since this is a custom singel board
computer.

Well, it’s just a speculation, but maybe windows XP wants the
resoruce-request to unmask the IRQ?
Maybe it also wants a call to another function to unmask the IRQ… don’t
know.
Maybe it’s worth to just try and call IoAssignResources(), just set
MinimumVector and MaximumVector to that known-value. Then use whatever
you get returned from the system to connect the interrupt.
Maybe XP even wants you to call IoReportDetectedDevice and
IoReportResourceForDetection…
I’m really not an expert on this, but that would be the things I’d try
first.

And is this a non-pnp ISA device, or is it something different? I mean
I just wouldn’t expect a pnp-device (even if it only supports one fixed
IRQ) to work with a non-pnp driver under 2000/XP but then again I might
be wrong…

Regards,

Paul Groke

Don,

I have encountered this situation on ACPI enabled systems. Where the driver
worked fine under 4.0 yet it would fail under 2K and XP. Once I converted
the driver to PnP it worked fine. I presume it has to do with ACPI
re-routing IRQ’s, etc.

The embedded issue is irrelevant since the OS is identical for 4.0 and XP
with some added features.

Pete

Peter Scott
xxxxx@KernelDrivers.com
www.KernelDrivers.com

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-183946-
xxxxx@lists.osr.com] On Behalf Of Don Burn
Sent: Monday, August 09, 2004 1:32 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Legacy Driver on XP

I have a customer with a NT4.0 legacy driver, they wish to run on Windows
XP
embeded. In debugging the driver, the calls to HalGetInterruptVector and
IoConnectInterrupt work correctly but no interrupts ever get signalled.
For
a lot of reasons, it is not desirable to make this a PNP driver, and there
is little value in an embedded device. So can someone suggest a reason
this legacy driver would not work with Windows XP?


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@kerneldrivers.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Here are my experiences while making a legacy NT4 driver for a non PnP ISA
board running on XP:

In DriverEntry() the path to the registry became truncated, althoug it has
been correct when the function started. My first solution chosen was to use
Nonpaged Pool memory and keeping the routine only while initializing
(#pragma alloc_text (INIT, MyDriverFunction)). Maybe you cannot access
registry values in parts of you driver entry routine corresponding to
AddDevice or PnP/IRP_MN_START_DEVICE?

Some I/O addresses that are free in NT4 are occupied by XP (e.g. 0x27x by
the ISA PnP manager). Removing the PnP Manager does not help, you have to
change the I/O address of the board.

After creating your device you have to clear DO_DEVICE_INITIALIZING flag. In
NT4 this bit was automatically cleared on return from DriverEntry(). For
compatibility between NT4 and W2k/XP, where device objects are created
outside of DriverEntry(), the flag must be cleared explicitly (compare also
MS Q126368).

While reporting resources I had to set the partial descripor flags Member to
CM_RESOURCE_INTERRUPT_LATCHED explicitely (for ISA) and u.Interrupt.Affinity
to -1 (as recommended by the DDK).

The IRQ (and also other used ressources) has to be reserved in the BIOS (at
least for ISA), otherways you can randomly get your interupt or not. Once I
had one machine where this was not possible to do in the BIOS an thus the
driver did not work with similar effects to what you are reporting.



And finally I turned it into an (Pseudo) PnP driver and to me that seems to
be the best solution. Even a non PnP ISA board can be added to the root bus
via an inf file, you don’t need the BIOS and for my device the operating
system can choose the interrupt and DMA channel fitting best into the
overall resource requirements.

And thanks to the list for the many things I learned here

Michael U. Müller
Department of Medical Optics
Max Planck Institute for Medical Research
Jahnstraße 29
D-69120 Heidelberg

“Don Burn” wrote in message news:xxxxx@ntdev…
> I have a customer with a NT4.0 legacy driver, they wish to run on Windows
XP
> embeded. In debugging the driver, the calls to HalGetInterruptVector and
> IoConnectInterrupt work correctly but no interrupts ever get signalled.
For
> a lot of reasons, it is not desirable to make this a PNP driver, and there
> is little value in an embedded device. So can someone suggest a reason
> this legacy driver would not work with Windows XP?
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>
>
>
>
>

RE: [ntdev] Legacy Driver on XP The “PnP OS = No” BIOS setting plays the main role in this mechanism.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: Calvin Guan
To: Windows System Software Devs Interest List
Sent: Tuesday, August 10, 2004 12:55 AM
Subject: RE: [ntdev] Legacy Driver on XP

I’ve seen this before on some platforms which drove me nuts years ago. The reason is that HalAssigneSlotResources return bogus IRQ information but HalGetInterruptVector seems happy with it. On W2k/xp IIRC, HAL does not seem to enable the interrupt mask on (a)PIC if no Isr is connected to that pin, so I saw the hardware is firing interupts in the scope but ISR is not called and PC won’t lock.

Things even strange is HalAssigneSlotResources may return different IRQ info if I net start/stop the driver several times in a row. Eventually I have to make it WDM to fix it.

Calvin

Calvin Guan Software Engineer
ATI Technologies Inc. www.ati.com

-----Original Message-----
> From: Don Burn [mailto:xxxxx@acm.org]
> Sent: Monday, August 09, 2004 4:32 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Legacy Driver on XP
>
>
> I have a customer with a NT4.0 legacy driver, they wish to
> run on Windows XP
> embeded. In debugging the driver, the calls to
> HalGetInterruptVector and
> IoConnectInterrupt work correctly but no interrupts ever get
> signalled. For
> a lot of reasons, it is not desirable to make this a PNP
> driver, and there
> is little value in an embedded device. So can someone
> suggest a reason
> this legacy driver would not work with Windows XP?
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@ati.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Max, it rings the bell.

Changing the “PNP OS” did solve problem on some of the system in question.

Calvin Guan Software Engineer
ATI Technologies Inc. www.ati.com

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Tuesday, August 10, 2004 6:06 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Legacy Driver on XP

The “PnP OS = No” BIOS setting plays the main role in this mechanism.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com mailto:xxxxx
http://www.storagecraft.com http:

----- Original Message -----
From: Calvin Guan mailto:xxxxx
To: Windows System Software Devs Interest mailto:xxxxx List

Sent: Tuesday, August 10, 2004 12:55 AM
Subject: RE: [ntdev] Legacy Driver on XP

I’ve seen this before on some platforms which drove me nuts years ago. The
reason is that HalAssigneSlotResources return bogus IRQ information but
HalGetInterruptVector seems happy with it. On W2k/xp IIRC, HAL does not seem
to enable the interrupt mask on (a)PIC if no Isr is connected to that pin,
so I saw the hardware is firing interupts in the scope but ISR is not called
and PC won’t lock.

Things even strange is HalAssigneSlotResources may return different IRQ info
if I net start/stop the driver several times in a row. Eventually I have to
make it WDM to fix it.

Calvin
-
Calvin Guan Software Engineer
ATI Technologies Inc. www.ati.com

> -----Original Message-----
> From: Don Burn [mailto:xxxxx@acm.org mailto:xxxxx]
> Sent: Monday, August 09, 2004 4:32 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Legacy Driver on XP
>
>
> I have a customer with a NT4.0 legacy driver, they wish to
> run on Windows XP
> embeded. In debugging the driver, the calls to
> HalGetInterruptVector and
> IoConnectInterrupt work correctly but no interrupts ever get
> signalled. For
> a lot of reasons, it is not desirable to make this a PNP
> driver, and there
> is little value in an embedded device. So can someone
> suggest a reason
> this legacy driver would not work with Windows XP?
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
http:
>
> You are currently subscribed to ntdev as: xxxxx@ati.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@ati.com
To unsubscribe send a blank email to xxxxx@lists.osr.com</http:></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></http:></mailto:xxxxx>

RE: [ntdev] Legacy Driver on XP Looks like a good FAQ item, if not already in MS’s KB.

“Set PnP OS = No in BIOS if you have any interrupt vector related issues on PCI bus” - the very, very good advice.

For instance, under NT4 with PnP OS = yes, HalAssignSlotResources just skipped the IRQ, and provided the driver with register addresses only, as if the interrupt does not exist.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: Calvin Guan
To: Windows System Software Devs Interest List
Sent: Tuesday, August 10, 2004 6:29 PM
Subject: RE: [ntdev] Legacy Driver on XP

Max, it rings the bell.

Changing the “PNP OS” did solve problem on some of the system in question.

Calvin Guan Software Engineer
ATI Technologies Inc. www.ati.com

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Tuesday, August 10, 2004 6:06 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Legacy Driver on XP

The “PnP OS = No” BIOS setting plays the main role in this mechanism.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: Calvin Guan
To: Windows System Software Devs Interest List
Sent: Tuesday, August 10, 2004 12:55 AM
Subject: RE: [ntdev] Legacy Driver on XP

I’ve seen this before on some platforms which drove me nuts years ago. The reason is that HalAssigneSlotResources return bogus IRQ information but HalGetInterruptVector seems happy with it. On W2k/xp IIRC, HAL does not seem to enable the interrupt mask on (a)PIC if no Isr is connected to that pin, so I saw the hardware is firing interupts in the scope but ISR is not called and PC won’t lock.

Things even strange is HalAssigneSlotResources may return different IRQ info if I net start/stop the driver several times in a row. Eventually I have to make it WDM to fix it.

Calvin

Calvin Guan Software Engineer
ATI Technologies Inc. www.ati.com

-----Original Message-----
> From: Don Burn [mailto:xxxxx@acm.org]
> Sent: Monday, August 09, 2004 4:32 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Legacy Driver on XP
>
>
> I have a customer with a NT4.0 legacy driver, they wish to
> run on Windows XP
> embeded. In debugging the driver, the calls to
> HalGetInterruptVector and
> IoConnectInterrupt work correctly but no interrupts ever get
> signalled. For
> a lot of reasons, it is not desirable to make this a PNP
> driver, and there
> is little value in an embedded device. So can someone
> suggest a reason
> this legacy driver would not work with Windows XP?
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@ati.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@ati.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com