Initial commit

This commit is contained in:
Chris
2026-02-04 20:51:17 +01:00
commit ddac1a791e
132 changed files with 11491 additions and 0 deletions

24
src/kernel/io.h Normal file
View File

@@ -0,0 +1,24 @@
#ifndef IO_H
#define IO_H
#include <stdint.h>
static inline void outb(uint16_t port, uint8_t val) {
asm volatile ("outb %0, %1" : : "a"(val), "Nd"(port));
}
static inline void outw(uint16_t port, uint16_t val) {
asm volatile ("outw %0, %1" : : "a"(val), "Nd"(port));
}
static inline uint8_t inb(uint16_t port) {
uint8_t ret;
asm volatile ("inb %1, %0" : "=a"(ret) : "Nd"(port));
return ret;
}
static inline void io_wait(void) {
outb(0x80, 0);
}
#endif