[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PCI doubt!
Hi,
> Mandeep> 2) where is the PCI I/O & Memory space usually mapped? is it
> Mandeep> mapped to a certain portion of the RAM?
>
> PCI I/O space is usually mapped to IA-32 I/O space
> (i.e. in[bwd]/out[bwd] insns). PCI Memory space is mapped to a
> physical address. On non IA-32 architectures I/O space is mapped to a
> physical address too.
And hence we can access the programmed io (PIO) space using "inb", "outb" and
associated instructions on IA-32.
And when using the memory mapped io we can directly make use of memory
(using pointers) after ioremapping the area.
> Mandeep> 3) When the PC boots up does my system BIOS configure these
> Mandeep> memeory regions i.e is there some place from where my
> Mandeep> driver can get an info as to what all memeory regions have
> Mandeep> been requested by a NIC?
>
> *If* the BIOS did this (e.g. when "Boot with PnP OS" is false), these
> regions (as well as IRQs) can be obtained by reading configuration
> space header.
>
If we have to get any information about the memory regions
which the NIC is having, then we can use apis
such as "pci_resource_start", "pci_resource_end" etc.
Practically, when we are writing a driver for the NIC we dont
have to worry about whether the bios has configured it or not,
the linux pci subsystem will make everything available for us.
> Mandeep> 4) When my ethernet driver does a probe can it rely on the
> Mandeep> BIOS (under intel arch.) to provide it with some usefull
> Mandeep> info?
>
> Generally not, because BIOS can be instructed not to configure
> peripherals.
When writing pci network drivers, we can depend of the linux pci subsytem
for all most all the information (check out the apis such as
pci_resource_start, pci_resource_flags, pci_read_config_byte etc)
Hope this helps !
Regards,
KK.
--
HomePage: http://puggy.symonds.net/~krishnakumar
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/