TODO figure out why schedrelease() messes with terminal proc's ring buffer

This commit is contained in:
2025-09-20 01:19:20 +02:00
parent 8269e097d6
commit a1b3d4efa4
2 changed files with 5 additions and 9 deletions

View File

@ -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);
}
}
}

View File

@ -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;
}