failed to access memory according to the from PCI bus address?

Discussion in 'Linux Hardware' started by hust_gaoyi, Mar 9, 2013.

  1. hust_gaoyi

    hust_gaoyi New Member

    Mar 9, 2013
    Likes Received:
    I am now trying to develope the DMA part for a PCI driver on X86_64. I firstly allocated a buffer for DMA transaction as following:

    virt = dma_alloc_coherent(&dev, size , &dma_handle, GFP_KERNEL);
    if(!virt)goto err_exit;

    Then I checked the memory content according to the physical memory address, using the following command on the shell:
    dd if=/dev/mem bs=1 skip=$(( dma_handle )) count=128 | hexdump
    However, the shell reports:
    dd: reading `/dev/mem': Operation not permitted
    2056+0 records in
    2056+0 records out
    1052672 bytes (1.1 MB) copied, 0.44834 s, 2.3 MB/s
    Hope anyone can provide some help. The total physical memory size is 4GB.


Share This Page