Skip to content

Conversation

@ryanbreen
Copy link
Owner

Summary

  • Achieved ZERO compiler warnings through aggressive dead code removal
  • Implemented comprehensive testing requirements
  • Updated PROJECT_ROADMAP.md with current state
  • Demonstrated 3 concurrent processes running successfully

Major Changes

1. Code Cleanup (70+ warnings removed)

  • Removed 20+ unused functions: init_user_process, duplicate current_pid, test_userspace_syscalls, etc.
  • Removed unused struct fields: threads, children, heap_size, next_process_base
  • Removed unused enum variants: ProcessState::Blocked, ThreadState::Blocked
  • Removed entire modules: syscall/dispatcher.rs, framebuffer Display struct
  • Fixed all imports: Removed unused imports throughout codebase
  • Result: cargo build --release completes with ZERO warnings

2. Testing Improvements

  • Added POST test framework with 8 core system tests
  • Created concurrent_process_tests.rs for validating multi-process execution
  • Updated CLAUDE.md with strict quality requirements:
    • NO compiler warnings tolerance
    • ALL tests must pass
    • Clean builds required

3. Concurrent Process Success

Successfully demonstrated 3 concurrent processes:

Process 1: Hello from userspace\! Current time: 11 ticks
Process 2: Hello from userspace\! Current time: 13 ticks
Process 3: Hello from userspace\! Current time: 16 ticks

4. Key Fixes

  • Re-enabled timer tick counting in interrupt handler
  • Fixed page table isolation by skipping PML4 entry 0 copy
  • Removed test functions that weren't part of test framework

5. Roadmap Update

  • Consolidated multiple "Currently Working On" sections
  • Updated with today's achievements
  • Next focus: Implement thread spawning

Philosophy

Per our discussion, I was aggressive about removing dead code rather than just marking it. The only things kept were:

  • Spawn-related functionality (planned for next implementation)
  • Assembly entry points (syscall_entry, timer_interrupt_entry)
  • Functions actively used by the system

This establishes a clean, warning-free codebase as the foundation for future development.

🤖 Generated with Claude Code

MAJOR CLEANUP:
- Removed 70+ compiler warnings through aggressive dead code elimination
- Deleted 20+ unused functions, methods, and struct fields
- Removed entire unused modules (syscall/dispatcher.rs, framebuffer Display)
- Fixed all unused imports and syntax errors
- Result: cargo build --release completes with ZERO warnings

TESTING IMPROVEMENTS:
- Added POST test framework with 8 core system tests
- Created concurrent_process_tests.rs for multi-process validation
- Updated CLAUDE.md with strict requirements:
  - NO compiler warnings allowed
  - ALL tests must pass before work is complete
  - Clean builds required

DEMONSTRATED SUCCESS:
- Successfully ran 3 concurrent hello_time processes
- Each process printed different timer values (11, 13, 16 ticks)
- Fixed by skipping PML4 entry 0 copy to give clean userspace
- Timer tick counting re-enabled in interrupt handler

ROADMAP UPDATE:
- Consolidated multiple 'Currently Working On' sections
- Updated with today's achievements
- Next focus: Implement thread spawning (spawn and spawn_userspace)

This establishes a clean, warning-free codebase as the foundation
for future development.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@ryanbreen ryanbreen closed this Jul 10, 2025
ryanbreen added a commit that referenced this pull request Jan 18, 2026
- Reduce scheduler debug logging from every call >= #30 to first 5 + every 500th
- Remove verbose terminated/blocked/forced-switch logging that caused timing issues
- Add NEED_RESCHED when deferring non-idle thread to idle (critical for kthreads)
- Remove logging from preempt_schedule_irq() hot path

These changes fix timing issues that prevented kthreads from seeing stop signals
reliably. Serial output at ~960 bytes/sec was taking 50-100ms per log line,
causing kthreads to be preempted before they could check should_stop flags.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ryanbreen added a commit that referenced this pull request Feb 10, 2026
…er starvation

With interrupts enabled, each create_user_process() call adds a thread
to the scheduler's ready queue. Timer interrupts (200Hz) then preempt
the loading thread to run newly created test processes. By binary #30,
the loading thread competes with 30+ threads for CPU time and loading
exceeds the 90s stage timeout.

With interrupts disabled, VirtIO block I/O still works (polling mode)
and all 65 binaries load in under a second.

Also adds intermediate boot stages for test binary loading progress.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant