Re: Memory Mapping a char array in User Space

2010-07-27 Thread Ravi Gupta
Hi David, Thanks for the quick reply. One more thing, in the end I have to memory map a DMA buffer allocated using pci_alloc_consisten() function to user space. *> I think you should be leaving the mapping to the core VM routines.* *> Furthermore, I don't think *you* should be calling remap_pfn_r

Re: Memory Mapping a char array in User Space

2010-07-26 Thread David Howells
Ravi Gupta wrote: > My device gets memory map successfully but when I tried to read from it > I get garbage value. Is there something that I am missing? For starters, you really should allocate a page for your buffer rather than using kernel static data. mmap() allows access to page-aligned dat

Memory Mapping a char array in User Space

2010-07-26 Thread Ravi Gupta
Hi, I am new to linux device driver development and I'm trying to learn the memory mapping. Currently I have written a simple device driver(major number 251 and minor number 0) and in its mmap(struct file *file, struct vm_area_struct *vma) function, I am trying to memory map a global character arr