From ef6f3e460ddbf53a752807bcf10a0fec0a72da7f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 25 Aug 2026 17:14:02 -0300 Subject: Write down how to drive the board's three memory words `Peek`, `Poke` and `Hexdump` are the reason this port exists and nothing here said how to reach them. Two things are not guessable. The boot layout: the editor now comes up as ONE EMPTY OUTPUT BUFFER and no shell pane, because a shell is not a layout preference on bare metal but an impossibility - nothing to fork, no pty. That is a pardes-side change; what belongs here is that it is what `zig build interact -Dpardes` puts on the screen. The chord: there is no mouse on a serial line, so execution is `i ESC` then `x` then TAB - write the command into the buffer, select the line, execute the selection (pardes.zig:7669). `o` opens a fresh line for the next one. Nothing about that is discoverable from the screen, and every other spelling I tried failed in a way that looked like the port was broken: `:` opens the tag command line in NORMAL mode, so typing there moves the cursor instead of inserting, and the tag's editable region is seeded with the builtin words, so text typed at its start merges into `Save` and the chord executes the wrong word. Every number in the new section is off the die, including the one that matters: `Peek 0x50110001` answers `peek: MisalignedAddress` on the message row instead of trapping, and a trap here is a watchdog reset that takes the session with it. --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 7ccc7b9..181ec0e 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,37 @@ Everything is a `b.option`, so `zig build -h` lists them all. | `-Dpardes=` | `false` | build the pardes editor as the application. Needs the object below | | `-Dpardes-obj=` | `../02-pardes-code/zig-out/pardes-p4.o` | the editor, compiled freestanding by its own build and linked here | +### Driving the editor over the wire + +`zig build interact -Dpardes` boots the editor with **one empty output buffer** and no shell pane — +a shell is not a layout preference on bare metal but an impossibility, since there is nothing to +fork and no pty to give a terminal pane. Booting one anyway produced exactly that: a pane with no +gutter, no buffer, and every keystroke vanishing into the Fallback's silent pty. + +Three words exist only here, because with no OS there is no MMU and no supervisor, so all 2^32 +addresses are legitimately this program's (`../02-pardes-code/src/board_memory.zig`): + +| word | does | +|---|---| +| `Peek [count]` | `count` 32-bit words, one `addr: value` row each | +| `Poke ` | one 32-bit store, then a load back — the read-back is the point, since MMIO rarely returns what you wrote | +| `Hexdump [len]` | `len` bytes, 16 to a row, hex columns and an ASCII gutter | + +There is no mouse on a serial line, so execution is the keyboard chord: write the command into the +buffer, select it, execute the selection (`pardes.zig:7669`). + +``` +i Peek 0x501101a4 ESC type it into the buffer, then back to normal mode +x select the line +TAB execute the selection; `o` opens a fresh line for the next one +``` + +Measured on ESP32-P4 rev v1.3 silicon: two `Peek`s of the RNG register at `0x501101a4` returned +`0x0e63ce71` then `0xaeaa6919`, so the `*allowzero volatile` reads are genuinely not folded; +`Poke 0x5011002c 0xdeadbeef` into `LP_STORE0` read back as `0xdeadbeef` from a later `Peek`; and +`Peek 0x50110001` answered `peek: MisalignedAddress` on the message row rather than taking the +session down with an unhandled trap, which is the one fault that file exists to prevent. + ## Layout ``` -- cgit v1.3