How to build Port IO driver for IA-64?

I am trying to develop a utility that can read and write
PCI card configuration space. For the 32 bit OS I can use
the portio example from the DDK. But when I compile this
example in IA-64 mode I don’t get the .SYS driver, even
though the read and write apps build OK.

I think this is because the Itanium does not really have
IO space. So how do I access the configuration space
on a PCI card when running a 64 bit OS? Is there an example
somewhere of how the IA-64 systems access IO addresses?

thanks, ed in calif

I would assume you’re using DDK37xx.

In the portio sample, the makefile limits the target bin x86 only. Try
removing the !IF/!ENDIF statements in the portio/sys/makefile.

Calvin Guan, Software Engineer xxxxx@nospam.ati.com
ATI Technologies Inc. Markham ON. Canada
Tel: (905) 882-2600 Ext. 8654

-----Original Message-----
From: xxxxx@comcast.net [mailto:xxxxx@comcast.net]
Sent: Wednesday, January 14, 2004 1:52 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to build Port IO driver for IA-64?

I am trying to develop a utility that can read and write
PCI card configuration space. For the 32 bit OS I can use
the portio example from the DDK. But when I compile this
example in IA-64 mode I don’t get the .SYS driver, even
though the read and write apps build OK.

I think this is because the Itanium does not really have
IO space. So how do I access the configuration space
on a PCI card when running a 64 bit OS? Is there an example
somewhere of how the IA-64 systems access IO addresses?

thanks, ed in calif


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

Well for the 32 bit space you are risking crashing the system, since you do
not have control of the PCI configuration ports, the PCI driver does so you
are likely to cause a crash. You might look at the article “Replacing
HalGetBusData In windows 2000” from http://www.hollistech.com/ but you are
then going have to figure out how get the device objects you will need for
this method.

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

----- Original Message -----
From:
To: “Windows System Software Devs Interest List”
Sent: Wednesday, January 14, 2004 1:51 PM
Subject: [ntdev] How to build Port IO driver for IA-64?

>
> I am trying to develop a utility that can read and write
> PCI card configuration space. For the 32 bit OS I can use
> the portio example from the DDK. But when I compile this
> example in IA-64 mode I don’t get the .SYS driver, even
> though the read and write apps build OK.
>
> I think this is because the Itanium does not really have
> IO space. So how do I access the configuration space
> on a PCI card when running a 64 bit OS? Is there an example
> somewhere of how the IA-64 systems access IO addresses?
>
> thanks, ed in calif
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@acm.org
> To unsubscribe send a blank email to xxxxx@lists.osr.com

You only think this works in the 32bit OS. It doesn’t, and it can wreck your
system by corrupting config space access. You need to use the defined NT
mechanisms for accessing PCI configuration information. Portio is not the
way to go.

See http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q253232 or my
ancient article on the same subject here: www.hollistech.com . Any other
approach is both wrong and unportable and incorrect and a bad idea and not a
good thing.

=====================
Mark Roddy

-----Original Message-----
From: xxxxx@comcast.net [mailto:xxxxx@comcast.net]
Sent: Wednesday, January 14, 2004 1:52 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to build Port IO driver for IA-64?

I am trying to develop a utility that can read and write PCI
card configuration space. For the 32 bit OS I can use the
portio example from the DDK. But when I compile this example
in IA-64 mode I don’t get the .SYS driver, even though the
read and write apps build OK.

I think this is because the Itanium does not really have IO
space. So how do I access the configuration space on a PCI
card when running a 64 bit OS? Is there an example somewhere
of how the IA-64 systems access IO addresses?

thanks, ed in calif


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

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

Haven’t read you post carefully, now I see what’s your real question.

To access PCI config space in NT, you should not directly manipulate port
CF8/CFC since you can not sync the access to those ports with HAL and/or the
PCI bus driver. Therefore, portio is not the way to go even on a 32-bit
machine.

In NT4 and below, you can use HalGet/SetBusData(ByOffset). In w2k and up,
IRP_MN_READ/WRITE_CONFIG (passive level only) or bus
interface(<=DISPATCH_LEVEL IIRC) is the way to go.

If you have a certain board that you wish to access its config space, you
can load a functional driver and send proper PNP IRPs to the PCI bus driver.

If you want to access config space on arbitrary PCI boards (most likely for
a diagnostic utility), you could still use obsolete Hal functions but it’s
discouraged. Another way is to write a PCI bus PDO filter driver. Once you
have the filter driver, you will have access to any PDOs. Such a driver is a
bit difficult to write since it is not offically supported and could be
difficult to install for PCI-PCI/AGP bridges.If you decide to take this
approach, I can provide more details.

Good luck,
Calvin

Calvin Guan, Software Engineer xxxxx@nospam.ati.com
ATI Technologies Inc. Tel: (905) 882-2600 Ext. 8654

-----Original Message-----
From: Calvin Guan [mailto:xxxxx@ati.com]
Sent: Wednesday, January 14, 2004 1:58 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] How to build Port IO driver for IA-64?

I would assume you’re using DDK37xx.

In the portio sample, the makefile limits the target bin x86 only. Try
removing the !IF/!ENDIF statements in the portio/sys/makefile.

Calvin Guan, Software Engineer xxxxx@nospam.ati.com
ATI Technologies Inc. Markham ON. Canada
Tel: (905) 882-2600 Ext. 8654

-----Original Message-----
From: xxxxx@comcast.net [ mailto:xxxxx@comcast.net
mailto:xxxxx ]
> Sent: Wednesday, January 14, 2004 1:52 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] How to build Port IO driver for IA-64?
>
>
>
> I am trying to develop a utility that can read and write
> PCI card configuration space. For the 32 bit OS I can use
> the portio example from the DDK. But when I compile this
> example in IA-64 mode I don’t get the .SYS driver, even
> though the read and write apps build OK.
>
> I think this is because the Itanium does not really have
> IO space. So how do I access the configuration space
> on a PCI card when running a 64 bit OS? Is there an example
> somewhere of how the IA-64 systems access IO addresses?
>
> thanks, ed in calif
>
> —
> 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@ati.com
To unsubscribe send a blank email to xxxxx@lists.osr.com</http:></mailto:xxxxx>

Thanks to everyone who responded to my question.

I have a better idea (more portable) how to do it now.

It does appear to be working in 32 bit OS’s.
I see the point as to how it could not work, but would the OS
access config space at run time?, I don’t see why.

Anyway we are only reading it, not changing it.

thanks again, ed in calif

----- Original Message -----
From: “Roddy, Mark”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, January 14, 2004 11:03 AM
Subject: RE: [ntdev] How to build Port IO driver for IA-64?

> You only think this works in the 32bit OS. It doesn’t, and it can wreck
your
> system by corrupting config space access. You need to use the defined NT
> mechanisms for accessing PCI configuration information. Portio is not the
> way to go.
>
> See http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q253232 or my
> ancient article on the same subject here: www.hollistech.com . Any other
> approach is both wrong and unportable and incorrect and a bad idea and not
a
> good thing.
>
> =====================
> Mark Roddy
>
>
> > -----Original Message-----
> > From: xxxxx@comcast.net [mailto:xxxxx@comcast.net]
> > Sent: Wednesday, January 14, 2004 1:52 PM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] How to build Port IO driver for IA-64?
> >
> >
> > I am trying to develop a utility that can read and write PCI
> > card configuration space. For the 32 bit OS I can use the
> > portio example from the DDK. But when I compile this example
> > in IA-64 mode I don’t get the .SYS driver, even though the
> > read and write apps build OK.
> >
> > I think this is because the Itanium does not really have IO
> > space. So how do I access the configuration space on a PCI
> > card when running a 64 bit OS? Is there an example somewhere
> > of how the IA-64 systems access IO addresses?
> >
> > thanks, ed in calif
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as:
> > xxxxx@stratus.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@attbi.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Any pci driver can access config space at any time, and yes read access can
produce incorrect results for either your application or any other thread
trying to (legitimately) access pci config space. If this is a product,
rather than an experiment, it is certainly the wrong way to go.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ed in Calif
Sent: Wednesday, January 14, 2004 11:22 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to build Port IO driver for IA-64?

Thanks to everyone who responded to my question.

I have a better idea (more portable) how to do it now.

It does appear to be working in 32 bit OS’s.
I see the point as to how it could not work, but would the OS
access config space at run time?, I don’t see why.

Anyway we are only reading it, not changing it.

thanks again, ed in calif

----- Original Message -----
From: “Roddy, Mark”
> To: “Windows System Software Devs Interest List”
> Sent: Wednesday, January 14, 2004 11:03 AM
> Subject: RE: [ntdev] How to build Port IO driver for IA-64?
>
>
> > You only think this works in the 32bit OS. It doesn’t, and
> it can wreck
> your
> > system by corrupting config space access. You need to use
> the defined NT
> > mechanisms for accessing PCI configuration information.
> Portio is not the
> > way to go.
> >
> > See
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q253232 or my
> > ancient article on the same subject here:
> www.hollistech.com . Any other
> > approach is both wrong and unportable and incorrect and a
> bad idea and not
> a
> > good thing.
> >
> > =====================
> > Mark Roddy
> >
> >
> > > -----Original Message-----
> > > From: xxxxx@comcast.net [mailto:xxxxx@comcast.net]
> > > Sent: Wednesday, January 14, 2004 1:52 PM
> > > To: Windows System Software Devs Interest List
> > > Subject: [ntdev] How to build Port IO driver for IA-64?
> > >
> > >
> > > I am trying to develop a utility that can read and write PCI
> > > card configuration space. For the 32 bit OS I can use the
> > > portio example from the DDK. But when I compile this example
> > > in IA-64 mode I don’t get the .SYS driver, even though the
> > > read and write apps build OK.
> > >
> > > I think this is because the Itanium does not really have IO
> > > space. So how do I access the configuration space on a PCI
> > > card when running a 64 bit OS? Is there an example somewhere
> > > of how the IA-64 systems access IO addresses?
> > >
> > > thanks, ed in calif
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as:
> > > xxxxx@stratus.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@attbi.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@hollistech.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

