xobs / fernly

Fernvale research OS
BSD 2-Clause "Simplified" License
143 stars 52 forks source link

cmd-hex: Dump absolute memory address. #20

Closed pfalcon closed 9 years ago

pfalcon commented 9 years ago

Seeing zeros is quite confusing - you never know if you mistypes something (there's not even a number format error reporting), or something else.

pfalcon commented 9 years ago

I'm absolutely sure that's right thing to do for "hex" command. For example, now when I execute "hex 0xffff0000" and "hex ffff0000" I get 2 different dumps both of which show "00000000" in the address column. Which of them lies? This patch disambiguates them.

I'm less sure about the implementation. Presence of both serial_print_hex_offset() and serial_print_hex() kinda gives a hint that one of them maybe intended to print abs addresses and one - relative offsets, and the latter feature may be needed for something. But, so far only "hex" uses those facilities, and it should use absolute addresses. When something else will need something else, it can be refactored.