Solved

Detect 2nd processor

Posted on 2002-06-05
7
180 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 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

17 Experts available now in Live!

Get 1:1 Help Now