summaryrefslogtreecommitdiff
path: root/src/io.c
diff options
context:
space:
mode:
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