aboutsummaryrefslogtreecommitdiff
path: root/kernel.cc
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2021-01-31 22:08:01 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2021-01-31 22:08:01 +0200
commit61b4f7fb29db2e8f8af266fcb0836b6b9232245a (patch)
treec5aa7d9049cbeb60e17e8440ac8eb0f79decf66b /kernel.cc
downloadkernel.cpp-61b4f7fb29db2e8f8af266fcb0836b6b9232245a.tar.xz
Initial commit
Diffstat (limited to 'kernel.cc')
-rw-r--r--kernel.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/kernel.cc b/kernel.cc
new file mode 100644
index 0000000..3df1903
--- /dev/null
+++ b/kernel.cc
@@ -0,0 +1,26 @@
+#include <stdlib.h>
+#include <types.h>
+
+/* Check if the compiler thinks you are targeting the wrong operating system. */
+#if defined(__linux__)
+#error "You are not using a cross-compiler"
+#endif
+
+/* This tutorial will only work for the 32-bit ix86 targets. */
+#if !defined(__i386__)
+#error "This tutorial needs to be compiled with a ix86-elf compiler"
+#endif
+
+#include "vga.h"
+
+extern "C" void kernel_main(void) {
+ VGA terminal;
+ console_set(&terminal);
+
+ terminal.set_color(VGA::VGA_COLOR_CYAN, VGA::VGA_COLOR_BROWN);
+ terminal.write("Hello, kernel World! xxx--\n", "--xyxyxz\n", 10);
+
+ printk("This is printk\n");
+
+ abort();
+}