Skip to content

Conversation

@ryanbreen
Copy link
Owner

Summary

  • Adds complete PTY (pseudo-terminal) subsystem for terminal emulation
  • Implements POSIX-compliant syscalls: posix_openpt, grantpt, unlockpt, ptsname
  • Creates devptsfs virtual filesystem for /dev/pts/* device nodes
  • Integrates sys_open to route /dev/pts/* paths correctly
  • Provides libbreenix userspace API for PTY operations
  • Includes integration test with byte-level data verification
  • Adds telnet server skeleton for future remote shell access

Key Components

Component Location Description
PTY Core kernel/src/tty/pty/ Master/slave pair management, circular buffers
Syscalls kernel/src/syscall/pty.rs posix_openpt, grantpt, unlockpt, ptsname
devptsfs kernel/src/fs/devptsfs/ Virtual filesystem for /dev/pts/*
sys_open integration kernel/src/syscall/fs.rs Routes /dev/pts/* to devptsfs
Userspace API libs/libbreenix/src/pty.rs Safe wrappers for PTY syscalls
Integration test userspace/tests/pty_test.rs Full PTY flow with data verification

Test plan

  • Build succeeds with 0 warnings
  • All 226/226 boot stages pass
  • PTY integration test verifies:
    • posix_openpt with O_RDWR | O_NOCTTY
    • grantpt/unlockpt sequence
    • ptsname returns valid path
    • open("/dev/pts/N") succeeds
    • Master→slave data flow with byte verification
    • Slave→master data flow with byte verification
    • Error path: grantpt rejects invalid fd

🤖 Generated with Claude Code

ryanbreen and others added 3 commits January 16, 2026 05:03
Add complete PTY (pseudo-terminal) subsystem enabling terminal emulation
for remote access (telnet) and terminal multiplexing. Implementation follows
POSIX specifications with proper error handling and bidirectional data flow.

Key components:
- PTY core infrastructure with master/slave pair management
- Syscalls: posix_openpt, grantpt, unlockpt, ptsname
- devptsfs virtual filesystem for /dev/pts/* device nodes
- sys_open integration to route /dev/pts/* paths to devptsfs
- libbreenix userspace wrappers for PTY operations
- Integration test with data verification
- Telnet server skeleton for remote shell access

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add SLIRP port forwarding: localhost:2323 -> guest:2323
- Add telnetd and pty_test to shell's program registry
- Enables running telnetd from the shell

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove MAX_ATTEMPTS limit in accept loop (was causing timeout)
- Remove MAX_CYCLES limit in relay loop (was limiting session time)
- Accept connections forever in daemon mode
- Continue listening after connection closes

Also add docs/planning/INIT_SYSTEM_PLAN.md documenting the next
major milestone: proper init system with virtual consoles.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ryanbreen ryanbreen merged commit 8f3d130 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