From a97c9f7018e443b4acd110d14484e17f376b96a3 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Wed, 18 Aug 2021 22:01:56 +0200 Subject: [PATCH] Ports I\/O --- kernel/io.c | 10 ++++++++++ kernel/io.h | 0 2 files changed, 10 insertions(+) create mode 100644 kernel/io.c create mode 100644 kernel/io.h diff --git a/kernel/io.c b/kernel/io.c new file mode 100644 index 0000000..9b630ef --- /dev/null +++ b/kernel/io.c @@ -0,0 +1,10 @@ +unsigned char port_byte_in(unsigned short port) { + unsigned char res; + __asm__("in %%dx, %%al" : "=a" (res) : "d" (port)); + + return res; +} + +void port_byte_out(unsigned short port, unsigned char data) { + +} diff --git a/kernel/io.h b/kernel/io.h new file mode 100644 index 0000000..e69de29