• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

Detect 2nd processor

Hi,
 I am writing a script to install a custom kernel; however I'm not sure how to determine if there is physically a second processor installed. It's a piece of cake if the current booted kernel is SMP, but if it isnt the system seems to have no trace of it (hwconf, proc/cpuinfo,etc)
0
medent
Asked:
medent
  • 4
  • 3
1 Solution
 
jsnormanCommented:
A couple of options I can think of.

First, and easiest, is to compile all of the target kernels to include SMP support.  This adds very little to the size of the kernel, and adding SMP support does no harm to a uniprocessor system.

Second, is to enable ACPI.  ACPI should detect and report (in kernel messages -- dmesg|grep CPU -- the presence of multiple CPUs).
0
 
medentAuthor Commented:

1. According to the help for CONFIG_SMP, the kernel will run faster if SMP is not selected (on a uniprocessor), so that is not a desirable option.
2. I think you meant APIC- dmsg doesnt report both processors, possible my ibm5100 (pIII 933mhz)server doesnt support APIC....
Thank You.
0
 
jsnormanCommented:
It is true that the kernel will run faster (not by much though) if you deselect CONFIG_SMP.  However, you are writing a script to build a custom kernel, right?  So there is no harm  I think in using a vanilla kernel (that includes SMP and all drivers) as a bootstrap kernel in which to run your script.  This makes it much easier to detect hardware more precisely (not just processors).  Once your script has built the appropriate makefiles, and the new kernel is compiled with only the appropriate options/drivers, the new kernel would presumably be the production kernel.  This is how most every hardware detection scheme I have seen works (vanilla kernel, all drivers are attempted to load, then custom config is built).

I actually did mean ACPI -- not APIC.  I too have never gotten APIC to work.  Must be broken.  But ACPI reports processors, at least in the 2.5 kernels (documented) and I think also in the 2.4 kernels (not documented).
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
medentAuthor Commented:
The vanilla kernel doesnt cover all my situations. Appears to be a dead end for me until apic is resolved. Thanks, in any case that was very helpful info.
0
 
jsnormanCommented:
Thanks.  Sorry I couldn't help more; I am curious, though, as to where/why the vanilla kernel approach fails?
0
 
medentAuthor Commented:
1) If we sent out a tech on site to upgrade a server to a smp, and he pops the cpu in, and forgets the procedure to manually upgrade the kernel- I have no way to tool up a way to detect his error.
2) Our production servers starts out from redhat cd's which boot up a kernel with 2 choices (default is ok)- if for some reason the tech selects the wrong one, my script will follow suite.
0
 
jsnormanCommented:
Thanks.  Sorry I couldn't help more; I am curious, though, as to where/why the vanilla kernel approach fails?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now