From 89536d1f20dae094b9e18c2f2e8b930f94fbc2c4 Mon Sep 17 00:00:00 2001 From: Alee Date: Sun, 13 May 2018 16:58:36 -0400 Subject: Added souce files --- include/system.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 include/system.h (limited to 'include/system.h') diff --git a/include/system.h b/include/system.h new file mode 100644 index 0000000..6184c31 --- /dev/null +++ b/include/system.h @@ -0,0 +1,16 @@ +#ifndef SYSTEM_H +#define SYSTEM_H +#include "types.h" +uint8 inportb (uint16 _port) +{ + uint8 rv; + __asm__ __volatile__ ("inb %1, %0" : "=a" (rv) : "dN" (_port)); + return rv; +} + +void outportb (uint16 _port, uint8 _data) +{ + __asm__ __volatile__ ("outb %1, %0" : : "dN" (_port), "a" (_data)); +} + +#endif -- cgit v1.2.3