> IO space. So how do I access the configuration space

on a PCI card when running a 64 bit OS? Is there an example
somewhere of how the IA-64 systems access IO addresses?

I think such a task can be completely impossible, except by !pci command in the
kernel debugger.

Is there any “IO addresses” on IA-64 at all?

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

Not a product, just an engineering utility to check some
registers at runtime.

Ed

----- Original Message -----
From: “Mark Roddy”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, January 14, 2004 8:26 PM
Subject: RE: [ntdev] How to build Port IO driver for IA-64?

> Any pci driver can access config space at any time, and yes read access
can
> produce incorrect results for either your application or any other thread
> trying to (legitimately) access pci config space. If this is a product,
> rather than an experiment, it is certainly the wrong way to go.
>
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Ed in Calif
> > Sent: Wednesday, January 14, 2004 11:22 PM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] How to build Port IO driver for IA-64?
> >
> > Thanks to everyone who responded to my question.
> >
> > I have a better idea (more portable) how to do it now.
> >
> > It does appear to be working in 32 bit OS’s.
> > I see the point as to how it could not work, but would the OS
> > access config space at run time?, I don’t see why.
> >
> > Anyway we are only reading it, not changing it.
> >
> > thanks again, ed in calif
> >
> >
> > ----- Original Message -----
> > From: “Roddy, Mark”
> > To: “Windows System Software Devs Interest List”
> > Sent: Wednesday, January 14, 2004 11:03 AM
> > Subject: RE: [ntdev] How to build Port IO driver for IA-64?
> >
> >
> > > You only think this works in the 32bit OS. It doesn’t, and
> > it can wreck
> > your
> > > system by corrupting config space access. You need to use
> > the defined NT
> > > mechanisms for accessing PCI configuration information.
> > Portio is not the
> > > way to go.
> > >
> > > See
> > http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q253232 or my
> > > ancient article on the same subject here:
> > www.hollistech.com . Any other
> > > approach is both wrong and unportable and incorrect and a
> > bad idea and not
> > a
> > > good thing.
> > >
> > > =====================
> > > Mark Roddy
> > >
> > >
> > > > -----Original Message-----
> > > > From: xxxxx@comcast.net [mailto:xxxxx@comcast.net]
> > > > Sent: Wednesday, January 14, 2004 1:52 PM
> > > > To: Windows System Software Devs Interest List
> > > > Subject: [ntdev] How to build Port IO driver for IA-64?
> > > >
> > > >
> > > > I am trying to develop a utility that can read and write PCI
> > > > card configuration space. For the 32 bit OS I can use the
> > > > portio example from the DDK. But when I compile this example
> > > > in IA-64 mode I don’t get the .SYS driver, even though the
> > > > read and write apps build OK.
> > > >
> > > > I think this is because the Itanium does not really have IO
> > > > space. So how do I access the configuration space on a PCI
> > > > card when running a 64 bit OS? Is there an example somewhere
> > > > of how the IA-64 systems access IO addresses?
> > > >
> > > > thanks, ed in calif
> > > >
> > > > —
> > > > Questions? First check the Kernel Driver FAQ at
> > > > http://www.osronline.com/article.cfm?id=256
> > > >
> > > > You are currently subscribed to ntdev as:
> > > > xxxxx@stratus.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@attbi.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@hollistech.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@attbi.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

There is no IO but I think the IO space is somewhere
in the main memory map. But I am still trying to figure
that out.

Ed

----- Original Message -----
From: “Maxim S. Shatskih”
To: “Windows System Software Devs Interest List”
Sent: Thursday, January 15, 2004 8:10 AM
Subject: Re: [ntdev] How to build Port IO driver for IA-64?

> > IO space. So how do I access the configuration space
> > on a PCI card when running a 64 bit OS? Is there an example
> > somewhere of how the IA-64 systems access IO addresses?
>
> I think such a task can be completely impossible, except by !pci command
in the
> kernel debugger.
>
> Is there any “IO addresses” on IA-64 at all?
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.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@attbi.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com