This commit is contained in:
2025-04-30 23:03:44 -07:00
parent a464e109cb
commit ecfa54e225
30 changed files with 584 additions and 1191 deletions

14
kernel/io.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef IO_H
#define IO_H
static inline void outb(uint16_t port, uint8_t val) {
asm volatile ("outb %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;
}
#endif