Microkernel thing OS experiment (Zig ⚡)
1.section .text
2
3.globl syscall_entry
4.type syscall_entry, %function
5syscall_entry:
6
7 # swapgs in the future
8 push %rcx
9 push %r11
10 push %r15
11 push %r9
12 push %r8
13 push %r10
14 push %rdx
15 push %r14
16 push %r13
17 push %r12
18 push %rbp
19 push %rbx
20 push %rax
21 push %rsi
22 push %rdi
23
24 call syscall_handler
25
26 pop %rdi
27 pop %rsi
28 pop %rax
29 pop %rbx
30 pop %rbp
31 pop %r12
32 pop %r13
33 pop %r14
34 pop %rdx
35 pop %r10
36 pop %r8
37 pop %r9
38 pop %r15
39 pop %r11
40 pop %rcx
41
42 sysretq