OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 1:00 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 32 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject:
PostPosted: Thu Jul 12, 2007 8:46 am 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 6:06 pm
Posts: 1437
Location: Vancouver, BC, Canada
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!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 15, 2007 3:55 am 
Offline
Member
Member
User avatar

Joined: Mon Jun 05, 2006 11:00 pm
Posts: 2293
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.

_________________
My OS is Perception.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 25 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group