Debian Codegraph @

kernel/boot/stage2.c

raw
1 /*
2 * libcaca Colour ASCII-Art library
3 * Copyright (c) 2006 Sam Hocevar <[email protected]>
4 * 2009 Jean-Yves Lamoureux <[email protected]>
5 * All Rights Reserved
6 *
7 * This library is free software. It comes without any warranty, to
8 * the extent permitted by applicable law. You can redistribute it
9 * and/or modify it under the terms of the Do What the Fuck You Want
10 * to Public License, Version 2, as published by Sam Hocevar. See
11 * http://www.wtfpl.net/ for more details.
12 */
13
14 #include "kernel.h"
15 #include "klibc.h"
16
17 extern int kmain(void);
18
19
20 /* Entry point bootsect.asm loaded this file at 0x0100:0x0, which is mapped
21 at 0x8:0x1000 (selector+8bytes, offset 1000 (0x100 + 0x0) */
22
23 /* 0x1000 */
24 void _start(void)
25 {
26 clearscreen();
27
28 init_gdt();
29 print("Loading IDT\n");
30 init_idt();
31 print("Loading PIC\n");
32 init_pic();
33 print("Running kmain()\n");
34 sti;
35
36 kmain(); /* Call kernel's kmain() */
37
38 while (1)
39 { /* Never return */
40 print("hlt;\n");
41 }
42 }