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

View File

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