Skip to content

feat(shell): add hexdump command for hex + ASCII memory views - #114

Open
kudasaixc wants to merge 1 commit into
Auri-OS:developfrom
kudasaixc:feat/hexdump-command
Open

feat(shell): add hexdump command for hex + ASCII memory views#114
kudasaixc wants to merge 1 commit into
Auri-OS:developfrom
kudasaixc:feat/hexdump-command

Conversation

@kudasaixc

Copy link
Copy Markdown
Contributor

Adds a hexdump command to the shell.

usage: hexdump

It dumps a memory range as the classic offset / hex / ASCII table, 16 bytes per row. peek only reads a single byte and memdump only shows the PMM bitmap, so this fills the gap: the view you actually want when looking at the heap, the page tables or the VGA buffer.

The address is parsed with htoi (hex) and the length with atoi (decimal), reusing the existing helpers, plus terminal_print_hex for the offset column and a small print_hex_byte helper for the byte column. Like peek, mia and crash it trusts its input (no address validation), same as the other debug commands here.

Built and tested locally with the CI setup (Zig 0.16.0 + NASM, USE_ZIG path) and run in QEMU with AURI_TEST_MODE:

root@auri-os~$ hexdump b8000 48
0x000B8000  72 0C 6F 0C 6F 0C 74 0C 40 0B 61 0F 75 0F 72 0F  |r.o.o.t.@.a.u.r.|
0x000B8010  69 0F 2D 0F 6F 0F 73 0F 7E 07 24 0A 20 0A 68 07  |i.-.o.s.~.$. .h.|
0x000B8020  65 07 78 07 64 07 75 07 6D 07 70 07 20 07 62 07  |e.x.d.u.m.p. .b.|
root@auri-os~$ hexdump
usage: hexdump <hex address> <length>

That dump is the VGA text buffer, so the ASCII column shows the prompt text with the attribute bytes rendering as dots.

hexdump <hex address> <length> dumps a memory range as a classic
offset / hex / ASCII table, 16 bytes per row. It complements peek
(single byte) and memdump (PMM bitmap) with the memory view you
actually want when inspecting the heap, page tables or the VGA
buffer. Reuses htoi for the address, atoi for the length, and the
terminal print helpers.

Example: hexdump B8000 48 shows the VGA text buffer.
@im-nymii
im-nymii self-requested a review July 28, 2026 13:51
@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.

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