OSDev.org

The Place to Start for Operating System Developers
It is currently Fri May 10, 2024 12:12 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: number of processors?
PostPosted: Wed Feb 18, 2004 1:01 pm 
hi,
i want to code a funtion to determine the number of processors. I know the cpuid function, but i found no documentation about the number of processors.
How can i get the number of processors?

thanks for help!

bye,
matze


Top
  
 
 Post subject: Re:number of processors?
PostPosted: Wed Feb 18, 2004 2:30 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 2:31 am
Posts: 5964
Location: In a galaxy, far, far away
probably the section about multiprocessors in Intel Manual should provide better information ...

_________________
Image May the source be with you.


Top
 Profile  
 
 Post subject: Re:number of processors?
PostPosted: Thu Feb 19, 2004 1:55 am 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 11:33 pm
Posts: 3882
Location: Eindhoven
mk wrote:
I know the cpuid function, but i found no documentation about the number of processors.
How can i get the number of processors?


As you should know, cpuid is local. The only way to get to another CPU is to kickstart it and let it tell for itself (at least, it's the way to get all the working ones in your set). You can do that by sending an IPI to the other processors (type ALL_BUT_ME or such) to start working at a certain address where you put some code that takes a mutex, ups the processor count, releases the mutex (could all be done by a LOCK INC [EBX] or so) and then waits for the main processor to tell it what to do. You wait in the main processor for the number to change (5 secs?) and then display that as count of working processors.

Of course, if you only want to do some statistics stuff, read the APIC settings. They should tell the count.

For info, search on intel for "multiprocessor specification" and/or "APIC" or "IO APIC". The last one I didn't check too far but it should redirect interrupts.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 63 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