add process and task managers
Intrepid/Prometeu/Runtime/pipeline/head This commit looks good
Intrepid/Prometeu/Runtime/pipeline/pr-master This commit looks good

This commit is contained in:
2026-05-14 17:39:55 +01:00
parent 6694bd2dd1
commit be684ab0f9
32 changed files with 816 additions and 93 deletions
@@ -0,0 +1,3 @@
mod system_os;
pub use system_os::SystemOS;
@@ -0,0 +1,48 @@
use crate::VirtualMachineRuntime;
use crate::process::ProcessManager;
use crate::task::TaskId;
use crate::task::TaskManager;
use prometeu_hal::telemetry::CertificationConfig;
pub struct SystemOS {
pub vm_runtime: VirtualMachineRuntime,
pub process_manager: ProcessManager,
pub task_manager: TaskManager,
}
impl SystemOS {
pub fn new(cap_config: Option<CertificationConfig>) -> Self {
Self {
vm_runtime: VirtualMachineRuntime::new(cap_config),
process_manager: ProcessManager::new(),
task_manager: TaskManager::new(),
}
}
pub fn create_vm_game_task(&mut self, app_id: u32, title: impl Into<String>) -> TaskId {
let title = title.into();
let process_id = self.process_manager.spawn_vm_game(app_id, title.clone());
let task_id = self.task_manager.create_game_task(process_id, app_id, title);
self.task_manager.set_foreground(task_id);
task_id
}
pub fn create_vm_shell_task(&mut self, app_id: u32, title: impl Into<String>) -> TaskId {
let title = title.into();
let process_id = self.process_manager.spawn_vm_shell(app_id, title.clone());
let task_id = self.task_manager.create_shell_task(process_id, app_id, title);
self.task_manager.set_foreground(task_id);
task_id
}
pub fn create_native_shell_task(&mut self, app_id: u32, title: impl Into<String>) -> TaskId {
let title = title.into();
let process_id = self.process_manager.spawn_native_shell(app_id, title.clone());
let task_id = self.task_manager.create_shell_task(process_id, app_id, title);
self.task_manager.set_foreground(task_id);
task_id
}
}