Created
May 30, 2024 05:36
-
-
Save krisk0/ae73f2342e898266fe23b0563643f259 to your computer and use it in GitHub Desktop.
dump device memory contents using devmem utility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
is_empty() { | |
local a="`echo $1`" | |
[ ."$a" == . ] | |
} | |
dump() { | |
printf "\n\n%s\n" "$1" | |
local n=$(($3 / 4)) | |
local i=0 | |
local j=0 | |
local v | |
while [ $i -lt $n ] ; do | |
v=`devmem $((0x$2 + i * 4)) 32` | |
is_empty "$v" && v='????????' | |
i=$((i+1)) | |
j=$((j+1)) | |
printf "%s " ${v#0x} | |
[ $j == 8 ] && { | |
echo | |
j=0 | |
} | |
done | |
} | |
dump "SDR UCG0" 01900000 $((16*1024)) | |
#dump "SDR URB" 01910000 $((0x154)) | |
dump "SDR URB 00-14" 01910000 $((0x18)) | |
dump "SDR URB 20-98" 01910020 $((0x9C - 0x20)) | |
dump "SDR URB A0-A4" 019100A0 8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment