Espresso 0.0.0e

This commit is contained in:
2025-06-13 18:03:39 -05:00
parent 6d366537dd
commit 1e5b4a765b
40 changed files with 742 additions and 718 deletions

View File

@ -0,0 +1,32 @@
/*#include <stdint.h>
#include <port_io.h>
#include <drivers/irq.h>
#define PIT_CHANNEL0 0x40
#define PIT_COMMAND 0x43
#define PIT_FREQUENCY 1193182
static uint32_t tick = 0;
void pit_callback(struct regs* r)
{
(void)r;
tick++;
}
void pit_init(uint32_t frequency)
{
uint32_t divisor = PIT_FREQUENCY / frequency;
outb(PIT_COMMAND, 0x36);
outb(PIT_CHANNEL0, (uint8_t)(divisor & 0xFF));
outb(PIT_CHANNEL0, (uint8_t)((divisor >> 8) & 0xFF));
register_interrupt_handler(32, pit_callback);
}
void sleep(uint32_t milliseconds)
{
uint32_t target = tick + milliseconds;
while (tick < target);
}*/