Assignment 3 (only src and notes)

This commit is contained in:
Teodor
2026-04-14 16:04:17 +00:00
parent d3d8b973c0
commit ea416765bf
16 changed files with 531 additions and 47 deletions

View File

@@ -0,0 +1,20 @@
#ifndef KERNEL_IO_H
#define KERNEL_IO_H
#include <libc/stdint.h>
static inline void OutPortByte(uint16_t port, uint8_t val) {
__asm__ volatile ("outb %0, %1" : : "a"(val), "Nd"(port));
}
static inline uint8_t InPortByte(uint16_t port) {
uint8_t ret;
__asm__ volatile ("inb %1, %0" : "=a"(ret) : "Nd"(port));
return ret;
}
static inline void IoWait(void) {
__asm__ volatile ("outb %%al, $0x80" : : "a"(0));
}
#endif