I've just found the Windows API function to determine number of processors.
It's GetSystemInfo. Look at it in Windows API functions reference.
Regards,
Radek
I think there's some info about SMP in Ralf Brown's Interrupt List - APIC is
the way how to determine it.
> see if the cpu supports smp.. I guess the number of cpus would be provided
> by the OS or BIOS? is there a way to get this number in windows?
In Windows 9x/ME there isn't an easy way how to determine the number of
CPUs. Win9x/ME supports only one CPU, so on a SMP system the alternate CPUs
stay unused. Windows NT/2000/XP(=Whistler) supports more CPUs (Except the
WinXP Personal version which will support only one CPU). There are some API
functions that return the number of CPUs, but that number is always limited
by the version of Windows you use (e.g. 9x/ME/XP Personal returns one CPU,
nt/2000/xp returns at most 2 CPUs, NT server returns at most 4 CPUs (not
sure here?), 2000/XP server returns at most 4 CPUs, 2000/XP advanced server
returns at most 8 CPUs and 2000/XP datacenter server returns at most 32
CPUs)
I hope this helps...
Regards,
Radek
>> does anyone know a way to detect the number of cpus? from cpuid I can only
>
>I think there's some info about SMP in Ralf Brown's Interrupt List - APIC is
>the way how to determine it.
You can also use the multiprocessor specification from Intel (the
latest I have a copy of, is version 1.4, May 1997.) The BIOS is
permitted to place this table in one of several areas in memory, but
you can use it to find out about the CPUs in the system, their
features, and the buses on the system.
The MP configuration table can be at:
a. In the first kilobyte of Extended BIOS Data Area (EBDA), or
b. Within the last kilobyte of system base memory if the EBDA
segment is undefined, or
c. At the top of system physical memory, or
d. In the BIOS read-only memory space between 0E0000h and 0FFFFFh.
[The BIOS reports the base memory size in a two-byte location (40:13h)
of the BIOS data area. The base memory size is reported in kilobytes
minus 1K, which is used by the EBDA segment or for other purposes.
The exact starting address of the EBDA segment for EISA or MCA systems
can be found in a two-byte location (40:0Eh) of the BIOS data area.]
If system memory is used, the BIOS must not report this memory as part
of the available memory space. The two MP configuration data
structures can be located in the ROM space only if the system is
not dynamically reconfigurable.
You need a small search algorithm to find it on a wide variety of
systems.
Jon
There's a much easier way. Look for the environment variable called
"NUMBER_OF_PROCESSORS". This works under any application that's able
to query the environment, including a DOS program.
- Rick C. Hodgin
Yes, that's true, but only in NT :-) sure, 9x series cannot use more than
one cpu, but... :-)
Regards,
Radek
There's a program SMBIOS (with source code) on my website to display
this information:
http://www.sudleyplace.com/download.htm
Running SMBIOS /t=4 on my multiprocessor system displays
--> Type 4: Processor Information
Struc length is 26 bytes.
Struc handle is 0004h.
Socket Designation: Primary Processor
Processor Type: Central Processor
Processor Family: Pentium II processor
Processor Manufacturer: Intel Corporation
Processor ID: 00000652h.
Features: ...
Processor Version: Intel(R) Pentium(R) II processor
Voltage: 2.9V
External Clock (MHz): 100.
Max Speed (MHz): 450.
Current Speed (MHz): 450.
Status: CPU Socket: Populated
CPU Status: CPU Enabled
Processor Upgrade: Slot 1
--> Type 4: Processor Information
Struc length is 26 bytes.
Struc handle is 0005h.
Socket Designation: Secondary Processor
Processor Type: Central Processor
Processor Family: Pentium II processor
Processor Manufacturer: Intel Corporation
Processor ID: 00000652h.
Features: ...
Processor Version: Intel(R) Pentium(R) II processor
Voltage: 2.9V
External Clock (MHz): 100.
Max Speed (MHz): 450.
Current Speed (MHz): 450.
Status: CPU Socket: Populated
CPU Status: CPU Enabled
Processor Upgrade: Slot 1
_________________________________________
Bob Smith -- bsm...@sudleyplacedespam.com
a.k.a. bsm...@qualitasdespam.com
I've been getting a lot of junk e-mail lately,
so to reply to me directly, delete "despam".