From 93f174827bca3e164ce9ef75ed627460278fa687 Mon Sep 17 00:00:00 2001 From: Ruslan Isaev Date: Thu, 19 Jun 2025 17:58:49 +0300 Subject: [PATCH] tasking: start handling syscalls --- grubshit/aaa | Bin 8656 -> 8656 bytes grubshit/aaa.asm | 2 +- grubshit/aaa.o | Bin 624 -> 624 bytes include/task.h | 3 +- src/tasking/sys_exit.asm | 25 +++---------- src/tasking/task.c | 76 ++++++--------------------------------- 6 files changed, 18 insertions(+), 88 deletions(-) diff --git a/grubshit/aaa b/grubshit/aaa index ab2434ae1683dc2b2d96c27d6c28a8be9a00622a..7bcfafb2abe57221d5177835431d0065ba8e1a43 100755 GIT binary patch delta 15 XcmccMe8G7GufoKI!kZNoHZTGJHSh)P delta 14 VcmccMe8G7GuL2|2Wpagedir, - code_phys, - (void*)0x400000, - PAGE_PRESENT | PAGE_RW | PAGE_USER) != 0) { // PAGE_USER is critical, PAGE_RW for now, can be R-X - - printf("jump_usermode2: Failed to map user code into task's PD for PID %d\n", p_task1->pid); - // TODO: Terminate/cleanup p_task1, free code_phys_task1 - return; - } - - if (map_page_in_directory(p_task2->pagedir, - second_code_phys, - (void*)0x400000, - PAGE_PRESENT | PAGE_RW | PAGE_USER) != 0) { // PAGE_USER is critical, PAGE_RW for now, can be R-X - - printf("jump_usermode2: Failed to map user code into task's PD for PID %d\n", p_task2->pid); - // TODO: Terminate/cleanup p_task1, free code_phys_task1 - return; - }*/ - scheduler_unlock(); -} +void handle_syscall(TrapFrame *tf) +{ + printf("========SYSCALL========\n"); + printf("EAX: %X\n", tf->eax); + printf("EBX: %X\n", tf->ebx); + printf("ECX: %s\n", tf->ecx); + printf("EDX: %X\n", tf->edx); + printf("======== END SYSCALL========\n"); + printf("SIZEOF TRAPFRAME: %X\n", sizeof(tf)); + printf("SIZEOF *TRAPFRAME: %X\n", sizeof(*tf)); +} \ No newline at end of file