From 192208770d3866838a450462dd4b1fc8e2b5c91a Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Sun, 24 Nov 2024 22:07:51 +0100 Subject: Simplify scheduling by introducing an init process MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Scheduling is easier if there is an init process which does nothing. This way we don't have to perform hacks in order to idle in S privilege mode while touching special registers in weird ways. For now this process is kind of costly since 'wfi' is not accepted in this context, but this can be further tuned down in the future by setting TW=1 on 'mstatus', or by handling the exception and allowing it if it comes from the proper process. All of that being said, there is still work to be done as things fail when optimitzations are on. Signed-off-by: Miquel Sabaté Solà --- usr/src/init.S | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 usr/src/init.S (limited to 'usr/src') diff --git a/usr/src/init.S b/usr/src/init.S new file mode 100644 index 0000000..6566f20 --- /dev/null +++ b/usr/src/init.S @@ -0,0 +1,8 @@ +.global _start +.text + +_start: +.Loop: + // TODO + // wfi + j .Loop -- cgit v1.2.3