From 9af5588c30c4126a2800aae1afcb0de2c373dc6c Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Mon, 20 May 2024 17:40:47 -0400 Subject: rewrite application stuff in the kernel to support multitasking --- kernel/source/application.asm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'kernel/source/application.asm') diff --git a/kernel/source/application.asm b/kernel/source/application.asm index ed8b190..632822f 100644 --- a/kernel/source/application.asm +++ b/kernel/source/application.asm @@ -137,9 +137,12 @@ resume_thread: extern copy_syscall_stack ;rdi = bottom +;returns: pointer to copy -global save_thread_state -save_thread_state: +extern resume_next_thread + +global yield +yield: ;rdi = pointer to cpu state structure ;only saving registers that need to be preserved by this function @@ -163,9 +166,7 @@ save_thread_state: mov qword [rdi + 152], rax ;kernel_stack_copy mov byte [rdi + 160], 0x01 ;in_syscall - xor al, al - ret + jmp resume_next_thread .resume_to: - mov al, 0x01 ret -- cgit v1.2.3