Accessing Adapter memory [help wanted]

Mauro Condarelli (mc5686@mclink.it)
Fri, 20 Oct 1995 09:11:02 +0000


hi,
i'm writing a device driver for a PCI device (matrox meteor).
I'm at the point where i have done all the preparatory work, properly
recognized the board (via pcibios_*_config_*() functions) and i
happen to have the physical address of the internal registers i have
to manipulate.
This physical address happen to begin at 0xf0000000.

I understand (from <asm/io.h>) that in kernel mode the physical and
logical addresses are the same, null translation (as ptovided by
virt_to_phys()/phis_to_virt()).
Is this correct??
If not, which correction should i apply? (doc ptrs wellcome).

As a matter of fact the module sigfaults (general protection: 0000)
the first time that i try to access the adapter memory..
This makes sense, since, even if logical and physical addresses are
the same, only the detected RAM would be marked as accessible in
LDT/GDT (at present i don't fully understand how this is done,
presumably in arch/i386/mm/init.c).

How can i convince the kernel to give me access to those bytes??
Should i allocate a new selector? how? i don't belive mmap()-ping
/dev/kmem can be of any help (i admit i didn't try, but i don't think
it can work).

Can someone put me on thee right track?? (PLEEEASE) :) :)
The only thing i can think now is to go back to study the kernel and
try to find out some device driver (SCSI? NET?) that has the same
problem and see how it solves it. A ptr to such a driver is wellcome.
Most of the drivers, even if they access adapter-RAM, have addresses
<1MB, so no special care is required.

Thanks in advance
Yours Truely :) :)
\_____ Mauro Condarelli (mc5686@mclink.it)