Solved

Detect 2nd processor

Posted on 2002-06-05
7
182 Views
Last Modified: 2010-04-20
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
Comment
Question by:medent
  • 4
  • 3
7 Comments
 
LVL 1

Expert Comment

by:jsnorman
ID: 7059985
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
 

Author Comment

by:medent
ID: 7060057

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
 
LVL 1

Accepted Solution

by:
jsnorman earned 200 total points
ID: 7060077
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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:medent
ID: 7060127
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
 
LVL 1

Expert Comment

by:jsnorman
ID: 7060140
Thanks.  Sorry I couldn't help more; I am curious, though, as to where/why the vanilla kernel approach fails?
0
 

Author Comment

by:medent
ID: 7060161
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
 
LVL 1

Expert Comment

by:jsnorman
ID: 7060169
Thanks.  Sorry I couldn't help more; I am curious, though, as to where/why the vanilla kernel approach fails?
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now