PCI, Serial, Shell improvements (VGA is broken)

This commit is contained in:
Nicholas Orlowsky 2025-02-03 16:24:00 -05:00
parent 50f5723733
commit dac2cff511
14 changed files with 125490 additions and 64 deletions

View file

@ -27,6 +27,16 @@ static inline unsigned char inb(int port) {
return val;
}
static inline void outl(uint32_t port, uint32_t val) {
__asm__ volatile("outl %k0, %k1" : : "a"(val), "Nd"(port) : "memory");
}
static inline uint32_t inl(uint32_t port) {
uint32_t val;
__asm__ volatile("inl %k1, %k0" : "=a"(val) : "Nd"(port) : "memory");
return val;
}
static inline void interrupt_disable() { __asm__ volatile("cli"); }
static inline void interrupt_enable() { __asm__ volatile("sti"); }

View file

@ -10,6 +10,7 @@ enum irq_code_t {
IRQCODE_PIT = 32,
IRQCODE_PS2 = 33,
IRQCODE_SYSCALL = 128,
IRQCODE_COM1 = 36,
};
void kb_handler() {
@ -69,6 +70,13 @@ void irq_handler(struct regs *r) {
kb_handler();
break;
};
case IRQCODE_COM1: {
char c = serial_rx();
c = c == '\r' ? '\n' : c;
c = c == 127 ? '\b' : c;
handle_keypress_char(c);
break;
};
}
// Send EOI to follower controller