From de502973c77a81833b286391a70cea4f1da469d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Autin?= Date: Wed, 8 Mar 2023 15:34:13 +0100 Subject: [PATCH] Added System initializer method --- src/kernel/system.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/kernel/system.rs b/src/kernel/system.rs index b0f54c8..e650097 100644 --- a/src/kernel/system.rs +++ b/src/kernel/system.rs @@ -28,6 +28,17 @@ pub struct System { impl System { + /// System constructor + pub fn new(machine: Machine, scheduler: Scheduler) -> Self { + Self { + g_machine: machine, + g_current_thread: None, + g_thread_to_be_destroyed: None, + g_alive: List::new(), + g_scheduler: scheduler + } + } + // GETTERS /// Returns the Machine