Skip to contentSkip to conversation

inb outb in C ...

DISCUSSION Maharajan Veerabag 2 participants 2 messages Jun 5, 2003 – Jun 10, 2003

lore
Share & tools
lore
#0 lore raw

Hi all,
i am in the process of writing a linux device driver
in C. is it possible to access the pci local I/O address space with inb,outb instructions... directly or is any request of space is required. What is the exact power of the inb family of instructions..
can somebody explain this.
thank you.

regards,
Maharajan Veerabag.

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

#1 lore raw

See chapter 16 of "PCI System Architecture" Mindshare, Inc.

For x86 and PowerPC, configuration utilizes 2 32 bit I/O ports located at 0x0cf8 (address config) and 0x0cfc (data config):

To access a PCI function's config port:

1. Write the target bus number, physical device number, function number, ... to the configuration address port (0x0cf8).
2. Read or Write the I/O port data (0x0cfc)

Make note that these I/O ports are 32 bits wide (really groups of 4 bit ports, organized as little endian).

Anyway, I don't feel like typing the book's chapter, nor would Mindshare appreciated it. You could use the 0x0cf8 as an aid to searching the web...

Also, you can get ALSA driver code from the national developer's site (http://wwwd.national.com/national/developer.nsf/home/welcome.htm) which is an example of PCI configuration without calling the linux PCI config functions (and it is ugly).

Also, take a look at the following kernel files:

linux/include/asm-x86_64/pci-direct.h
./arch/x86_64/kernel/pci-pc.c
./arch/i386/kernel/pci-pc.c

Among others...

Nat

Quoted 22 lines · Maharajan Veerabag

Hi all,
i am in the process of writing a linux device driver in C. is it possible to access the pci local I/O address space with inb,outb instructions... directly or is any request of space is required. What is the exact power of the inb family of instructions..
can somebody explain this.
thank you.

regards,
Maharajan Veerabag.

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 4 lines
_________________________________________
Nat Ersoz             [email protected]  -o) Myrio Corporation     Phone: 425.897.7278  /\\
3500 Carillon Point   Cell:  425.417.5182 _\_V
Kirkland, WA 98033    Fax:   425.897.5600