kernel

hobby kernel
git clone git://git.evenfri.xyz/kernel.git
Log | Files | Refs | README | LICENSE

syscall_entry.asm (326B)


      1 bits 32
      2 
      3 section .text
      4 global syscall_asm
      5 
      6 extern syscall_handler
      7 
      8 syscall_asm:
      9   ; save 32-bits regs
     10   pushad 
     11 
     12   push edi ; arg5
     13   push esi ; arg4
     14   push edx ; arg3
     15   push ecx ; arg2
     16   push ebx ; arg1
     17   push eax ; num
     18 
     19   sti
     20   call syscall_handler
     21   cli
     22 
     23   ; clear stack
     24   add esp, 24
     25   mov [esp + 28], eax
     26 
     27   popad
     28   iret
     29