aboutsummaryrefslogtreecommitdiff
path: root/src/krn
diff options
context:
space:
mode:
Diffstat (limited to 'src/krn')
-rw-r--r--src/krn/api/std.h18
-rw-r--r--src/krn/mkern.c13
2 files changed, 31 insertions, 0 deletions
diff --git a/src/krn/api/std.h b/src/krn/api/std.h
new file mode 100644
index 0000000..d22835f
--- /dev/null
+++ b/src/krn/api/std.h
@@ -0,0 +1,18 @@
+#define MÜLL_STD_H
+
+/*
+ * Minimal 'standard library' for I/O basics
+ */
+
+// includes
+#include <stdint.h>
+
+volatile uint16_t* VGA = (volatile uint16_t*)0xB8000;
+uint16_t cursor = 0;
+
+void RealPrint(const char* str) {
+ while(*str) {
+ VGA[cursor++] = (uint8_t)(*str) | 0x0700; // white on black
+ str++;
+ }
+}
diff --git a/src/krn/mkern.c b/src/krn/mkern.c
new file mode 100644
index 0000000..3bdc188
--- /dev/null
+++ b/src/krn/mkern.c
@@ -0,0 +1,13 @@
+#define MÜLL_KERN
+
+/*
+ * müll_kernel
+ */
+
+#include "api/std.h"
+
+void kmain(void) __attribute__((noreturn));
+void kmain(void) {
+ RealPrint("the kernel says hii!");
+ while (1);
+}