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) {
|
||||
char buf[100];
|
||||
for (;;) {
|
||||
hal_memset(buf, 0, sizeof(buf));
|
||||
spinlock_acquire(&TERMPROC->pipes_spinlock);
|
||||
IpcPipe *inpipe = TERMPROC->pipes[1];
|
||||
spinlock_release(&TERMPROC->pipes_spinlock);
|
||||
int32_t read = ipc_piperead(inpipe, (uint8_t *)buf, sizeof(buf));
|
||||
if (read > 0) {
|
||||
kprintf("%.*s", read, buf);
|
||||
char c = 0;
|
||||
int32_t read = ipc_piperead(TERMPROC->pipes[1], (uint8_t *)&c, 1);
|
||||
if (read > 0 && c != 0) {
|
||||
kprintf("%c", c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ int32_t SYSCALL0(sys_schedrelease) {
|
||||
Proc *proc = PROCS.current;
|
||||
spinlock_release(&PROCS.spinlock);
|
||||
|
||||
proc_sched((void *)frame);
|
||||
/* proc_sched((void *)frame); */
|
||||
|
||||
return E_OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user