how to remap the memory on PCI card to a new virtual memory?

how to remap the memory on PCI card to a new virtual memory?

Post by ?B¤_o » Fri, 20 Apr 2001 13:50:56



I have a PCI device which have extra memory on it.
I want to use the ioremap() function to get a virtual address
so that I can access the memory.
But when I try to load the module,  it fails and tells me ioremap() and
readb() are unresolved symbols.
I use 2.2.14 linux kernel.
Is there anybody who knows what's wrong?
or can you send me a simple example code to teach me how to use ioremap()
correctly?

best regards,
yu-chen

 
 
 

how to remap the memory on PCI card to a new virtual memory?

Post by André Davi » Fri, 20 Apr 2001 18:52:36



> I have a PCI device which have extra memory on it.
> I want to use the ioremap() function to get a virtual address
> so that I can access the memory.
> But when I try to load the module,  it fails and tells me ioremap() and
> readb() are unresolved symbols.
> I use 2.2.14 linux kernel.
> Is there anybody who knows what's wrong?
> or can you send me a simple example code to teach me how to use ioremap()
> correctly?

Are you including the rigth stuff?

I'm using ioremap ok and I'm including these:

#ifndef __KERNEL__
#  define __KERNEL__
#endif
#ifndef MODULE
#  define MODULE
#endif

#define __NO_VERSION__
#include <linux/module.h>
#include <linux/version.h>

char kernel_version [] = UTS_RELEASE;

#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/proc_fs.h>
#include <linux/types.h>
#include <linux/malloc.h>
#include <linux/pci.h>
#include <linux/mm.h>
#include <asm/io.h>
#include <asm/string.h>

Hope it helps,

Andre

ps - If you measure read speed from the PCI board to memory, please tell
me the numbers. Thanks

--

 "Share the code. If you hide it ain't good."
                                                Popular knowledge

  Andre.David.vcf
< 1K Download

 
 
 

how to remap the memory on PCI card to a new virtual memory?

Post by Grant Edwar » Sat, 21 Apr 2001 00:30:54



>I have a PCI device which have extra memory on it.
>I want to use the ioremap() function to get a virtual address
>so that I can access the memory.
>But when I try to load the module,  it fails and tells me ioremap() and
>readb() are unresolved symbols.
>I use 2.2.14 linux kernel.
>Is there anybody who knows what's wrong?
>or can you send me a simple example code to teach me how to use ioremap()
>correctly?

There's an example driver that does this at

  ftp://ftp.visi.com/users/grante/stuff/demomm.tar.gz

It provides three minor devices that all support the memmap()
system call.  Two of them map regions of memory on the PCI
board, and the third is a locked-down page of system RAM that
can be used as a DMA buffer.

--
Grant Edwards                   grante             Yow!  I'm having
                                  at               a tax-deductible
                               visi.com            experience! I need an
                                                   energy crunch!!

 
 
 

1. PCI memory mapped card : memory gets overwritten

Hi !!
    I am developing a Linux driver for one memory mapped network card (all
command and status registers are mapped in memory)and it is operating very
well.. means Tx and Rx working very well. But whenever I
go in X.. ( start X ) .. the driver operations stops.
    I have used ioremap ( afterwards changed to ioremap_nocache... as I read
in the kernel sources that it is more suitable when we are using mapped
memory for Command and status registers ).
    When the driver operation starts I can see that the memory mapped
register's contents are changed/overwritten by somebody AS SOON AS I do
startx .
why can this happen? Should I set it somehow ) as read-only to other
arts( Xwindows..etc)??..Is this the
problem??.. While in X Windows , does some memory mapping or any great
change in virtual memory organization??..

--Vikram

ELABORATION::
More elaborated card operation is like this.. card gives me memory address
to access it I ioremap it .. I get another memory address and I start
interacting with card.. it works great !! until I start X..

 Sent via Deja.com http://www.deja.com/
 Before you buy.

2. about to install Linux

3. How to remap PCI memory into user space?

4. How to rewrite pages ?

5. Free Virutal Memory is 1% even though Total Free Virtual Memory is above 1GB

6. Release 5.0.2 PPP headaches

7. mmap, virtual memory, physical memory

8. SUMMARY: 'useradd -D -e ...' fails

9. Locking virtual memory or exporting kernel memory?

10. How to handle memory and Virtual memory?

11. Real Memmory /Virtual Memory /Physical Memory Accountancy.

12. RS/6000 memory and virtual memory

13. New: vesafb fails to initalize 1GB system memory and 128MB video memory