【发布时间】:2022-11-13 03:52:27
【问题描述】:
我正在尝试使用 u-boot (CMP) 命令比较两个内存位置。我有 u-boot-swap.bin,它在 MTD 分区 (/dev/mtd2) 中闪烁。 MMC 中存在相同的 u-boot-swap.bin 文件。我想看看 u-boot 是否在 MTD 位置 (/dev/mtd2) 闪烁,并且 MMC 分区中的一个是否相同。
我尝试了以下命令,
从/dev/mtd2读取u-boot-swap.bin到内存地址0x81000000
=> sf read 0x81000000 0x40000 0xc0000
device 0 offset 0x40000, size 0xc0000
SF: 786432 bytes @ 0x40000 Read: OK
从MMC读取u-boot-swap.bin到内存地址0x82000000
=> ext4load mmc 0:2 0x82000000 /boot/u-boot-swap.bin
445512 bytes read in 144 ms (2.9 MiB/s)
然后我尝试使用cmp 命令比较两个内存位置,但我得到了不匹配
=> cmp 0x81000000 0x82000000 445512
word at 0x8105c7dc (0x76203033) != word at 0x8205c7dc (0x76203130)
Total of 94711 word(s) were the same
=> cmp 0x81000000 0x82000000 786432
word at 0x8105c7dc (0x76203033) != word at 0x8205c7dc (0x76203130)
Total of 94711 word(s) were the same
我在这里做错了什么?如何比较两个内存位置?
【问题讨论】: