sched: properly implement blocking for read
This is a milestone update, as userspace applications are now able to properly read from TTY devices, be blocked while waiting, and write the output back. Userspace development will move much faster now that these kinks have been worked out. This version will be tagged as vbos v0.01 Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
This commit is contained in:
parent
52ba70f4b7
commit
b753afd4fb
9 changed files with 74 additions and 54 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#define __ASM__
|
||||
#include <dev/serial.h>
|
||||
#include <lib/errno.h>
|
||||
|
||||
.macro save_context
|
||||
pushq %rax
|
||||
|
|
@ -202,25 +203,14 @@ gate_syscall:
|
|||
movq %r10, %rcx
|
||||
save_context
|
||||
save_iretq_frame
|
||||
pushq %rax
|
||||
movq 0(%rax), %rdi
|
||||
movq 40(%rax), %rsi
|
||||
movq 32(%rax), %rdx
|
||||
movq 24(%rax), %rcx
|
||||
movq 16(%rax), %r8
|
||||
movq 56(%rax), %r9
|
||||
sti
|
||||
|
||||
call syscall
|
||||
popq %rdi
|
||||
movq %rax, 0(%rdi)
|
||||
call schedule
|
||||
|
||||
.global syscall_block
|
||||
syscall_block:
|
||||
cli
|
||||
save_context
|
||||
save_iretq_frame
|
||||
call schedule
|
||||
|
||||
/* void return_from_irq(struct procregs *regs, paddr_t cr3); */
|
||||
|
|
|
|||
Loading…
Reference in a new issue