Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

A journey from NT-Device Driver to WDM

1 view
Skip to first unread message

Ali

unread,
Jun 13, 2005, 4:07:25 PM6/13/05
to
Hi All,
I have designed a board with Atmel chip which provides an I/O
interfaces for parallel port , its device driver implements only three
following major functions in DriverEntry routine.
IRP_MJ_CREATE , IRP_MJ_READ and IRP_MJ_WRITE.
I want to upgrade its driver to make it plug and play , I want to start
my win32 application automatically when ever my board is attached with
DB25 [port of PC], Do I have to write only AddDevice and isr routines
for doing so?
I'm some how sure that there is nothing to do with chip code because a
loop in user mode application can scan the current status of board and
chip can change the board status when ever instructed by user mode
application.
I don't want to upgrade my board for DMA operations so i guess no need
for loop back mechanism in device driver.


Now what should be the basic design of monolithic type Plug and Play
driver?
You can see the driver code on following url under Driver Build
Tutorial link:
http://powercell.cjb.net/ [my educational webpage]

Hope I would get some usefull hints + tips to finish my work in
reasonable time. You can see this topic on following link too:
http://groups-beta.google.com/group/comp.os.ms-windows.programmer.nt.kernel-mode/browse_frm/thread/5428765490fc2c9d/9ff0f3f5a387b330?hl=en#9ff0f3f5a387b330
Cheers.

Maxim S. Shatskih

unread,
Jun 13, 2005, 4:24:47 PM6/13/05
to
Is it an ISA device or a PCI one?

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

"Ali" <abdul...@gmail.com> wrote in message
news:1118693245.9...@f14g2000cwb.googlegroups.com...

Ali

unread,
Jun 13, 2005, 4:32:28 PM6/13/05
to
Hi Maxim,
It is Parallel port device , you can see the hardware on
following link under the Hardware Design link.
http://powercell.cjb.net/

Thanks for your help i have been reading Art Baker's book for doing so
because Walter Oney's book is somehow hard to understand and he has
presented code with USB examples.

I wish i would make it work in this month.

Ali

unread,
Jun 13, 2005, 4:39:08 PM6/13/05
to
Don Burn has given me good starting points from DDK
[src\general\toaster\func\featu­red2] as starting points but sir its
really hard to extract and understand all that code by Eliyas Yakub.
havn't started coding yet still stuck in design phase:)

David J. Craig

unread,
Jun 14, 2005, 12:19:29 AM6/14/05
to
If you don't understand that code first, how will you ever develop a working
driver? I will admit it is fairly complex, but build each piece and install
them one by one running windbg on them. Add a breakpoint into DriverEntry
and watch every request until you understand what is happening. The first
pieces will not exercise much of their code until later pieces get
installed, but you need to understand the driver model before you can create
a design that will work.

"Ali" <abdul...@gmail.com> wrote in message

news:1118695148.6...@g44g2000cwa.googlegroups.com...

Ali

unread,
Jun 14, 2005, 2:07:52 AM6/14/05
to
>If you don't understand that code first, how will you ever develop a working driver?
No thats not the case! I don't have any problems as far as syntax and
code path is concern. I'm still confused about my hardware design? The
question is do i have to upgrade my hardware too for writing a PnP
driver? I mean it is working fine with NT Driver [Non PnP].
1) Do i have to upgrade my hardware in sense of interrupt generation
because i'm not sure how kernel will discover that now PowerCell [my
device] is connected to DB-25 port instead of ordinary printer? and its
time to load my WDM driver and vice versa when removed.

Ali

unread,
Jun 14, 2005, 2:53:16 AM6/14/05
to
Is there any handshaking issue involve in this case?

Ali

unread,
Jun 14, 2005, 3:01:00 AM6/14/05
to
Do i have to consider predetermined activity design to establish
handshaking?

Gary G. Little

unread,
Jun 14, 2005, 10:03:03 AM6/14/05
to
Is this an ISA board you are upgrading? If so, I would think you would be
bringing it up to PCI or one of the PCI variants, since ISA slots in
motherboards are becoming rare.

