Skip to content

Conversation

@ryanbreen
Copy link
Owner

Summary

Three critical fixes for ARM64 userspace functionality, each with rigorous tests validated at A/A rating.

Changes

1. IPC Pipe Wake Mechanism

  • File: kernel/src/ipc/pipe.rs
  • Fix: Removed #[cfg(target_arch = "x86_64")] gating around scheduler wake calls
  • Impact: ARM64 now properly wakes blocked readers when data is written to pipes
  • Test: Uses UNBLOCK_CALL_COUNT atomic instrumentation to verify scheduler.unblock() is called

2. TTY Foreground Process Group

  • File: kernel/src/process/creation.rs
  • Fix: ARM64 create_user_process() now sets foreground pgrp for console TTY
  • Impact: Enables Ctrl+C (SIGINT) delivery to foreground process
  • Test: Uses sentinel value 0xDEAD_BEEF detection with real process creation

3. Signal Delivery in Context Switch

  • File: kernel/src/arch_impl/aarch64/context_switch.rs
  • Fix: Added check_and_deliver_signals_for_current_thread_arm64() (~174 lines)
  • Impact: Signals delivered before ERET to EL0 (userspace)
  • Test: Verifies all 35 register/field conversions in create_saved_regs_from_frame()

Validation

All tests received APPROVE with:

  • Technical Accuracy: A
  • Intellectual Honesty: A
  • All tests would FAIL if fixes were reverted

Test Plan

Tests are in kernel/src/test_framework/registry.rs and run automatically during ARM64 boot.


🤖 Generated with Claude Code

Three critical fixes for ARM64 userspace functionality:

1. IPC Pipe Wake Mechanism (kernel/src/ipc/pipe.rs)
   - Removed #[cfg(target_arch = "x86_64")] gating around scheduler wake calls
   - ARM64 now properly wakes blocked readers when data is written
   - Added UNBLOCK_CALL_COUNT instrumentation to scheduler for testing

2. TTY Foreground Process Group (kernel/src/process/creation.rs)
   - ARM64 create_user_process() now sets foreground pgrp for console TTY
   - Enables Ctrl+C (SIGINT) delivery to foreground process
   - Test uses sentinel value detection to verify integration

3. Signal Delivery in Context Switch (kernel/src/arch_impl/aarch64/context_switch.rs)
   - Added check_and_deliver_signals_for_current_thread_arm64()
   - Proper SP_EL0 handling, TTBR0_EL1 switching with memory barriers
   - Made create_saved_regs_from_frame() public for testing
   - Test verifies all 35 register/field conversions

All tests validated with APPROVE rating:
- Technical Accuracy: A
- Intellectual Honesty: A
- Tests would fail if fixes reverted

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ryanbreen ryanbreen merged commit df9c6f1 into main Jan 28, 2026
2 checks 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