diff --git a/src/pio.S b/src/pio.S new file mode 100644 index 0000000..7681ee0 --- /dev/null +++ b/src/pio.S @@ -0,0 +1,13 @@ +.global outb +outb: + mov 4(%esp), %dx + mov 8(%esp), %al + out %al, %dx + ret + +.global inb +inb: + mov 4(%esp), %dx + xor %eax, %eax + in %dx, %al + ret \ No newline at end of file diff --git a/src/pio.hpp b/src/pio.hpp new file mode 100644 index 0000000..68aed33 --- /dev/null +++ b/src/pio.hpp @@ -0,0 +1,8 @@ +#ifndef PIO_H +#define PIO_H + +extern "C" void outb(short port, char data); + +extern "C" char inb(short port); + +#endif \ No newline at end of file