summaryrefslogtreecommitdiff
path: root/src/io.c
diff options
context:
space:
mode:
authorElizabeth Alexander Hunt <me@liz.coffee>2026-10-09 09:06:04 -0700
committerElizabeth Alexander Hunt <me@liz.coffee>2026-10-09 09:06:04 -0700
commitc74bd1baa844eac1fcb17a266ef720ed0c1ae616 (patch)
tree9b5c7699c8704b0930daeddffa568990254a231b /src/io.c
parentf021512078e7d2447e46a4856a81c0ba6e030d43 (diff)
downloadmacaroni-c74bd1baa844eac1fcb17a266ef720ed0c1ae616.tar.gz
macaroni-c74bd1baa844eac1fcb17a266ef720ed0c1ae616.zip
Bit o a refactah
Diffstat (limited to 'src/io.c')
-rw-r--r--src/io.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/io.c b/src/io.c
new file mode 100644
index 0000000..1d9db60
--- /dev/null
+++ b/src/io.c
@@ -0,0 +1,12 @@
+#include <stdint.h>
+#include "utils.h"
+
+uint8_t inportb(uint16_t port) {
+ uint8_t r;
+ asm("inb %1, %0" : "=a" (r) : "dN" (port));
+ return r;
+}
+
+void outportb(uint16_t port, uint8_t data) {
+ asm("outb %1, %0" : : "dN" (port), "a" (data));
+} \ No newline at end of file