feat(shell): add poke command to write a byte to memory - #113
Merged
Conversation
Complements the existing peek command. mmu_debug_poke mirrors mmu_debug_peek: it writes a byte through a volatile pointer and reports the result on both the VGA terminal and the serial log. The shell command reuses htoi for parsing and validates argc. Usage: poke <hex address> <hex value> Example: poke B8000 41 -> writes 'A' to the top-left VGA cell.
Member
|
Hi, We prefer using the |
Member
|
Nevermind, i didn't saw it was already done. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a poke command to the shell, the write counterpart to the existing peek (read) command.
Everything it needs is already there: peek and mmu_debug_peek for the read side (this mirrors them), htoi for hex parsing, and the shell arg parser with the argc check that memdump already uses. So it rounds out the memory debug commands peek / poke / memdump.
What it does:
Tested in QEMU (Zig 0.16.0, USE_ZIG path, AURI_TEST_MODE), round-trip works:
poke b8000 41 writes 'A' to the top-left VGA cell and peek reads it back.
Like peek, mia and crash, it's a debug primitive that trusts its input (no address validation), consistent with the other debug commands here.