fix(net): add packet polling to networking syscalls for first-call readiness#99
Merged
fix(net): add packet polling to networking syscalls for first-call readiness#99
Conversation
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>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
🤖 Generated with Claude Code