Script Detection of Processor Architecture

Michael Tautschnig tautschn at model.in.tum.de
Tue May 23 22:46:58 CEST 2006


> I have kernels compiled for p3, p3-smp, p4, p4-smp, 586mmx, k8, and k8-smp.
> 
> Essentially, I'd like to be able to detect which selection under Processor Type
> in the kernel source config is best compatible with the running processor.  It'd
> be nice to detect SMP, as well, and I'm not sure if cpuinfo can detect multiple
> processors if the kernel is a uniprocessor build.
> 
> I'm wondering if there might be a way to make the distinction based on the cpu
> flags, like sse2 or mmxext and so forth.
> 
> What would you suggest?
> 

http://www.cs.helsinki.fi/linux/linux-kernel/2001-30/0026.html

seems to be the only way to detect the SMP/UP-thing, if it still works.

Thereby you should be able to distinguish UP vs. -smp variants. The next thing
to find out is probably Intel vs. AMD, which should be easy (vendor_id).

I haven't got any P3 here, so I cannot tell you how they announce themselves,
but the P4s here either call themselves "Intel(R) Pentium(R) 4 CPU" or simply
"Intel(R) Xeon(TM)". Only the flags are somewhat different...

Good luck,
Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20060523/40070b15/attachment.bin 


More information about the linux-fai mailing list