The personal opinion of
Gary G. Little

Ali

unread,
Jun 14, 2005, 10:52:41 AM6/14/05
to
Nope;-) It is parallel port device , you can see the hardware on

Ali

unread,
Jun 17, 2005, 6:45:59 PM6/17/05
to
> Is it an ISA device or a PCI one
it is parallel port device , just using control and data registers of
DB-25 physical port.
Well i was expecting more from you after my answer;-) didn't i gave
you correct answer?

Tim Roberts

unread,
Jun 18, 2005, 11:50:07 PM6/18/05
to
"Ali" <abdul...@gmail.com> wrote:
>
>No thats not the case! I don't have any problems as far as syntax and
>code path is concern. I'm still confused about my hardware design? The
>question is do i have to upgrade my hardware too for writing a PnP
>driver? I mean it is working fine with NT Driver [Non PnP].
>1) Do i have to upgrade my hardware in sense of interrupt generation
>because i'm not sure how kernel will discover that now PowerCell [my
>device] is connected to DB-25 port instead of ordinary printer? and its
>time to load my WDM driver and vice versa when removed.

Are you going straight to the hardware, or are you on top of PARPORT.SYS?
--
- Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc

Ali

unread,
Jun 19, 2005, 4:14:42 AM6/19/05
to
Yeah i'm going straight to the hardware , without depending on
PARPORT.SYS.
My existing driver is monolithic type NT-Device Driver which defines
IOCTL_READ_PORT_UCHAR and IOCTL_WRITE_PORT_UCHAR to access the control
and data registers of parallel port.

Ali

unread,
Jun 27, 2005, 5:24:05 AM6/27/05
to
Tim are you there? i was expecting a post from you;-) i have enabled
"Monitor" option from my system BIOS for parallel port and i have come
to beieve that it is connected to ISA.

Ali

unread,
Jun 28, 2005, 12:47:04 AM6/28/05
to
Please see the following link for more understanding on this topic:
[http://groups-beta.google.com/group/comp.arch.embedded/browse_thread/thread/82350944d20874e7/a69b5156a370cd48#a69b5156a370cd48]
See the Chris post of 27 June.

Tim Roberts

unread,
Jun 28, 2005, 1:19:20 AM6/28/05
to
"Ali" <abdul...@gmail.com> wrote:
>
>Tim are you there? i was expecting a post from you;-)

Last week was the 54th National Square Dance Convention here in Portland.
8,000 square dancers came to town, and I was on the governing board. It
left me unable to do much of anything else.

>i have enabled "Monitor" option from my system BIOS for parallel port
>and i have come to beieve that it is connected to ISA.

Yes, parallel ports are simple ISA devices. The I/O port numbers are all
fixed.

I believe the information you want is here:
http://www.microsoft.com/whdc/resources/respec/specs/pnplpt.mspx

This describes what a device has to do to be recognized by Windows and
trigger a plug-and-play device load.

Ali

unread,
Jun 28, 2005, 5:01:47 AM6/28/05
to
Humm.. here is a man in town how speaks bravely! So i would take it as
a holy word that parallel port is a ISA device on x86 architecture.
You can see some other views about this issue from different
prospective on following link
[http://groups-beta.google.com/group/comp.arch.embedded/browse_frm/thread/82350944d20874e7/48caee60a0b5a461?tvc=1&hl=en#48caee60a0b5a46]
See Jonathan Kirwan and Chris posts.

Ali

unread,
Jun 29, 2005, 12:47:33 AM6/29/05
to
Oops!
Tim Wrote:
> In the first years of PC design the parallel port interface was handled
> by an 8255 PIO chip connected to the ISA bus of the computer.

Tauno wrote:
It was not a 8255, but a bunch of TTL registers and gates.
I still have the original IBM/PC Technical Manual showing it.

Tim Roberts

unread,
Jun 30, 2005, 1:37:34 AM6/30/05
to
"Ali" <abdul...@gmail.com> wrote:
>
>Humm.. here is a man in town how speaks bravely! So i would take it as
>a holy word that parallel port is a ISA device on x86 architecture.

I never said it was a holy word, and I'm not sure why you want to get
snotty about it. The standard PC parallel port can be treated by software
as an ISA device, because it is at a fixed 10-bit I/O port address. Most
of them are actually implemented by a super I/O chip attached off of the
north bridge.

Ali

unread,
Jun 30, 2005, 8:46:30 AM6/30/05
to
>I never said it was a holy word
l0l

> I'm not sure why you want to get snotty about it.

Well I want to make this thing work this the reason I hae been so
touchy about it;-)
To me it seems that it is connected to ISA bus and in systems if ISA
bus isn't present then PCI bus take cares of it. One thing I have
come to believe is that it is never connected to main bus directly;-)
Though in early days it was connected through the bunch of TTLs to
MainBus.

