From 1af5efb5c96af6f3246c8eae42912b2fbcd7f006 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 1 Sep 2024 11:21:55 +0200 Subject: Many bug fixes, and wip fixes. RoadMap: - Ring-3 switch [ Still gives GPF ] - Make timer interrupt on non SMP profile. - Work on SMP support, to offload tasks to other cores. - Validate kernel and components (compiler, dlls, programs...) Signed-off-by: Amlal El Mahrouss --- dev/ZKA/HALKit/AMD64/HalInterruptAPI.asm | 52 +------------------------------- 1 file changed, 1 insertion(+), 51 deletions(-) (limited to 'dev/ZKA/HALKit/AMD64/HalInterruptAPI.asm') diff --git a/dev/ZKA/HALKit/AMD64/HalInterruptAPI.asm b/dev/ZKA/HALKit/AMD64/HalInterruptAPI.asm index 89cb4078..2eae172a 100644 --- a/dev/ZKA/HALKit/AMD64/HalInterruptAPI.asm +++ b/dev/ZKA/HALKit/AMD64/HalInterruptAPI.asm @@ -4,7 +4,7 @@ ;; * Copyright ZKA Technologies., all rights reserved. ;; * ;; * File: HalInterruptAPI.asm -;; * Purpose: Interrupt routing, redirect raw interrupts into their handlers. +;; * Purpose: Interrupt API, redirect raw interrupts into their handlers. ;; * ;; * --------------------------------------------------- ;; */ @@ -240,56 +240,6 @@ hal_load_idt: sti ret -[global hal_switch_to_user_code] - -hal_switch_to_user_code: - ; Enable SCE that enables sysret and syscall - mov rcx, 0xc0000082 - wrmsr - mov rcx, 0xc0000080 - rdmsr - or eax, 1 - wrmsr - mov rcx, 0xc0000081 - rdmsr - mov edx, 0x00180008 - wrmsr - - mov rbx, 0x28 - mov ds, rbx - - mov rbx, 0x28 - mov fs, rbx - - mov rbx, 0x28 - mov gs, rbx - - mov rbx, 0x28 - mov es, rbx - - mov rsp, hal_user_code_stack_end - mov rcx, hal_user_code_start - - mov r11, 0x0202 - - o64 sysret - -hal_user_code_start: - hlt - nop - jmp $ -hal_user_code_end: - -section .data - -hal_user_code_sz: dq hal_user_code_end - hal_user_code_start - -section .bss - -hal_user_code_stack: - resb 4096*4 -hal_user_code_stack_end: - section .data kInterruptVectorTable: -- cgit v1.2.3