summaryrefslogtreecommitdiffstats
path: root/kernel/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kernel.c')
-rw-r--r--kernel/kernel.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/kernel.c b/kernel/kernel.c
index d81c8a7..6b7f077 100644
--- a/kernel/kernel.c
+++ b/kernel/kernel.c
@@ -1,5 +1,6 @@
#include "tty.h"
#include "stdlib.h"
+#include "io_ports.h"
/* this only work for the 32-bit ix86 targets. */
#if !defined(__i386__)
@@ -34,5 +35,22 @@ void kernel_main()
test(strncmp("abc", "abc", 8) == 0);
test(strncmp("abca", "abcb", 3) == 0);
+
+ tty_puts("inw : ");
+ while(true) {
+ int ret = inw(0x03F8);
+ if (ret == 97) {
+ tty_puts(" ok\n");
+ break;
+ }
+ }
+ tty_puts("outw :\n");
+ outw(0x03F8, 'h');
+ outw(0x03F8, 'e');
+ outw(0x03F8, 'l');
+ outw(0x03F8, 'l');
+ outw(0x03F8, 'o');
+ outw(0x03F8, '\0');
+
tty_puts("done.\n");
}