fixing the keyboard and bootloader so that its 2 stage again

This commit is contained in:
2025-08-02 20:06:15 -07:00
parent e1e30b511a
commit 267130281a
7 changed files with 411 additions and 53 deletions

View File

@@ -4,17 +4,20 @@
#include "terminal.h"
#include "stdio.h"
static uint32_t tick = 0;
static volatile uint32_t tick = 0;
void timer_callback(void) {
tick++;
// Print every 100 ticks for debugging purposes
if (tick % 100 == 0) {
char tick_msg[50];
snprintf(tick_msg, sizeof(tick_msg), "Tick count: %u\n", tick);
terminal_write(tick_msg);
char buf[16];
itoa(tick, buf, 10);
terminal_write("Tick count: ");
terminal_write(buf);
terminal_write("\n");
}
outb(0x20, 0x20); // EOI to PIC
}
void timer_init(uint32_t frequency) {
@@ -29,4 +32,4 @@ void timer_init(uint32_t frequency) {
uint32_t timer_get_ticks(void) {
return tick;
}
}