]> git.buserror.net Git - polintos/scott/priv.git/blob - kernel/core/init.cc
minor doc updates
[polintos/scott/priv.git] / kernel / core / init.cc
1 // core/init.cc -- C++ entry point and component initialization.
2 //
3 // This software is copyright (c) 2006 Scott Wood <scott@buserror.net>.
4 // 
5 // This software is provided 'as-is', without any express or implied warranty.
6 // In no event will the authors or contributors be held liable for any damages
7 // arising from the use of this software.
8 // 
9 // Permission is hereby granted to everyone, free of charge, to use, copy,
10 // modify, prepare derivative works of, publish, distribute, perform,
11 // sublicense, and/or sell copies of the Software, provided that the above
12 // copyright notice and disclaimer of warranty be included in all copies or
13 // substantial portions of this software.
14
15 #include <kern/types.h>
16 #include <kern/libc.h>
17 #include <kern/console.h>
18 #include <kern/arch.h>
19 #include <kern/time.h>
20 #include <kern/thread.h>
21 #include <kern/orb.h>
22
23 extern void *eh_frame_begin;
24 extern "C" void __register_frame(const void *begin);
25
26 void run_test();
27
28 extern "C" void start_kernel()
29 {
30         run_ctors();
31         Arch::arch_init();
32
33         // __register_frame must not be called until after dynamic memory
34         // allocation is initialized (exceptions wouldn't work before then,
35         // anyway; if one is thrown, abort() will be called).
36         
37         __register_frame(&eh_frame_begin);
38         printf("Starting kernel...\n");
39
40         Time::init();
41         Threads::sched.init();
42         ll_ints_on();
43         ORB::init();
44         
45         run_test();
46         
47         printf("done.\n");
48         for(;;);
49 }