From d126ebf73370fbc64913aa6ff19db56a39f625b2 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 15 May 2025 18:42:59 +0200 Subject: feat(kernel): pushing the fixes regarding the scheduler, and working on making the LAPIC work correctly. Signed-off-by: Amlal El Mahrouss --- dev/kernel/HALKit/AMD64/HalCommonAPI.asm | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'dev/kernel/HALKit/AMD64/HalCommonAPI.asm') diff --git a/dev/kernel/HALKit/AMD64/HalCommonAPI.asm b/dev/kernel/HALKit/AMD64/HalCommonAPI.asm index c1dfc66a..432f79d3 100644 --- a/dev/kernel/HALKit/AMD64/HalCommonAPI.asm +++ b/dev/kernel/HALKit/AMD64/HalCommonAPI.asm @@ -79,4 +79,32 @@ mp_system_call_handler: o64 sysret -[bits 16] + +section .text + +global sched_jump_to_task + +;; Jump to the task from its stack frame. +sched_jump_to_task: + push rbp + mov rbp, rsp + + mov r8, [rcx + 0x10] + mov r9, [rcx + 0x18] + mov r10, [rcx + 0x20] + mov r11, [rcx + 0x28] + mov r12, [rcx + 0x30] + mov r13, [rcx + 0x38] + mov r14, [rcx + 0x40] + mov r15, [rcx + 0x48] + + mov rax, [rcx + 0x00] + mov rsp, [rcx + 0x08] ; SP + + jmp rax + +global rtl_ne_task + +rtl_ne_task: + jmp $ + ret \ No newline at end of file -- cgit v1.2.3