TODO figure out why schedrelease() messes with terminal proc's ring buffer
This commit is contained in:
@ -15,15 +15,11 @@ void termproc_init(Proc *proc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void termproc_fn(void) {
|
void termproc_fn(void) {
|
||||||
char buf[100];
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
hal_memset(buf, 0, sizeof(buf));
|
char c = 0;
|
||||||
spinlock_acquire(&TERMPROC->pipes_spinlock);
|
int32_t read = ipc_piperead(TERMPROC->pipes[1], (uint8_t *)&c, 1);
|
||||||
IpcPipe *inpipe = TERMPROC->pipes[1];
|
if (read > 0 && c != 0) {
|
||||||
spinlock_release(&TERMPROC->pipes_spinlock);
|
kprintf("%c", c);
|
||||||
int32_t read = ipc_piperead(inpipe, (uint8_t *)buf, sizeof(buf));
|
|
||||||
if (read > 0) {
|
|
||||||
kprintf("%.*s", read, buf);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ int32_t SYSCALL0(sys_schedrelease) {
|
|||||||
Proc *proc = PROCS.current;
|
Proc *proc = PROCS.current;
|
||||||
spinlock_release(&PROCS.spinlock);
|
spinlock_release(&PROCS.spinlock);
|
||||||
|
|
||||||
proc_sched((void *)frame);
|
/* proc_sched((void *)frame); */
|
||||||
|
|
||||||
return E_OK;
|
return E_OK;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user