kernel: v4 waits for a key in arch_halt(), not a spin (#151)
Build / Image RASPI (push) Successful in 3m9s
Build / Image PC (push) Successful in 4m27s
Build / Image MILKV (push) Successful in 3m18s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 10m27s
Acceptance / Acceptance (pull_request) Successful in 15m15s
Build / Image RASPI (push) Successful in 3m9s
Build / Image PC (push) Successful in 4m27s
Build / Image MILKV (push) Successful in 3m18s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 10m27s
Acceptance / Acceptance (pull_request) Successful in 15m15s
An idle StarshipOS kept a CPU core 100% busy: sk_v4_readline(), with nothing typed, and sk_v4_identity_wait(), headless until Zuse, waited in arch_relax(). Both now halt until the next interrupt (hlt; wfi on aarch64 and riscv64): the heartbeat's timer, ISR-driven on all three, wakes them at 100 Hz, so a key is still seen within a tick. Idle at the prompt, QEMU's CPU: 100% -> 1% of a core on amd64, 1% on aarch64 and riscv64. Acceptance passes: amd64 logs/20261108-005539, aarch64 -005753, riscv64 -010136 (POST 538/538, one dict_hash, 7 ok), the stick loaded high, test-32 (39 programs, 0 failures). FABRIC-3 XLVIII.5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
This commit is contained in:
@@ -6263,3 +6263,19 @@ Found on the way:
|
||||
- **Try it in the .com's navigation** (#117): "Try it" added to the canvas's Home and Inquiries
|
||||
artboards, the .com rebuilt from them (`site/com`) and installed. Checked as a visitor: the home
|
||||
page, the "Try it" link, the Try it page in 1.1 s, its framed console Ready.
|
||||
|
||||
### 5. #151: the idle loop halts (2026-11-08)
|
||||
|
||||
Ruled (Captain Bob): "Fix the kernel problem." The v4 system waited for a key -- `sk_v4_readline()`
|
||||
with nothing typed, and `sk_v4_identity_wait()` headless until Zuse -- in `arch_relax()`, a spin.
|
||||
Both now wait in `arch_halt()` (`hlt` on amd64, `wfi` on aarch64 and riscv64) until the next
|
||||
interrupt: the heartbeat's timer, which is ISR-driven on all three (`heartbeat_tick()`), wakes them
|
||||
at 100 Hz, so a key is seen within a tick, as the cursor's blink and the identity beat already
|
||||
were. v3's REPL (`repl.c`) still spins; v3 is not in acceptance.
|
||||
|
||||
Verified: idle at Zuse's prompt for 20 s, QEMU's CPU **100% -> 1%** of a core on amd64 (the demo
|
||||
machine), and **1%** on aarch64 and riscv64 (`logs/20261108-011614`, `-011931`); the acceptance
|
||||
protocol passes -- amd64 `logs/20261108-005539`, aarch64 `-005753`, riscv64 `-010136`, POST
|
||||
538/538, `dict_hash 0xfec8c47cfc6f437f` on all three, `7 ok` typed and answered; the stick loaded
|
||||
high; `test-32` (39 programs, 0 failures). The demo's CPU cap (`CPUQuota=100%`) can be relaxed
|
||||
once this reaches the server.
|
||||
|
||||
@@ -113,7 +113,11 @@ static int sk_v4_readline(void)
|
||||
} else {
|
||||
heartbeat_service();
|
||||
}
|
||||
arch_relax();
|
||||
/* Nothing typed: wait for the next interrupt, not in a spin (#151 -- the spin kept a
|
||||
* CPU core 100% busy at the prompt, and the demo's host with it). The heartbeat's
|
||||
* timer wakes it at 100 Hz, so a key is seen within a tick, as the blink and the
|
||||
* identity beat are. */
|
||||
arch_halt();
|
||||
continue;
|
||||
}
|
||||
if (c == '\r' || c == '\n') {
|
||||
|
||||
@@ -331,7 +331,7 @@ void sk_v4_identity_wait(void)
|
||||
while (!g_zuse_session) {
|
||||
sk_v4_discard_input();
|
||||
sk_v4_identity_beat();
|
||||
arch_relax();
|
||||
arch_halt(); /* headless, until Zuse: wait for the next tick, not a spin (#151) */
|
||||
}
|
||||
sk_v4_discard_input();
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user