Skip to content

Commit 66d5d03

Browse files
ryanbreenclaude
andauthored
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

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

testdata/ext2.img

0 Bytes
Binary file not shown.

userspace/tests/init_shell.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ static PROGRAM_REGISTRY: &[ProgramEntry] = &[
579579
},
580580
ProgramEntry {
581581
name: "telnetd",
582-
binary_name: b"telnetd\0",
582+
binary_name: b"/sbin/telnetd\0",
583583
description: "Telnet server on port 2323",
584584
},
585585
// === PTY Test ===

0 commit comments

Comments
 (0)