Skip to content

feat(shell): add poke command to write a byte to memory - #113

Merged
im-nymii merged 1 commit into
Auri-OS:developfrom
kudasaixc:feat/poke-command
Jul 28, 2026
Merged

feat(shell): add poke command to write a byte to memory#113
im-nymii merged 1 commit into
Auri-OS:developfrom
kudasaixc:feat/poke-command

Conversation

@kudasaixc

@kudasaixc kudasaixc commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Adds a poke command to the shell, the write counterpart to the existing peek (read) command.

poke <hex address> <hex value>

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:

  • mmu_debug_poke(addr, value) in src/mm/mmu.zig writes a byte through a volatile pointer and reports the result on the VGA terminal and the serial log, same shape as mmu_debug_peek.
  • prototype in src/include/mm.h
  • a poke branch in shell_execute that reuses htoi and checks argc == 3
  • one help line

Tested in QEMU (Zig 0.16.0, USE_ZIG path, AURI_TEST_MODE), round-trip works:

root@auri-os~$ poke b8000 41
Wrote 0x00000041 at 0x000B8000
root@auri-os~$ peek b8000
Value found : 0x00000041
root@auri-os~$ poke
usage: poke <hex address> <hex value>

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.

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.
@im-nymii

im-nymii commented Jul 28, 2026

Copy link
Copy Markdown
Member

Hi,
thank you for contributing!

We prefer using the serial_write_string() functions from Serial.h for debugging features.

@im-nymii

Copy link
Copy Markdown
Member

Nevermind, i didn't saw it was already done.
LGTM.

@im-nymii
im-nymii merged commit 0cbd55e into Auri-OS:develop Jul 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants