How many C++ kernels?

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Post by Colonel Kernel »

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:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
User avatar
AndrewAPrice
Member
Member
Posts: 2298
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Post by AndrewAPrice »

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.
My OS is Perception.
Post Reply