aboutsummaryrefslogtreecommitdiffstats
path: root/core/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/console.c')
-rw-r--r--core/console.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/core/console.c b/core/console.c
new file mode 100644
index 00000000..282c57f5
--- /dev/null
+++ b/core/console.c
@@ -0,0 +1,22 @@
+#include <stddef.h>
+#include <com32.h>
+#include <stdio.h>
+#include <string.h>
+
+void myputchar(int c)
+{
+ static com32sys_t ireg;
+
+ if (c == '\n')
+ myputchar('\r');
+
+ ireg.eax.b[1] = 0x02;
+ ireg.edx.b[0] = c;
+ __intcall(0x21, &ireg, NULL);
+}
+
+void myputs(const char *str)
+{
+ while (*str)
+ myputchar(*str++);
+}