?
Solved

Detect 2nd processor

Posted on 2002-06-05
7
Medium Priority
?
188 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 600 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
Technology Partners: 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!

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…
Suggested Courses

649 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