]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kern/sparc/main.cpp
Update
[l4.git] / kernel / fiasco / src / kern / sparc / main.cpp
1 INTERFACE [sparc]:
2 #include <cstddef>
3
4 //---------------------------------------------------------------------------
5 IMPLEMENTATION [sparc]:
6
7 #include <cstdlib>
8 #include <cstdio>
9 #include <cstring>
10
11 #include "config.h"
12 #include "globals.h"
13 //#include "kmem_alloc.h"
14 #include "kip_init.h"
15 //#include "pagetable.h"
16 #include "kdb_ke.h"
17 #include "kernel_thread.h"
18 #include "kernel_task.h"
19 #include "kernel_console.h"
20 //#include "reset.h" //TODO cbass: implement
21 #include "space.h"
22 //#include "terminate.h" //TODO cbass: implement
23
24 #include "processor.h"
25 /*
26 static int exit_question_active = 0;
27
28 extern "C" void __attribute__ ((noreturn))
29 _exit(int)
30 {
31   if (exit_question_active)
32     platform_reset();
33
34   while (1)
35     {
36       Proc::halt();
37       Proc::pause();
38     }
39 }
40
41
42 static void exit_question()
43 {
44   exit_question_active = 1;
45
46   while (1)
47     {
48       puts("\nReturn reboots, \"k\" enters L4 kernel debugger...");
49
50       char c = Kconsole::console()->getchar();
51
52       if (c == 'k' || c == 'K')
53         {
54           kdb_ke("_exit");
55         }
56       else
57         {
58           // it may be better to not call all the destruction stuff
59           // because of unresolved static destructor dependency
60           // problems.
61           // SO just do the reset at this point.
62           puts("\033[1mRebooting...\033[0m");
63           platform_reset();
64           break;
65         }
66     }
67 }
68
69 */
70 #include "thread_state.h"
71 int main()
72 {
73   // caution: no stack variables in this function because we're going
74   // to change the stack pointer!
75
76   // make some basic initializations, then create and run the kernel
77   // thread
78   //set_exit_question(&exit_question);
79
80   // disallow all interrupts before we selectively enable them
81   //  pic_disable_all();
82
83   // create kernel thread
84   static Kernel_thread *kernel = new (Ram_quota::root) Kernel_thread;
85   Task *const ktask = Kernel_task::kernel_task();
86   check(kernel->bind(ktask, User<Utcb>::Ptr(0)));
87   //kdb_ke("init");
88
89   // switch to stack of kernel thread and bootstrap the kernel
90 }
91