Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • O OSKernel2026-StellarOS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • StellarOS
  • OSKernel2026-StellarOS
  • Merge requests
  • !17

Support dynamic Boot Hart and improve multi-core console output

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged StellarOS requested to merge fix/ltp into main Mar 31, 2026
  • Overview 2
  • Commits 4
  • Pipelines 0
  • Changes 14

Created by: Alic3r3L1cwhk

This pull request introduces two major improvements: dynamic boot hart support for SMP systems and a fix for console output corruption in multi-core scenarios. The changes enable the kernel to correctly identify and initialize the boot hart regardless of its ID, supporting both SMP=2 and SMP=4 configurations, and add a lock to ensure SMP-safe console output. Additionally, more detailed debug logging is added to process/task management for easier tracing of process lifecycle events.

Dynamic boot hart support:

  • Refactored the kernel entry and initialization flow to support any boot hart ID, not just hart 0. This includes splitting the entry into separate rust_main_boot and rust_main_secondary functions, adding a _start_secondary entry in entry.asm, and passing the boot hart ID through initialization routines. (os/src/main.rs, os/src/cpu/mod.rs, os/src/entry.asm) [1] [2] [3] [4]
  • Added a BOOT_HART_ID static variable and updated the hart startup logic to skip the boot hart and correctly start secondary harts using the new entry point. (os/src/cpu/mod.rs, os/src/entry.asm) [1] [2] [3]
  • Updated documentation and planning notes to describe the new dual-entry design and summarize test results for both SMP=2 and SMP=4. (plans/phase-f-dynamic-boot-hart.md)

Console output SMP safety:

  • Added a spin::Mutex lock to the print() function in console.rs to prevent interleaved output and corruption when multiple harts print concurrently. (os/src/console.rs) [1] [2]

Debug logging improvements:

  • Added detailed debug logs in process/task management to trace waitpid, exit, and wait queue events, aiding in debugging process lifecycle and synchronization issues. (os/src/syscall/process.rs, os/src/task/mod.rs) [1] [2] [3] [4] [5]

These changes together ensure robust multi-core boot and operation, and improve observability and correctness in SMP environments.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix/ltp