Hi everybody,

I have prepared a series of lectures on writing
simple WDM drivers.

As a minimum hardware device I use a little board
with LEDs attached to the parallel port. I also use
this board to trigger interrupts (IRQ 7). This is
the only way I have to demonstrate real interrupts.

But there is a problem: if the LPT1 driver is active
I get a resource conflict, if it is not active the
whole parallel port is disabled.
In W98 and WMe I found a way to work around it but
in XP I didn't manage.

One way I thought of is not to include the ports
in the LogConfig section of my .INF file ( it was
IoConfig=378-37a ) - the port addresses are not
translated. On the side of the LPT1 driver interrupts
are not used. So there is no resource conflict.

But my ISR routine is never called. Seems LPT1 blocks
IRQ 7 even if it doesn't use it. Or IRQ 7 is not
enabled (but the mask bit in the PIC (0x21) changes
when I start my driver). The driver works fine in WMe.

Then I tried to find out, how to enable the parallel
port when the LPT1 driver is inactive. I am aware
this is a question of the chip set but on the other
hand it may be simple. I studied the DDK example
sources of the parport driver for at least two days
but didn't find the clou.

Who can give me advice?

Thanks in advance
Wolfgang

Re: parallel port by Tim

Tim
Thu Jan 05 01:31:12 CST 2006

nwk <nwk@informatik.uni-jena.de> wrote:
>
>I have prepared a series of lectures on writing
>simple WDM drivers.
>
>As a minimum hardware device I use a little board
>with LEDs attached to the parallel port. I also use
>this board to trigger interrupts (IRQ 7). This is
>the only way I have to demonstrate real interrupts.
>
>But there is a problem: if the LPT1 driver is active
>I get a resource conflict, if it is not active the
>whole parallel port is disabled.
>In W98 and WMe I found a way to work around it but
>in XP I didn't manage.
>
>One way I thought of is not to include the ports
>in the LogConfig section of my .INF file ( it was
>IoConfig=378-37a ) - the port addresses are not
>translated. On the side of the LPT1 driver interrupts
>are not used. So there is no resource conflict.
>
>But my ISR routine is never called. Seems LPT1 blocks
>IRQ 7 even if it doesn't use it. Or IRQ 7 is not
>enabled (but the mask bit in the PIC (0x21) changes
>when I start my driver). The driver works fine in WMe.
>
>Then I tried to find out, how to enable the parallel
>port when the LPT1 driver is inactive. I am aware
>this is a question of the chip set but on the other
>hand it may be simple. I studied the DDK example
>sources of the parport driver for at least two days
>but didn't find the clou.

Go into device manager, open the ports, double-click on your parallel port.
Go to the Port Settings page. Note that parport.sys, by default, is set to
"never use the interrupt". If you change this to "use the interrupt", you
may have more success.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: parallel port by nwk

nwk
Thu Jan 05 04:42:12 CST 2006



Tim Roberts wrote:
> nwk <nwk@informatik.uni-jena.de> wrote:
>
>> ...
>>One way I thought of is not to include the ports
>>in the LogConfig section of my .INF file ( it was
>>IoConfig=378-37a ) - the port addresses are not
>>translated. On the side of the LPT1 driver interrupts
>>are not used. So there is no resource conflict.
>>
>>But my ISR routine is never called. ...
>
> Go into device manager, open the ports, double-click on your parallel port.
> Go to the Port Settings page. Note that parport.sys, by default, is set to
> "never use the interrupt". If you change this to "use the interrupt", you
> may have more success.

Thank you for the hint.

The default "never use the interrupt" is what I meant by:
"On the side of the LPT1 driver interrupts are not used"

Unfortunately the trick does not work - I get a resource conflict again.
If I do so with my driver loaded, parport.sys is set inactive due to
this conflict and the parallel port is disabled.
After reboot my driver is not loaded since it claims the same IQR
as LPT1.

Wolfgang


Re: parallel port by Pawel

Pawel
Thu Jan 05 12:07:05 CST 2006

> I have prepared a series of lectures on writing
> simple WDM drivers.
>
> As a minimum hardware device I use a little board
> with LEDs attached to the parallel port. I also use
> this board to trigger interrupts (IRQ 7). This is
> the only way I have to demonstrate real interrupts.
>
> But there is a problem: if the LPT1 driver is active
> I get a resource conflict, if it is not active the
> whole parallel port is disabled.
> In W98 and WMe I found a way to work around it but
> in XP I didn't manage.
>
> One way I thought of is not to include the ports
> in the LogConfig section of my .INF file ( it was
> IoConfig=378-37a ) - the port addresses are not
> translated. On the side of the LPT1 driver interrupts
> are not used. So there is no resource conflict.
>
> But my ISR routine is never called. Seems LPT1 blocks
> IRQ 7 even if it doesn't use it. Or IRQ 7 is not
> enabled (but the mask bit in the PIC (0x21) changes
> when I start my driver). The driver works fine in WMe.
>
> Then I tried to find out, how to enable the parallel
> port when the LPT1 driver is inactive. I am aware
> this is a question of the chip set but on the other
> hand it may be simple. I studied the DDK example
> sources of the parport driver for at least two days
> but didn't find the clou.

Try don't use WDM standard.
Simple write NT4/2k kernel driver using HalGetInterruptVector() function
(change wdm.h to ntddk.h) which is obsolete in WDM but works for me on
NT4,2k,XP even Win98.
Don't use LogConfig to avoid conflict. Simple don't use any resources in
.inf file, or don't use .inf at all.
Run it as standard NT4 for exaple by
/HKLM/System/CurrentControlSet/Services/ it still works in Win98.

Don't forget to set 4 bit in LPT control register to activate interrupts
IRQ7 .
Something like this:
WRITE_PORT_UCHAR( BASE + 2, READ_PORT_UCHAR(BASE+2) | 0x10);
And disable at the end
WRITE_PORT_UCHAR(BASE+2, READ_PORT_UCHAR(BASE+2) & 0xef);

Pawel




Re: parallel port by Ali

Ali
Thu Jan 05 12:46:14 CST 2006

>Simple don't use any resources in .inf file, or don't use .inf at all. Run it as standard NT4

Very strange!
I was also doing the same thing from last tow days and it didn't work
for me at all. I remember senior member of this group saying that WDM
drivers *don't* work without inf files.


Re: parallel port by pavel_a

pavel_a
Thu Jan 05 15:46:04 CST 2006

"Pawel" wrote:
> Try don't use WDM standard.
> Simple write NT4/2k kernel driver using HalGetInterruptVector() function
> (change wdm.h to ntddk.h) which is obsolete in WDM but works for me on
> NT4,2k,XP even Win98.

Ironically enough, the OP needs a WDM driver...
How about a simple USB device, such as osronline.com USB learning kit?

--PA

Re: parallel port by Pawel

Pawel
Fri Jan 06 00:33:29 CST 2006

> Very strange!

I know, but function like HalGetInterruptVector() still works in win98.

> I was also doing the same thing from last tow days and it didn't work
> for me at all. I remember senior member of this group saying that WDM
> drivers *don't* work without inf files.

I don't say it will be WDM.
I say that it should be NT4 driver and install/start like NT4
and will be work with win98.

This driver is binary compatible between win98/nt4/2k/XP even.

Pawel




Re: parallel port by Maxim

Maxim
Fri Jan 06 07:19:01 CST 2006

> WRITE_PORT_UCHAR( BASE + 2, READ_PORT_UCHAR(BASE+2) | 0x10);
> And disable at the end
> WRITE_PORT_UCHAR(BASE+2, READ_PORT_UCHAR(BASE+2) & 0xef);

On some motherboards, the parallel port hardware is powered off by default, and
so, only the PnP/WDM stack will be able to access the hardware. Your "direct"
attempts will return 0xff from the port due to the port being powered down.

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


Re: parallel port by nwk

nwk
Fri Jan 06 09:16:01 CST 2006

Yes, that's what I think. I called it: "if it (parport.sys) is not
active the whole parallel port is disabled."

But there should be a way to power on the port hardware.
Unfortunately I didn't find it in the porport sources,
may be someone else does.

Wolfgang

Maxim S. Shatskih wrote:
>
> On some motherboards, the parallel port hardware is powered off by default, and
> so, only the PnP/WDM stack will be able to access the hardware. Your "direct"
> attempts will return 0xff from the port due to the port being powered down.
>


Re: parallel port by Doron

Doron
Fri Jan 06 09:30:40 CST 2006

not to state the obvious, you need to write a WDM driver

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"nwk" <nwk@informatik.uni-jena.de> wrote in message
news:43BE89B1.6050309@informatik.uni-jena.de...
> Yes, that's what I think. I called it: "if it (parport.sys) is not active
> the whole parallel port is disabled."
>
> But there should be a way to power on the port hardware.
> Unfortunately I didn't find it in the porport sources,
> may be someone else does.
>
> Wolfgang
>
> Maxim S. Shatskih wrote:
>>
>> On some motherboards, the parallel port hardware is powered off by
>> default, and
>> so, only the PnP/WDM stack will be able to access the hardware. Your
>> "direct"
>> attempts will return 0xff from the port due to the port being powered
>> down.
>>
>



Re: parallel port by Maxim

Maxim
Fri Jan 06 09:38:57 CST 2006

This is executing some ACPI bytecode, and this will require digging too
deep into Windows and surely creating interop issues with the Windows ACPI
state machine itself.

In modern Windows, all hardware drivers MUST be WDM. Non-WDM kernel modules
are for now enabled to access the hardware, but this is WAY too obsolete, this
switches the kernel to no-power-management mode, and I'm nearly sure that this
will be dropped in Vista at all.

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

"nwk" <nwk@informatik.uni-jena.de> wrote in message
news:43BE89B1.6050309@informatik.uni-jena.de...
> Yes, that's what I think. I called it: "if it (parport.sys) is not
> active the whole parallel port is disabled."
>
> But there should be a way to power on the port hardware.
> Unfortunately I didn't find it in the porport sources,
> may be someone else does.
>
> Wolfgang
>
> Maxim S. Shatskih wrote:
> >
> > On some motherboards, the parallel port hardware is powered off by default,
and
> > so, only the PnP/WDM stack will be able to access the hardware. Your
"direct"
> > attempts will return 0xff from the port due to the port being powered down.
> >
>


Re: parallel port by Tim

Tim
Sat Jan 07 20:51:26 CST 2006

nwk <nwk@informatik.uni-jena.de> wrote:
>
>The default "never use the interrupt" is what I meant by:
> "On the side of the LPT1 driver interrupts are not used"
>
>Unfortunately the trick does not work - I get a resource conflict again.
>If I do so with my driver loaded, parport.sys is set inactive due to
>this conflict and the parallel port is disabled.
>After reboot my driver is not loaded since it claims the same IQR
>as LPT1.

Of course. The problem is that you want to USE the LPT IRQ without going
to the trouble of initializing it in any official manner. You have two
choices: tell parport.sys NOT to claim the IRQ, and initialize the
interrupt yourself, or tell parport.sys to CLAIM the IRQ, tell your own
driver NOT to claim it, but then use it just the same.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.