FORTH: KEY-EVENT unified keyboard interface, closes 4.3.5-4.3.5f (item 4.3.5f)
Punch list §25 item 4.3.5f complete. Keyboard-input slice done. New KEY-EVENT ( -- keycode pressed -1 | 0 ) converges amd64's i8042, riscv64's and aarch64's virtio-keyboard-pci behind one shape. Translation needed is minimal: XT Set-1 make codes and Linux input keycodes are numerically identical across the standard 84-key block (a documented historical property of the Linux input subsystem, confirmed against this host's own headers and this tree's own prior live observations), so amd64 needs two lines, riscv64/aarch64 need none. Verified live with a real keypress on all three architectures: identical "-1 1 30" output everywhere. Three-arch acceptance boot clean. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
a373c9124a
commit
d0835c674b
@@ -4323,7 +4323,7 @@ document and committing that amendment as its own item.*
|
||||
> (`logs/20260808-122743/riscv64/`, unaffected — this item's riscv64-side changes were
|
||||
> doc-comment-only).
|
||||
|
||||
- [ ] **4.3.5f — Checkpoint: one keyboard abstraction, three architectures, no polling.**
|
||||
- [x] **4.3.5f — Checkpoint: one keyboard abstraction, three architectures, no polling.**
|
||||
Converge 4.3.5/4.3.5c/4.3.5e behind a single scancode/keycode interface so the REPL
|
||||
keyboard-input work (M8, outside Stadium) has one thing to call, not three. Stop and
|
||||
review here — same posture as 4.3.4 — before scoping REPL wiring.
|
||||
@@ -4333,6 +4333,39 @@ document and committing that amendment as its own item.*
|
||||
three-arch QEMU boot, logs committed.
|
||||
*Refs:* §27.5.
|
||||
|
||||
> **Done, 2026-08-08. Keyboard-input slice (4.3.5–4.3.5f) complete.** New `KEY-EVENT
|
||||
> ( -- keycode pressed -1 | 0 )` in `keyboard_words.c`, alongside (not replacing) the
|
||||
> existing per-device diagnostics `KBD-SCAN`/`VKBD-EVENT`. `keycode` uses the Linux input
|
||||
> keycode namespace; `pressed` is 1 or 0.
|
||||
>
|
||||
> **The convergence needed almost no translation, for a reason worth recording rather than
|
||||
> just asserting.** Comparing this build host's own `/usr/include/linux/input-event-codes.h`
|
||||
> against 4.3.5's already-documented live scancode observations (`sendkey a` → 30,
|
||||
> `sendkey b` → 48) showed `KEY_A=30`/`KEY_B=48` match those XT Set-1 make codes exactly —
|
||||
> checked systematically across the full standard 84-key block (`KEY_ESC=1` through
|
||||
> `KEY_F10=68`), all identical to the historical XT/AT Set-1 numbering. Not a coincidence:
|
||||
> documented historical property of how Linux's input keycode namespace was originally
|
||||
> defined. So amd64's translation is two lines (`keycode = sc & 0x7F`, `pressed = !(sc &
|
||||
> 0x80)`) covering the entire non-extended key range, not a lookup table — riscv64/aarch64
|
||||
> need no translation at all, `virtio_input_pop_event()`'s `code`/`value` already live in
|
||||
> the same namespace. Explicitly out of scope, matching this checkpoint's "one shared shape
|
||||
> proven live," not full coverage: extended (`0xE0`-prefixed) i8042 scancodes, virtio-input
|
||||
> autorepeat (`value=2`, folded into "still pressed" here) — deferred to the REPL wiring
|
||||
> item (M8) this checkpoint unblocks.
|
||||
>
|
||||
> Verified live on all three architectures with a real `sendkey a`, same technique as
|
||||
> 4.3.5/4.3.5c/4.3.5e — identical output shape everywhere, `-1 1 30` (flag, pressed,
|
||||
> keycode): amd64 (`logs/20260808-123405/amd64/qemu-amd64-20260808-123405-keyevent-
|
||||
> verify.log`), riscv64 (`logs/20260808-124059/riscv64/qemu-riscv64-20260808-124059-
|
||||
> keyevent-verify.log`), aarch64 (`logs/20260808-124207/aarch64/qemu-aarch64-20260808-
|
||||
> 124207-keyevent-verify.log`) — the exact "same shape of event... confirmed with a live
|
||||
> keypress test per architecture" this item's acceptance requires. Three-architecture
|
||||
> standard acceptance boot clean, zero exceptions: amd64 (`logs/20260808-124331/amd64/`),
|
||||
> aarch64 (`logs/20260808-124418/aarch64/`), riscv64 (`logs/20260808-124524/riscv64/`).
|
||||
>
|
||||
> This closes the keyboard-input slice opened at 4.3.5. Next per the 2026-08-07 sequencing
|
||||
> note below: glyph rendering (stroke-based font capsules), not yet scoped.
|
||||
|
||||
> **Sequencing noted 2026-08-07, not yet scoped:** keyboard input (4.3.5–4.3.5f) →
|
||||
> glyph rendering (stroke-based font capsules) → REPL — in that order, before the 4.4
|
||||
> Artemis boundary. Recorded so the order is not lost between sessions; neither glyph
|
||||
|
||||
Reference in New Issue
Block a user