Initial commit

This commit is contained in:
Michael Shaw 2023-02-27 14:14:37 -05:00
commit bae9ffa930
11 changed files with 847 additions and 0 deletions

18
include/kernel/pio.h Normal file
View file

@ -0,0 +1,18 @@
#ifndef _PIO_H_
#define _PIO_H_
#include <stdint.h>
static inline void outb(uint16_t port, uint8_t val)
{
__asm__ volatile("outb %0, %1" : : "a"(val), "Nd"(port));
}
static inline uint8_t inb(uint16_t port)
{
uint8_t ret;
__asm__ volatile("inb %1, %0" : "=a"(ret) : "Nd"(port));
return ret;
}
#endif /* _PIO_H_ */