summaryrefslogtreecommitdiffstats
path: root/src/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/kernel.C33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/kernel/kernel.C b/src/kernel/kernel.C
index 2d97204e1..d44095719 100644
--- a/src/kernel/kernel.C
+++ b/src/kernel/kernel.C
@@ -1,14 +1,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");
- printk("Testing a character %c %c %c\n", 'a', 'b', 'c');
- printk("Testing numbers %hhd %hu %x %lx %lld\n",
- (char)-1, (short)1234, 0xabcdef12, 0xdeadbeef,
- 0x0123456789abcdef);
- while(1);
+
+ 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