Implement fast syscall/sysret for sytem calls

This commit is contained in:
Justin C. Miller
2019-03-13 23:51:29 -07:00
parent 97e8f2c69a
commit f7558e3d18
9 changed files with 77 additions and 21 deletions

View File

@@ -8,17 +8,17 @@ _start:
xor rbp, rbp ; Sentinel rbp
mov rax, 5 ; GETPID syscall
int 0xee
syscall ; int 0xee
mov [mypid], rax
mov rax, 8 ; FORK syscall
int 0xee
syscall ; int 0xee
mov [mychild], rax
mov r12, [mypid]
mov r13, [mychild]
mov rax, 1 ; DEBUG syscall
int 0xee
syscall ; int 0xee
cmp r12, 1
je .dosend
@@ -32,7 +32,7 @@ _start:
mov rax, 1 ; MESSAGE syscall
;mov rax, 0 ; NOOP syscall
;syscall
int 0xee
syscall ; int 0xee
inc r11
cmp r11, 2
@@ -41,7 +41,7 @@ _start:
mov rax, 4 ; SLEEP syscall
; syscall
int 0xee
syscall ; int 0xee
add rbx, 20
@@ -51,11 +51,11 @@ _start:
.dosend:
mov rax, 6 ; SEND syscall
mov rdi, 2 ; target is pid 2
int 0xee
syscall ; int 0xee
jmp .preloop
.doreceive:
mov rax, 7 ; RECEIVE syscall
mov rdi, 1 ; source is pid 2
int 0xee
syscall ; int 0xee
jmp .preloop