tasking: start handling syscalls

This commit is contained in:
2025-06-19 17:58:49 +03:00
parent 5fa2393fd6
commit 93f174827b
6 changed files with 18 additions and 88 deletions
+4 -21
View File
@@ -1,6 +1,7 @@
; TODO: maybe put it near idt.c?
global sys_exit_handler
extern printf
extern handle_syscall
sys_exit_handler:
; Сохраняем регистры Ring 3
pusha
@@ -16,27 +17,9 @@ sys_exit_handler:
mov fs, ax
mov gs, ax
mov eax, [esp+44] ; System call number
mov ebx, [esp+32] ; Arg1
mov ecx, [esp+40] ; Arg2
mov edx, [esp+36] ; Arg3
mov esi, [esp+28] ; Arg4
mov edi, [esp+24] ; Arg5
; Print debug information
push edi ; arg5
push esi ; arg4
push edx ; arg3
push ecx ; arg2
push ebx ; arg1
push eax ; syscall number
push syscall_debug_fmt
; Выполняем действие
;push sys_exit_msg
call printf
;add esp, 4
add esp, 28
push esp
call handle_syscall
add esp, 0x44
; Восстанавливаем сегменты Ring 3
pop gs