How many C++ kernels?
- Colonel Kernel
- Member
- Posts: 1437
- Joined: Tue Oct 17, 2006 6:06 pm
- Location: Vancouver, BC, Canada
- Contact:
You also have to make sure that getInstance() is either protected by a lock of some kind, or is first called with interrupts disabled (in case interrupt handlers call getInstance()) before any threads are created. Or you do what I do and have a separate init() method that gets called very early in kernel initialization before getInstance() is ever called. This is one reason why I try to avoid implementing Singleton with a pointer instead of a global object whenever possible (but in my kernel, it's not really possible because I need a predictable order of initialization).
Top three reasons why my OS project died:
- Too much overtime at work
- Got married
- My brain got stuck in an infinite loop while trying to design the memory manager
- AndrewAPrice
- Member
- Posts: 2299
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
I'm trying to minimize the use of assembly as much as possible (one exception is the stublet which includes the multiboot header and jumps to my C++ code). The other places I require assembly (setting up interrupts and some registry stuff) I use inline assembly and wrap it heavily hidden away in C++ classes.
I come from an C++/Game programming background where we focus on readability/object-oriented'ness. I've tried to implement the same concepts (message passing between objects, customisability, taking advantage of threading) in my OS and in game programming. It's interesting to see how people from different backgrounds have implemented different solutions to the same problems.
I come from an C++/Game programming background where we focus on readability/object-oriented'ness. I've tried to implement the same concepts (message passing between objects, customisability, taking advantage of threading) in my OS and in game programming. It's interesting to see how people from different backgrounds have implemented different solutions to the same problems.
My OS is Perception.