linux - Why dd returns bad address error with /dev/mem? -


i run embedded linux-3.10.29 on powerpc board (big-endian). debug ethernet controller, need check system registers. soc system registers lies @ address 0xe0000000 (3584m). disabled config_strict_devmem in linux config , ran:

$ dd if=/dev/mem of=/home/mem.dump bs=1024 count=1k skip=3584k dd: /dev/mem: bad address 

this command should skip first (3584k * 1024b =) 3584mb /dev/mem , copy leading (1k * 1024b =) 1mb /home/mem.dump. tried dump various 4kb ranges inside overall 1mb, leading same issue.

this memory space ioremapped kernel. although not quite sure problem.

# cat /proc/iomem  00000000-0fffffff : system ram 80000000-8fffffff : /pci@e0008500   80000000-8007ffff : 0000:00:10.0 90000000-9fffffff : /pci@e0008500   90000000-900003ff : 0000:00:10.0     90000000-900003ff : sata_sil e0004500-e0004507 : serial e0004600-e0004607 : serial f8000000-ffffffff : physmap-flash.0   f8000000-ffffffff : physmap-flash.0  # cat /proc/vmallocinfo  0xd1000000-0xd1002000    8192 ipic_init+0x98/0x198 phys=e0000000 ioremap 0xd1004000-0xd1006000    8192 mpc83xx_restart_init+0x1c/0x38 phys=e0000000 ioremap 0xd1006000-0xd1008000    8192 serial_dev_init+0x118/0x168 phys=e0004000 ioremap 0xd1008000-0xd100a000    8192 serial_dev_init+0x118/0x168 phys=e0004000 ioremap 0xd100a000-0xd100c000    8192 of_iomap+0x30/0x54 phys=e0005000 ioremap 0xd100c000-0xd100e000    8192 pcim_iomap+0x5c/0x7c phys=90000000 ioremap 0xd100e000-0xd1010000    8192 of_fsl_spi_probe+0x394/0x574 phys=e0007000 ioremap 0xd1010000-0xd1012000    8192 of_iomap+0x30/0x54 phys=e0024000 ioremap 0xd1012000-0xd1014000    8192 of_iomap+0x30/0x54 phys=e0025000 ioremap 0xd1014000-0xd1016000    8192 of_iomap+0x30/0x54 phys=e0024000 ioremap 0xd1016000-0xd1018000    8192 of_iomap+0x30/0x54 phys=e0025000 ioremap 0xd1018000-0xd101a000    8192 of_iomap+0x30/0x54 phys=e0003000 ioremap 0xd101a000-0xd101c000    8192 of_iomap+0x30/0x54 phys=e0003000 ioremap 0xd1080000-0xd9081000 134221824 devm_ioremap+0x44/0x9c phys=f8000000 ioremap 

i have alternative called mem_util , @tangrs taught me devmem provides same functionality. bad address issue dd?

[edit]

$ strace dd if=/dev/mem of=/home/mem.dump bs=1024 count=1k skip=3584k [...] _llseek(0, 3758096384, [3758096384], seek_cur) = 0 read(0, 0x100b1008, 1024)               = -1 efault (bad address) 


Comments

Post a Comment

Popular posts from this blog

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -