From 89a0b8efb6491b93a8a373ad36c0a3872cd2ed44 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 9 Nov 2024 20:45:52 +0100 Subject: IMP: PosixKit, to communicate with pureDarwin correctly. IMP: Breakpoint interrupt has been implemented. IMP: Interrupts handlers have been improved for AMD64 HAL. --- dev/ZKAKit/HALKit/AMD64/HalInterruptAPI.asm | 31 +++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'dev/ZKAKit/HALKit/AMD64/HalInterruptAPI.asm') diff --git a/dev/ZKAKit/HALKit/AMD64/HalInterruptAPI.asm b/dev/ZKAKit/HALKit/AMD64/HalInterruptAPI.asm index 9121edb9..293dafde 100644 --- a/dev/ZKAKit/HALKit/AMD64/HalInterruptAPI.asm +++ b/dev/ZKAKit/HALKit/AMD64/HalInterruptAPI.asm @@ -50,15 +50,42 @@ extern idt_handle_pf extern ke_io_write extern idt_handle_ud extern idt_handle_generic +extern idt_handle_breakpoint section .text IntNormal 0 IntNormal 1 - IntNormal 2 -IntNormal 3 +section .data + +__ZKA_INT_3_GET_RIP: + dq 0 +__ZKA_INT_3_GET_RIP_END: + +section .text + +;; @brief Triggers a breakpoint and freeze the process. RIP is also fetched. +__ZKA_INT_3: + cli + + mov al, 0x20 + out 0x20, al + out 0xA0, al + + push rax + mov rax, idt_handle_breakpoint + + lea rcx, [rel __ZKA_INT_3_GET_RIP] + mov [rcx], rcx + + call rax + pop rax + + sti + o64 iret + IntNormal 4 IntNormal 5 -- cgit v1.2.3