Fix PIC, add small delays when initializing

This commit is contained in:
2025-11-18 23:27:49 +01:00
parent 638214a0e2
commit 28c95303e9
8 changed files with 51 additions and 24 deletions

View File

@ -31,13 +31,7 @@ void intr_pit_wait(uint32_t ms) {
while (PIT_TICKS - now < ms);
}
void intr_pit_intr(IntrStackFrame *frame) {
PIT_TICKS++;
}
void intr_pit_init(void) {
intr_attchhandler(&intr_pit_intr, INTR_IRQBASE+0);
uint32_t hz = 1000;
uint32_t div = PIT_FREQ / hz;
io_out8(PIT_CMD, PIT_CMD_BINARY | PIT_CMD_MODE3 | PIT_CMD_RW_BOTH | PIT_CMD_COUNTER0);