From e303a03e7c96bc5bf7fa93f7b46ce63196893d7a Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Sun, 19 Dec 2021 22:41:15 +0000 Subject: moving files around --- kc/core/port.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 kc/core/port.c (limited to 'kc/core/port.c') diff --git a/kc/core/port.c b/kc/core/port.c new file mode 100644 index 0000000..17af396 --- /dev/null +++ b/kc/core/port.c @@ -0,0 +1,14 @@ +#include "port.h" + +uint8_t inb(uint16_t port) +{ + uint8_t data; + __asm__ ("inb %1, %0" : "=a"(data) : "d"(port)); + return data; +} + +void outb(uint16_t port, uint8_t data) +{ + __asm__ ("outb %0, %1" :: "a"(data), "d"(port)); +} + -- cgit v1.3.1-1-g115d