Tim do I need to take care of handshacking in PnP driver? how windows
will know? that PowerCell Device [http://powercell.cjb.net/] is
connected to PC port instead of any ordinary printer and it is time to
kick my Mr. Driver out in action.

Regards,
-ali

Tim Roberts

unread,
Jul 2, 2005, 5:50:43 PM7/2/05
to
"Ali" <abdul...@gmail.com> wrote:
>
>To me it seems that it is connected to ISA bus and in systems if ISA
>bus isn't present then PCI bus take cares of it. One thing I have
>come to believe is that it is never connected to main bus directly;-)
>Though in early days it was connected through the bunch of TTLs to
>MainBus.

"Main bus" is actually closer to the truth. In today's motherboards, the
parallel port I/O ports are handled by a "super I/O" chip that usually is
part of the south bridge (I said north bridge last time, but that's wrong),
which is the same place the PCI bus connects. Thus, the port is not
actually on the PCI bus.

The bus is not actually very important to this discussion. Somewhere,
someone is handling access to the parallel I/O ports. Doesn't matter
where.

>Tim do I need to take care of handshacking in PnP driver? how windows
>will know?

If you aren't using parport.sys at all, then no one will care. You just do
what you need to do and leave it in SPP mode when you are done.

Ali

unread,
Jul 3, 2005, 2:26:18 AM7/3/05
to
>The bus is not actually very important to this discussion. Somewhere, someone is handling access to the parallel I/O ports. Doesn't matter where.

This is what my understanding was before writing PnP driver! but when i
decided to write its PnP driver guys from this group started asking me
what type of device i'm having? anyway.

ALI>Tim do I need to take care of handshacking in PnP driver? how
windows will know?
TIM>If you aren't using parport.sys at all, then no one will care. You


just do what you need to do and leave it in SPP mode when you are done.

Nope i'm not using parport.sys and don't have such plans for doing so.
Tim how about src\general\toaster\func\featured2 project from 2003 DDK?
i think i just want a FDO to solve my problem.
WAO featured2 by Elyas comes with great code for power handling , i
guess bolier plate code. Currently my device is self powered and i
don't
want to have powerdown , low power [D0,..,Dx] or any other feature from
power manager so do i have to still copy paste that all bolier plate
code for writing a PnP driver? to me it is plain to see that every WDM
or WDF stricly not NT-kernel mode driver is technically responsible for
writing Power and addDevice functionality for power
management and plug and play respectively.
.

Thank You,
return (IsSundayFree : Fun+leisure ? MORE_TIME_MANGEMENT);

Maxim S. Shatskih

unread,
Jul 4, 2005, 7:59:44 PM7/4/05
to
> "Main bus" is actually closer to the truth. In today's motherboards, the
> parallel port I/O ports are handled by a "super I/O" chip that usually is
> part of the south bridge (I said north bridge last time, but that's wrong),

Separate chip. South-bridge has internal->LPC bus bridge. The internal bus is
software-compatible with PCI, and LPC - with ISA.

SuperIO is sitting on LPC bus.

Ali

unread,
Jul 5, 2005, 11:10:42 AM7/5/05
to
So Maxim what is next now;-) I remember that you were the one how
raised this question on my post for "NT-Device Driver to WDM ". Well
now it is decided that my device is ISA type.
Cheers.
-ali

0 new messages