BUPT-OS / RROS

RROS is a dual-kernel OS for satellites or other scenarios that need both real-time and general-purpose abilities. RROS = RTOS (Rust) + Linux (C).
https://bupt-os.github.io/website/
Other
570 stars 40 forks source link

Add SMP Support to the RROS Kernel. #41

Closed JiajunDu closed 3 months ago

JiajunDu commented 4 months ago

As described in #40 , it is essential to provide the RROS kernel with support for SMP. This PR is intended to address that issue.

In this PR, the changes are mainly related to the following aspects:

  1. Providing support for SMP by adding new functionality to the subsystems involved, such as the scheduling subsystem, the clock subsystem, the interrupt subsystem, and so on.
  2. Fix lock usage to support multi-CPU. When there is only one CPU used, turning off interrupts can be used instead of using locks. Therefore, in order to support SMP, the areas involved need to be modified to the correct use of locks.
  3. Some wrappers in RFL are not perfect, so they need to be further improved.
  4. Add test code for SMP.

Eventually, after testing, RROS has been able to support parallel execution of multiple tasks on multiple CPUs.

A summary of this PR can be found on my blog. There is also a useful discussion about SMP here.