mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
Initial process waiting/waking
Processes can now wait on signals/children/time. There is no clock currently so "time" is just a monotonically increating tick count. Added a SLEEP syscall to test this waiting/waking.
This commit is contained in:
@@ -2,6 +2,7 @@ global _start
|
||||
_start:
|
||||
xor rbp, rbp ; Sentinel rbp
|
||||
mov r11, 0 ; counter
|
||||
mov rbx, 20 ; sleep timeout
|
||||
|
||||
.loop:
|
||||
mov rax, 1 ; DEBUG syscall
|
||||
@@ -10,13 +11,15 @@ _start:
|
||||
int 0xee
|
||||
|
||||
inc r11
|
||||
cmp r11, 3
|
||||
cmp r11, 2
|
||||
|
||||
jle .loop
|
||||
|
||||
mov rax, 3 ; PAUSE syscall
|
||||
mov rax, 4 ; SLEEP syscall
|
||||
; syscall
|
||||
int 0xee
|
||||
|
||||
add rbx, 20
|
||||
|
||||
mov r11, 0
|
||||
jmp .loop
|
||||
|
||||
Reference in New Issue
Block a user