From 9b2a78fa52249ab481493550490aa5f37872dcf6 Mon Sep 17 00:00:00 2001 From: aqua Date: Sat, 10 Dec 2022 20:56:57 +0200 Subject: Rewrite drivers/uart and drivers/vga in cpp --- i686/sys/io.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 i686/sys/io.hpp (limited to 'i686/sys/io.hpp') diff --git a/i686/sys/io.hpp b/i686/sys/io.hpp new file mode 100644 index 0000000..bea9323 --- /dev/null +++ b/i686/sys/io.hpp @@ -0,0 +1,15 @@ +#pragma once + +template struct Port { + static void + out(T val, unsigned short offset = 0) + { + outb(val, port + offset); + } + + static auto + in(unsigned short offset = 0) + { + return inb(port + offset); + } +}; -- cgit v1.2.1