kernel user dma buffers

From: david (sector2@ihug.co.nz)
Date: Tue Feb 01 2000 - 17:48:01 EST


hi
 i am try to set aside some memory so i can do some dma

so i put this in the kernel 2.3.38 init/main.c
        dma.BufferKernAdd = vmalloc( dma.BufferSize ) ;
        dma.BufferPhysAdd = virt_to_phys(dma.BufferKernAdd) ;
        and then filled the space with nnnnnnnnn
    so i got the memory fine and then in my user program

    i use mmap
    ( NULL , dma.BufferSize , PROT_READ | PROT_WRITE , MAP_SHARED,
        /dev/mem , dma.BufferPhysAdd ) ;
    this worked ok but i can not read the mem

so can some one please help me on this and also

Thank you
    David <sector2@ihug.co.nz>

what if i used change_protection(....) can this let the memory be readed

from user space (i just dont know the pgprot flags)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Feb 07 2000 - 21:00:07 EST