sos-os / kernel

The Stupid Operating System
Apache License 2.0
264 stars 16 forks source link

Consistent notation for VAddr/PAddr #101

Closed hawkw closed 7 years ago

hawkw commented 7 years ago

Currently, we tend to format both virtual (VAddr) and physical (PAddr) addresses using the "{:#p}" format specifier for pointers. This works fine, but makes telling whether an address is physical or virtual difficult when reading through logs, et cetera.

It'd be nice if we could have a consistent notation for these. I suggest possibly replacing "0xff00" with "Pxff00 for physical addresses and Vxff00 for virtual addresses, or appending a P/V to the end of the hex address, like 0xff00_p.

hawkw commented 7 years ago

Someone who knows how string formatting works in Rust could probably implement this fairly easily without any OS dev knowledge.

Therefore, I'm tagging it as "easy" and "help wanted", in case anybody's looking for a good issue for a first-time contributor...