How to know the I/O port number

I just have an audio card with a game port connected to QNX6.2.0, I need
to read the joystick from the game port, but I don’t know what the I/O
port number is that used in the program with out8(), and what the memory
address is.

The infomation I got from “pci -vvv” is:

Class = Multimedia (Audio)
Vendor ID = 1274h, Ensoniq
Device ID = 5880h, 5880 AudioPCI
PCI index = 0h
Class Codes = 040100h
Revision ID = 2h
Bus number = 2
Device number = 12
Function num = 0
Status Reg = 3410h
Command Reg = 105h
I/O space access enabled
Memory space access disabled
Bus Master enabled
Special Cycle operations ignored
Memory Write and Invalidate disabled
Palette Snooping disabled
Parity Checking disabled
Data/Address stepping disabled
SERR# driver disabled
Fast back-to-back transactions to different agents enabled
Header type = 0h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 20h
Cache Line Size= 0h
PCI IO Address = dc00h length 64 enabled
Subsystem Vendor ID = 1274h
Subsystem ID = 2000h
Max Lat = 128ns
Min Gnt = 12ns
PCI Int Pin = INT A
Interrupt line = 5
Capabilities Pointer = dch
Capability ID = 1h
Capabilities = 421h - 3h
Device Dependent Registers:
0x40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xD0: 00 00 00 00 00 00 00 00 00 00 00 00 01 00 21 04
0xE0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Can anyone tell me where I can find it? Thanks a lot.

Lily

Lily wrote:

I just have an audio card with a game port connected to QNX6.2.0, I need
to read the joystick from the game port, but I don’t know what the I/O
port number is that used in the program with out8(), and what the memory
address is.

The infomation I got from “pci -vvv” is:

…[snip]

Class = Multimedia (Audio)
Cache Line Size= 0h
PCI IO Address = dc00h length 64 enabled

Is that it?

Regards
William

The listed PCI information gives you information about the PCI base address
registers, but you have to get the documentation for the PCI card to see
what the base address registers points at, and furthermore what the register
map is for that particular device.

Furthermore look at the QNX pci_*() functions on how to retrieve that
information from your program.


Jens
“Lily” <fanxm0712@yahoo.ca> wrote in message
news:3EB1ECE5.8050706@yahoo.ca

I just have an audio card with a game port connected to QNX6.2.0, I need
to read the joystick from the game port, but I don’t know what the I/O
port number is that used in the program with out8(), and what the memory
address is.

The infomation I got from “pci -vvv” is:

Class = Multimedia (Audio)
Vendor ID = 1274h, Ensoniq
Device ID = 5880h, 5880 AudioPCI
PCI index = 0h
Class Codes = 040100h
Revision ID = 2h
Bus number = 2
Device number = 12
Function num = 0
Status Reg = 3410h
Command Reg = 105h
I/O space access enabled
Memory space access disabled
Bus Master enabled
Special Cycle operations ignored
Memory Write and Invalidate disabled
Palette Snooping disabled
Parity Checking disabled
Data/Address stepping disabled
SERR# driver disabled
Fast back-to-back transactions to different agents enabled
Header type = 0h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 20h
Cache Line Size= 0h
PCI IO Address = dc00h length 64 enabled
Subsystem Vendor ID = 1274h
Subsystem ID = 2000h
Max Lat = 128ns
Min Gnt = 12ns
PCI Int Pin = INT A
Interrupt line = 5
Capabilities Pointer = dch
Capability ID = 1h
Capabilities = 421h - 3h
Device Dependent Registers:
0x40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xD0: 00 00 00 00 00 00 00 00 00 00 00 00 01 00 21 04
0xE0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Can anyone tell me where I can find it? Thanks a lot.

Lily

I have the pci soundcard document – Creative Soundblaster16PCI. It is
very simple, just how to install it to windows plus troublshooting. I
didn’t find any map infomation. By default the game port is located at
0x201, But I don’t know how about this card. Can you please tell me more
detaily about where and how to find it so I can search on the website? I
am so new to the low level driver programming.

Thank you very much.

Lily


Jens H Jorgensen wrote:

The listed PCI information gives you information about the PCI base address
registers, but you have to get the documentation for the PCI card to see
what the base address registers points at, and furthermore what the register
map is for that particular device.

Furthermore look at the QNX pci_*() functions on how to retrieve that
information from your program.


Jens
“Lily” <> fanxm0712@yahoo.ca> > wrote in message
news:> 3EB1ECE5.8050706@yahoo.ca> …

I just have an audio card with a game port connected to QNX6.2.0, I need
to read the joystick from the game port, but I don’t know what the I/O
port number is that used in the program with out8(), and what the memory
address is.

The infomation I got from “pci -vvv” is:

Class = Multimedia (Audio)
Vendor ID = 1274h, Ensoniq
Device ID = 5880h, 5880 AudioPCI
PCI index = 0h
Class Codes = 040100h
Revision ID = 2h
Bus number = 2
Device number = 12
Function num = 0
Status Reg = 3410h
Command Reg = 105h
I/O space access enabled
Memory space access disabled
Bus Master enabled
Special Cycle operations ignored
Memory Write and Invalidate disabled
Palette Snooping disabled
Parity Checking disabled
Data/Address stepping disabled
SERR# driver disabled
Fast back-to-back transactions to different agents enabled
Header type = 0h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 20h
Cache Line Size= 0h
PCI IO Address = dc00h length 64 enabled
Subsystem Vendor ID = 1274h
Subsystem ID = 2000h
Max Lat = 128ns
Min Gnt = 12ns
PCI Int Pin = INT A
Interrupt line = 5
Capabilities Pointer = dch
Capability ID = 1h
Capabilities = 421h - 3h
Device Dependent Registers:
0x40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xD0: 00 00 00 00 00 00 00 00 00 00 00 00 01 00 21 04
0xE0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Can anyone tell me where I can find it? Thanks a lot.

Lily
\

Hello Lily

Typically when I start developing a device driver there two key sources of
information:

  • documentation on the chipset on the PCI card (almost always a “must”)
  • open source drivers for same device.

For instance I am working on driver for IEEE 1394 right now, and it has an
OHCI
1394 chip on it, so I search the web for the OHCI specification. The
specification
tells me what the PCI base addresses point at and documents the register
map.

Just to clarify - it seems like the sound card only has one IO PCI base
address:

PCI IO Address = dc00h length 64 enabled

Above typicall means that the first register for the sound chip is located
at 0xdc00.
Furthermore it tells me that there are 64 bytes of registers, which are IO
mapped.

You need some additional information in order to determine the size and
offset from
0xdc00 on the individual registers.

Hope above helped a little.

Jens


“Lily” <fanxm0712@yahoo.ca> wrote in message
news:3EB28C69.9010306@yahoo.ca

I have the pci soundcard document – Creative Soundblaster16PCI. It is
very simple, just how to install it to windows plus troublshooting. I
didn’t find any map infomation. By default the game port is located at
0x201, But I don’t know how about this card. Can you please tell me more
detaily about where and how to find it so I can search on the website? I
am so new to the low level driver programming.

Thank you very much.

Lily


Jens H Jorgensen wrote:
The listed PCI information gives you information about the PCI base
address
registers, but you have to get the documentation for the PCI card to see
what the base address registers points at, and furthermore what the
register
map is for that particular device.

Furthermore look at the QNX pci_*() functions on how to retrieve that
information from your program.


Jens
“Lily” <> fanxm0712@yahoo.ca> > wrote in message
news:> 3EB1ECE5.8050706@yahoo.ca> …

I just have an audio card with a game port connected to QNX6.2.0, I need
to read the joystick from the game port, but I don’t know what the I/O
port number is that used in the program with out8(), and what the memory
address is.

The infomation I got from “pci -vvv” is:

Class = Multimedia (Audio)
Vendor ID = 1274h, Ensoniq
Device ID = 5880h, 5880 AudioPCI
PCI index = 0h
Class Codes = 040100h
Revision ID = 2h
Bus number = 2
Device number = 12
Function num = 0
Status Reg = 3410h
Command Reg = 105h
I/O space access enabled
Memory space access disabled
Bus Master enabled
Special Cycle operations ignored
Memory Write and Invalidate disabled
Palette Snooping disabled
Parity Checking disabled
Data/Address stepping disabled
SERR# driver disabled
Fast back-to-back transactions to different agents enabled
Header type = 0h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 20h
Cache Line Size= 0h
PCI IO Address = dc00h length 64 enabled
Subsystem Vendor ID = 1274h
Subsystem ID = 2000h
Max Lat = 128ns
Min Gnt = 12ns
PCI Int Pin = INT A
Interrupt line = 5
Capabilities Pointer = dch
Capability ID = 1h
Capabilities = 421h - 3h
Device Dependent Registers:
0x40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xD0: 00 00 00 00 00 00 00 00 00 00 00 00 01 00 21 04
0xE0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Can anyone tell me where I can find it? Thanks a lot.

Lily


\

Thanks Jens. Followed your instructions, I got a sample program at
http://www.qnx.com/developer/articles/nov2000a/index.html on how to
detect the hardare. After I run:

pci_attach(0);
info.VendorId = 0x1274;
info.DeviceId = 0x5880;
hdl=pci_attach_device(NULL,PCI_SHARE|PCI_SEARCH_VEND,0,&info);

printf("Port: 0x%llx ",info.CpuBaseAddress_);
printf(“AddrSize(byte): %d\n”, info.BaseAddressSize);
pci_deteach(hdl);

The ouput is “Port: 0xdc00 AddrSize(byte): 64”, the same as what I saw
with pci -v. Then I use
ioport = mmap_device_io(64, oxdc00);

I think the ioport now is the portnumber needed in in8(). Am I right?

Lily


Jens H Jorgensen wrote:_

_Hello LilyNULL, PCI_SHARE|PCI_SEARCH_VEND, 0, &info)

Typically when I start developing a device driver there two key sources of
information:
\

  • documentation on the chipset on the PCI card (almost always a “must”)
  • open source drivers for same device.

    For instance I am working on driver for IEEE 1394 right now, and it has an
    OHCI
    1394 chip on it, so I search the web for the OHCI specification. The
    specification
    tells me what the PCI base addresses point at and documents the register
    map.

    Just to clarify - it seems like the sound card only has one IO PCI base
    address:

    PCI IO Address = dc00h length 64 enabled

    Above typicall means that the first register for the sound chip is located
    at 0xdc00.
    Furthermore it tells me that there are 64 bytes of registers, which are IO
    mapped.

    You need some additional information in order to determine the size and
    offset from
    0xdc00 on the individual registers.

    Hope above helped a little.

    Jens


    “Lily” <> fanxm0712@yahoo.ca> > wrote in message
    news:> 3EB28C69.9010306@yahoo.ca> …

    I have the pci soundcard document – Creative Soundblaster16PCI. It is
    very simple, just how to install it to windows plus troublshooting. I
    didn’t find any map infomation. By default the game port is located at
    0x201, But I don’t know how about this card. Can you please tell me more
    detaily about where and how to find it so I can search on the website? I
    am so new to the low level driver programming.

    Thank you very much.

    Lily


    Jens H Jorgensen wrote:

    The listed PCI information gives you information about the PCI base

    address

    registers, but you have to get the documentation for the PCI card to see
    what the base address registers points at, and furthermore what the

    register

    map is for that particular device.

    Furthermore look at the QNX pci_*() functions on how to retrieve that
    information from your program.


    Jens
    “Lily” <> fanxm0712@yahoo.ca> > wrote in message
    news:> 3EB1ECE5.8050706@yahoo.ca> …


    I just have an audio card with a game port connected to QNX6.2.0, I need
    to read the joystick from the game port, but I don’t know what the I/O
    port number is that used in the program with out8(), and what the memory
    address is.

    The infomation I got from “pci -vvv” is:

    Class = Multimedia (Audio)
    Vendor ID = 1274h, Ensoniq
    Device ID = 5880h, 5880 AudioPCI
    PCI index = 0h
    Class Codes = 040100h
    Revision ID = 2h
    Bus number = 2
    Device number = 12
    Function num = 0
    Status Reg = 3410h
    Command Reg = 105h
    I/O space access enabled
    Memory space access disabled
    Bus Master enabled
    Special Cycle operations ignored
    Memory Write and Invalidate disabled
    Palette Snooping disabled
    Parity Checking disabled
    Data/Address stepping disabled
    SERR# driver disabled
    Fast back-to-back transactions to different agents enabled
    Header type = 0h Single-function
    BIST = 0h Build-in-self-test not supported
    Latency Timer = 20h
    Cache Line Size= 0h
    PCI IO Address = dc00h length 64 enabled
    Subsystem Vendor ID = 1274h
    Subsystem ID = 2000h
    Max Lat = 128ns
    Min Gnt = 12ns
    PCI Int Pin = INT A
    Interrupt line = 5
    Capabilities Pointer = dch
    Capability ID = 1h
    Capabilities = 421h - 3h
    Device Dependent Registers:
    0x40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xD0: 00 00 00 00 00 00 00 00 00 00 00 00 01 00 21 04
    0xE0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

    Can anyone tell me where I can find it? Thanks a lot.

    Lily_



    \

You should not need to do the mmap_* for IO mapped memory - just use the
in8() and out8() functions.

You do need to use the ThreadCtrl() function to allow your app. to do IO
operations.


Jens



