Pause syscall and int 0xee interrupt syscalls

The syscall/sysret instructions don't swap stacks. This was bad but
passable until syscalls caused the scheduler to run, and scheduling a
task that paused due to interrupt.

Adding a new (hopefully temporary) syscall interrupt `int 0xee` to allow
me to test syscalls without stack issues before I tackle the
syscall/sysret issue.

Also implemented a basic `pause` syscall that causes the calling process
to become unready. Because nothing can wake a process yet, it never
returns.
This commit is contained in:
Justin C. Miller
2018-09-12 20:59:08 -07:00
parent c2f85ce61b
commit 62c559043d
13 changed files with 233 additions and 136 deletions

View File

@@ -1,11 +1,22 @@
global _start
_start:
xor rbp, rbp ; Sentinel rbp
mov r11, 0 ; counter
.loop:
;mov rax, 1 ; DEBUG syscall
mov rax, 0 ; NOOP syscall
syscall
mov rax, 1 ; DEBUG syscall
;mov rax, 0 ; NOOP syscall
;syscall
int 0xee
inc r11
cmp r11, 5
jle .loop
mov rax, 3 ; PAUSE syscall
; syscall
int 0xee
mov r11, 0
jmp .loop