Add special event pipes, rework ps2kb process

This commit is contained in:
2025-09-08 22:12:50 +02:00
parent 94dd38d010
commit ab224eda8e
9 changed files with 101 additions and 13 deletions

View File

@ -15,6 +15,7 @@
#include "drivers/ps2kb/ps2kb.h"
#include "ipc/pipe/pipe.h"
#include "proc/ps2kbproc/ps2kbproc.h"
#include "rbuf/rbuf.h"
void hal_intr_disable(void) {
asm volatile("cli");
@ -200,9 +201,13 @@ void intr_handleintr(IntrStackFrame *frame) {
break;
case INTR_IRQBASE+1:
int32_t c = ps2kb_intr();
uint8_t *bytes = (uint8_t *)&c;
ipc_pipewrite(PS2KBPROC->pipes[0], bytes, sizeof(c));
intr_eoi(frame->trapnum - INTR_IRQBASE);
uint8_t *bytes = (uint8_t *)&c;
spinlock_acquire(&PS2KB_BUF.spinlock);
for (size_t i = 0; i < sizeof(c); i++) {
rbuf_push(&PS2KB_BUF.rbuf, bytes[i]);
}
spinlock_release(&PS2KB_BUF.spinlock);
break;
}
} else if (frame->trapnum == 0x80) {