Skip to content

Conversation

@ryanbreen
Copy link
Owner

Summary

  • Update init_shell's program registry to use /sbin/telnetd (ext2 path) instead of bare telnetd which fell back to stale test disk binary
  • Regenerate ext2.img with latest telnetd (no debug output)

This is a followup to PR #99 which added TCP packet polling. The telnetd binary in the test disk still had debug output because the registry was using the wrong path.

Test plan

  • All 226 boot stages pass
  • Telnetd starts without debug output spam
  • Telnetd works with & (backgrounding)

🤖 Generated with Claude Code

ryanbreen and others added 6 commits January 16, 2026 05:18
The telnetd server was trying to exec /bin/init_shell but it wasn't
in the ext2 filesystem, causing the shell to fail to start over telnet.

Now ext2 contains:
- /bin/init_shell (32KB) - interactive shell
- /bin/telnetd (9KB) - telnet server

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…adiness

TCP listeners were not detecting pending connections on the first
poll/select/accept call because incoming SYN packets remained
unprocessed in the e1000 driver buffer. The fix ensures process_rx()
and drain_loopback_queue() are called at syscall entry.

Changes:
- Add process_rx() + drain_loopback_queue() to sys_poll, sys_select,
  sys_accept, sys_recvfrom, and sys_read for TcpConnection
- Add first-call accept test (Test 25) without retry loop
- Add TCP listener poll test (Phase 8) verifying POLLIN on first call
- Add TCP listener select test (Phase 8) verifying readiness on first call
- Fix PTY master reference counting for fork/exec scenarios
- Add telnetd to ext2 filesystem and update run.sh for interactive mode

All 226 boot stages pass. Tests verify first-call success without
retry loops, ensuring the fix actually works rather than masking
timing issues.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
TCP connections now use reference counting similar to PTY:
- Add refcount field to TcpConnection (AtomicUsize)
- tcp_add_ref() increments count during fork
- tcp_close() only sends FIN when last reference drops
- FdTable::clone() calls tcp_add_ref() for TCP fds

This fixes telnetd where the child closes inherited socket fds,
which was prematurely closing the parent's connection.

Also removes debug output:
- TSS RSP0 updated messages from gdt.rs
- tcp_add_ref/tcp_close debug logs from tcp.rs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update init_shell's program registry to use /sbin/telnetd (ext2 path)
instead of bare "telnetd" which fell back to stale test disk binary
containing debug output.

Also regenerated ext2.img with latest telnetd (no debug output).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ryanbreen ryanbreen merged commit 66d5d03 into main Jan 16, 2026
1 check passed
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