summaryrefslogtreecommitdiffstats
path: root/src/kernel/kernel.C
blob: d44095719409afa1cd98eae13a7dc40e666f01d3 (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
27
28
29
30
31
32
33
34
35
36
37
#include <stdint.h>
#include <kernel/console.H>
#include <util/singleton.H>

class Kernel
{
    public:
	void cppBootstrap();	

    protected:
	Kernel() {};
};

int main()
{
    printk("Booting Chenoo kernel...\n");
    
    Kernel& kernel = Singleton<Kernel>::instance();
    kernel.cppBootstrap();

    while(1);
    return 0;
}

void Kernel::cppBootstrap()
{
    // Call default constructors for any static objects.
    extern void (*ctor_start)();
    extern void (*ctor_end)();
    void(**ctors)() = &ctor_start;
    while(ctors != &ctor_end)
    {
	(*ctors)();
	ctors++;
    }
}

OpenPOWER on IntegriCloud