linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* inb outb in C ...
@ 2003-06-05 15:26 Maharajan Veerabag
  2003-06-10 21:07 ` Nat Ersoz
  0 siblings, 1 reply; 2+ messages in thread
From: Maharajan Veerabag @ 2003-06-05 15:26 UTC (permalink / raw)
  To: linux-c-programming

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: inb outb in C ...
  2003-06-05 15:26 inb outb in C Maharajan Veerabag
@ 2003-06-10 21:07 ` Nat Ersoz
  0 siblings, 0 replies; 2+ messages in thread
From: Nat Ersoz @ 2003-06-10 21:07 UTC (permalink / raw)
  To: Maharajan Veerabag; +Cc: linux-c-programming

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

Maharajan Veerabag wrote:

>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 majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>  
>

-- 
_________________________________________
Nat Ersoz             nat.ersoz@myrio.com  -o) 
Myrio Corporation     Phone: 425.897.7278  /\\
3500 Carillon Point   Cell:  425.417.5182 _\_V
Kirkland, WA 98033    Fax:   425.897.5600




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-06-10 21:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-05 15:26 inb outb in C Maharajan Veerabag
2003-06-10 21:07 ` Nat Ersoz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).