sched: improve thread handling on system calls

This commit is contained in:
Michael Shaw 2025-02-11 18:58:00 -05:00
commit 72827c1e00
9 changed files with 157 additions and 180 deletions

View file

@ -79,8 +79,12 @@ ssize_t serial_read(char *buf)
struct proc *proc = proc_find(getpid());
while((ret = ringbuf_read(tty0->data, &c, 1)) == 0) {
kthread_yield();
serial_trap();
while ((ret = ringbuf_read(tty0->data, &c, 1)) == 0) {
_save_context();
sti();
yield();
}
copy_to_user(proc, buf, &c, 1);