From 61b4f7fb29db2e8f8af266fcb0836b6b9232245a Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 31 Jan 2021 22:08:01 +0200 Subject: Initial commit --- kernel.cc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 kernel.cc (limited to 'kernel.cc') 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 +#include + +/* 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(); +} -- cgit v1.2.1