SchOS/kernel/core
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nexoniarz ff7afa746e tty: arrow keys, backspace, and four terminals nobody was home on
Three things, all in the first minute of using a shell.

**Arrow keys corrupted the two keystrokes after them.** They arrive as single
keycodes -- KEY_UP is 0xE2 -- and were pushed into the input buffer exactly
like that. No terminal works that way, and 0xE2 is the worst possible byte to
have chosen: it is a UTF-8 lead byte for a three-byte character, so a reader
decoding UTF-8 swallowed the next two keys waiting for continuations that never
arrived. consoleintr() sends the DEC/xterm sequences now -- ESC[A, ESC[D,
ESC[5~ and the rest -- which every terminfo entry and every line editor already
knows. Not echoed: in canonical mode echoing them would move the cursor for
real, which was the other half of what "weird glitches" looked like.

**Then the end of the line vanished as you typed into it**, with the buffer
perfectly correct. One line in vt_putc(): backspace erased the cell it moved
onto. That is a line-discipline erase, not the BS control character -- a
program rubbing a character out sends `\b \b`, and the separation matters
because programs also use plain `\b` to go back. zsh does, on every mid-line
edit:

    echo alpha  \b\b  zha  \b\b

back two, rewrite the tail, back two again to park the cursor. Against a
destructive backspace that last pair deleted the `ha` it had just drawn.

`\b` moves and nothing else now, 0x7f is ignored as on a real terminal, and
consputc() spells its own erase out as `\b \b` as it already did for serial.
ESC[@, ESC[P and ESC[X went in alongside, because TERM=linux declares them.

**VT3 to VT6 were blank** because nothing ran on them. NVT is 6 and the kernel
made all six; only two had a shell, so Alt+F3 switched to a terminal that was
working perfectly and had nobody to talk to. Four more manifests.

Six shells starting at once is enough concurrency to expose an intermittent
fault in one of them -- one boot in five, a wild jump into .data that runs
until it writes to 0, which nothing catches because SchOS never sets EFER.NXE.
Three boots with two shells, none. Recorded rather than fixed: it is not caused
by the manifests, only made likelier by them.

Also: QEMU_NET forwards host 8080/8081/8000 to guest 80/8080/8000, so the httpd
is reachable from the machine running QEMU instead of being sealed behind NAT.
Verified end to end. And the greeting prints once again -- a replaced
supervisor was announcing a boot that had already happened.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VQ7Qx8E1q1M1bbCq8QLHS2
2026-09-14 22:43:54 +02:00
..
console.c tty: arrow keys, backspace, and four terminals nobody was home on 2026-09-14 22:43:54 +02:00
dma.c dma: best fit, and say which number is the problem 2026-09-14 21:28:07 +02:00
kalloc.c debugger: who owns this page, and who just wrote to it 2026-09-14 01:17:57 +02:00
klog.c boot: one line when it works, all of it when it does not 2026-09-14 21:19:50 +02:00
ksym.c debugger: D5, the network transport -- and the plan closes 2026-09-14 15:33:53 +02:00
main.c errno: -1 is EPERM, and four places were saying it by accident 2026-09-14 22:12:28 +02:00
panic.c debugger: reachable from the console, and named on the crash screen 2026-09-14 01:29:30 +02:00
qr.c Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
sbuf.c debugger: the kernel can be asked a question 2026-09-14 00:58:45 +02:00
sleeplock.c kernel: holdingsleep asks who holds the lock, not whether anyone does 2026-09-12 17:13:59 +02:00
spinlock.c Fix two bugs the Fedora move exposed 2026-08-09 19:29:21 +02:00
string.c net: the socket layer stops saying yes to things it did not do, and ping works 2026-09-12 17:14:35 +02:00
time.c boot: one line when it works, all of it when it does not 2026-09-14 21:19:50 +02:00
uaccess.c Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00