diff options
| author | Ada Christine <adachristine18@gmail.com> | 2021-03-21 18:38:17 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2021-03-21 18:38:17 +0000 |
| commit | c359af48545e2427a69eb955b0512706d4afa7e9 (patch) | |
| tree | 3a58acf219d23f6cca69ec4dae7e3adb6da2b4c5 /kernel/port.c | |
| parent | b88cfbdfad533629b294797efc196034c61dbb75 (diff) | |
higher-half stub kernel does the thing
Diffstat (limited to 'kernel/port.c')
| -rw-r--r-- | kernel/port.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/port.c b/kernel/port.c new file mode 100644 index 0000000..17af396 --- /dev/null +++ b/kernel/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)); +} + |
