Commit 66d5d03
fix(telnetd): use ext2 path for clean binary (#101)
* fix(ext2): add init_shell and telnetd to filesystem
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>
* fix(net): add packet polling to networking syscalls for first-call readiness
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>
* fix(tcp): add refcount for fork/close pattern + remove debug output
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>
* fix(telnetd): use ext2 path to load clean binary
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>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 3ccc28e commit 66d5d03
2 files changed
+1
-1
lines changedBinary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
579 | 579 | | |
580 | 580 | | |
581 | 581 | | |
582 | | - | |
| 582 | + | |
583 | 583 | | |
584 | 584 | | |
585 | 585 | | |
| |||
0 commit comments