“Lily” <fanxm0712@yahoo.ca> wrote in message
news:3EB2E1E6.2050503@yahoo.ca

Thanks Jens. Followed your instructions, I got a sample program at
http://www.qnx.com/developer/articles/nov2000a/index.html > on how to
detect the hardare. After I run:

pci_attach(0);
info.VendorId = 0x1274;
info.DeviceId = 0x5880;
hdl=pci_attach_device(NULL,PCI_SHARE|PCI_SEARCH_VEND,0,&info);

printf("Port: 0x%llx ",info.CpuBaseAddress> _);
printf(“AddrSize(byte): %d\n”, info.BaseAddressSize> );
pci_deteach(hdl);

The ouput is “Port: 0xdc00 AddrSize(byte): 64”, the same as what I saw
with pci -v. Then I use
ioport = mmap_device_io(64, oxdc00);

I think the ioport now is the portnumber needed in in8(). Am I right?

Lily


Jens H Jorgensen wrote:
Hello LilyNULL, PCI_SHARE|PCI_SEARCH_VEND, 0, &info)

Typically when I start developing a device driver there two key sources
of
information:
\

  • documentation on the chipset on the PCI card (almost always a “must”)
  • open source drivers for same device.

    For instance I am working on driver for IEEE 1394 right now, and it has
    an
    OHCI
    1394 chip on it, so I search the web for the OHCI specification. The
    specification
    tells me what the PCI base addresses point at and documents the register
    map.

    Just to clarify - it seems like the sound card only has one IO PCI base
    address:

    PCI IO Address = dc00h length 64 enabled

    Above typicall means that the first register for the sound chip is
    located
    at 0xdc00.
    Furthermore it tells me that there are 64 bytes of registers, which are
    IO
    mapped.

    You need some additional information in order to determine the size and
    offset from
    0xdc00 on the individual registers.

    Hope above helped a little.

    Jens


    “Lily” <> fanxm0712@yahoo.ca> > wrote in message
    news:> 3EB28C69.9010306@yahoo.ca> …

    I have the pci soundcard document – Creative Soundblaster16PCI. It is
    very simple, just how to install it to windows plus troublshooting. I
    didn’t find any map infomation. By default the game port is located at
    0x201, But I don’t know how about this card. Can you please tell me more
    detaily about where and how to find it so I can search on the website? I
    am so new to the low level driver programming.

    Thank you very much.

    Lily


    Jens H Jorgensen wrote:

    The listed PCI information gives you information about the PCI base

    address

    registers, but you have to get the documentation for the PCI card to
    see
    what the base address registers points at, and furthermore what the

    register

    map is for that particular device.

    Furthermore look at the QNX pci_*() functions on how to retrieve that
    information from your program.


    Jens
    “Lily” <> fanxm0712@yahoo.ca> > wrote in message
    news:> 3EB1ECE5.8050706@yahoo.ca> …


    I just have an audio card with a game port connected to QNX6.2.0, I
    need
    to read the joystick from the game port, but I don’t know what the I/O
    port number is that used in the program with out8(), and what the
    memory
    address is.

    The infomation I got from “pci -vvv” is:

    Class = Multimedia (Audio)
    Vendor ID = 1274h, Ensoniq
    Device ID = 5880h, 5880 AudioPCI
    PCI index = 0h
    Class Codes = 040100h
    Revision ID = 2h
    Bus number = 2
    Device number = 12
    Function num = 0
    Status Reg = 3410h
    Command Reg = 105h
    I/O space access enabled
    Memory space access disabled
    Bus Master enabled
    Special Cycle operations ignored
    Memory Write and Invalidate disabled
    Palette Snooping disabled
    Parity Checking disabled
    Data/Address stepping disabled
    SERR# driver disabled
    Fast back-to-back transactions to different agents enabled
    Header type = 0h Single-function
    BIST = 0h Build-in-self-test not supported
    Latency Timer = 20h
    Cache Line Size= 0h
    PCI IO Address = dc00h length 64 enabled
    Subsystem Vendor ID = 1274h
    Subsystem ID = 2000h
    Max Lat = 128ns
    Min Gnt = 12ns
    PCI Int Pin = INT A
    Interrupt line = 5
    Capabilities Pointer = dch
    Capability ID = 1h
    Capabilities = 421h - 3h
    Device Dependent Registers:
    0x40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0x90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xD0: 00 00 00 00 00 00 00 00 00 00 00 00 01 00 21 04
    0xE0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

    Can anyone tell me where I can find it? Thanks a lot.

    Lily_





    \