summaryrefslogtreecommitdiffstats
path: root/kernel/kernel.c
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-11-04 13:41:10 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-11-04 13:41:10 +0100
commit7a07b4a4398e02aead731b0c38af143d6a2fe41a (patch)
treecd9ec8490531dfa26e05325f807fb0e8c8e06c24 /kernel/kernel.c
parent71e63d03f95d559c709911844ef1fc9907c74f49 (diff)
downloadjeyzuos-7a07b4a4398e02aead731b0c38af143d6a2fe41a.zip
jeyzuos-7a07b4a4398e02aead731b0c38af143d6a2fe41a.tar.gz
add io_ports
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");
}