Starting point for a Non-PnP driver?

I’ve just been tasked with writing a driver for some soon to be added hardware on our custom systems.

We’re adding a SuperIO chip to the low pin count bus which will replace a troublesome USB to Serial chip with a dedicated UART, and will add several GPIO (General Purpose I/O) ports.

The GPIO ports will control custom LEDs on the front panel, detect some switch settings, and control a few internal power switches. We had originally planned to do the GPIO functions from a custom CPLD on the PCI bus, but the hardware guys love the idea of getting rid of the PCI bus entirely and saving all that routing real-estate.

What’s the best driver from the WDK to begin with as an example of a legacy non-pnp driver? General/Portio? I’m assuming that since I just have a collection of I/O addresses for the GPIO ports, I’ll be writing a legacy driver.

My few experiments with the portio driver have me rebooting the box every time I enable/disable the driver, or update the driver. Is that a requirement of legacy drivers?

Clay

Still look at KMDF not legacy. As soon as you start talking hardware, I
would always recommend KMDF if it fits. IN this case you just need an INF
file with a LogConfig section to associate the hardware ports with the
device. You haven’t indicated what the programming interface for the
driver is envisioned as which could change the best starting point. I
would start with something like the PCIDRV. You can eliminate a lot of it,
but this is a good starting point.


Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

wrote in message news:xxxxx@ntdev…
> I’ve just been tasked with writing a driver for some soon to be added
> hardware on our custom systems.
>
> We’re adding a SuperIO chip to the low pin count bus which will replace a
> troublesome USB to Serial chip with a dedicated UART, and will add several
> GPIO (General Purpose I/O) ports.
>
> The GPIO ports will control custom LEDs on the front panel, detect some
> switch settings, and control a few internal power switches. We had
> originally planned to do the GPIO functions from a custom CPLD on the PCI
> bus, but the hardware guys love the idea of getting rid of the PCI bus
> entirely and saving all that routing real-estate.
>
> What’s the best driver from the WDK to begin with as an example of a
> legacy non-pnp driver? General/Portio? I’m assuming that since I just
> have a collection of I/O addresses for the GPIO ports, I’ll be writing a
> legacy driver.
>
> My few experiments with the portio driver have me rebooting the box every
> time I enable/disable the driver, or update the driver. Is that a
> requirement of legacy drivers?
>
> Clay
>
>
> Information from ESET NOD32 Antivirus, version of virus
> signature database 4503 (20091013)

>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>

Information from ESET NOD32 Antivirus, version of virus signature database 4503 (20091013)

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

> The GPIO ports will control custom LEDs on the front panel, detect some

switch settings, and control a few internal power switches.

Do you also control the ACPI BIOS on this platform? If so, having the BIOS
folks surface a custom ACPI device with these resources can make your life
easier on the Windows side. That way you can write a normal PnP driver (in
KMDF, as Don suggested) and not have to worry about any kind of LogConfig
magic or running into strange conflicts.

-scott


Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com

wrote in message news:xxxxx@ntdev…
> I’ve just been tasked with writing a driver for some soon to be added
> hardware on our custom systems.
>
> We’re adding a SuperIO chip to the low pin count bus which will replace a
> troublesome USB to Serial chip with a dedicated UART, and will add several
> GPIO (General Purpose I/O) ports.
>
> The GPIO ports will control custom LEDs on the front panel, detect some
> switch settings, and control a few internal power switches. We had
> originally planned to do the GPIO functions from a custom CPLD on the PCI
> bus, but the hardware guys love the idea of getting rid of the PCI bus
> entirely and saving all that routing real-estate.
>
> What’s the best driver from the WDK to begin with as an example of a
> legacy non-pnp driver? General/Portio? I’m assuming that since I just
> have a collection of I/O addresses for the GPIO ports, I’ll be writing a
> legacy driver.
>
> My few experiments with the portio driver have me rebooting the box every
> time I enable/disable the driver, or update the driver. Is that a
> requirement of legacy drivers?
>
> Clay
>

> Still look at KMDF not legacy.

I’m using the term legacy to mean a legacy bus/device rather than a legacy WDM driver. I fully intend to write a KMDF driver.

Do you also control the ACPI BIOS on this platform? If so, having the BIOS
folks surface a custom ACPI device with these resources can make your life
easier on the Windows side.

Yes we do have the ability to get the BIOS customized to add a device. We’ll already need them shut down 90% of the SuperIO chip (floppy, IR, Mouse, Ptr etc). It might cost a bit of NRE but it sounds like it will make my life much nicer in the long run and look cleaner.

Clay

Technically, you should be writing a PnP driver. If your BIOS (which is
presumably under your control) adds a device to its ACPI namespace with
those I/O ports, you driver can be easily enumerated and assigned the proper
PnP resources. In that case, I’d look at the simplest Toaster KMDF FDO
sample as a starting point.

With that said, your situation is controlled enough that a legacy driver
would do just fine, too, unless the machine can sleep or hibernate.


Jake Oshins
Hyper-V I/O Architect
Windows Kernel Group

This post implies no warranties and confers no rights.


wrote in message news:xxxxx@ntdev…
> I’ve just been tasked with writing a driver for some soon to be added
> hardware on our custom systems.
>
> We’re adding a SuperIO chip to the low pin count bus which will replace a
> troublesome USB to Serial chip with a dedicated UART, and will add several
> GPIO (General Purpose I/O) ports.
>
> The GPIO ports will control custom LEDs on the front panel, detect some
> switch settings, and control a few internal power switches. We had
> originally planned to do the GPIO functions from a custom CPLD on the PCI
> bus, but the hardware guys love the idea of getting rid of the PCI bus
> entirely and saving all that routing real-estate.
>
> What’s the best driver from the WDK to begin with as an example of a
> legacy non-pnp driver? General/Portio? I’m assuming that since I just
> have a collection of I/O addresses for the GPIO ports, I’ll be writing a
> legacy driver.
>
> My few experiments with the portio driver have me rebooting the box every
> time I enable/disable the driver, or update the driver. Is that a
> requirement of legacy drivers?
>
> Clay
>