aboutsummaryrefslogtreecommitdiff
path: root/kernel.cc
blob: 3df1903d3b17de4915a034e5e9fea436a60e4870 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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();
}