Wednesday, September 3, 2008

Re: [BLUG] Amarok

On Tue, Sep 02, 2008 at 12:55:42PM -0600, Abhishek Kulkarni wrote:
> I would possibly rely on "uname -m". I have never gotten 'uname -p' to show
> either x86 or i386 on Ubuntu. For some reasons, it just says "unknown".
> It's a bug with either Ubuntu or coreutils which noone seems to keen to fix.

Sorry. I actually meant -m. That was a typo on my part.

The processor, like the hardware platform, is unknowable in Linux. This
is a trait of the underlying PC platform. You can never really know what
type of CPU you are using. Modern x86 CPUs have specific calls to get
this information, but Linux still runs on 386-class machines and you do
not want to know the kinds of hoops people needed to jump through to try
to get the processor class earlier on.

I know, now you're saying, "but it is easily available now, just
check /proc/cpuinfo". Here you have to remember that the entire /proc
filesystem is optional, as well as that the format of /proc/cpuinfo
varies by architecture. Non-x86 /proc/cpuinfo files look significantly
different.

Of course, if modern Linux kernels have an ioctl to query the processor
type in a clean, reliable method that works on other architectures, then
you should file a bug.

Cheers,

--
Steven Black <blacks@indiana.edu> / KeyID: 8596FA8E
Fingerprint: 108C 089C EFA4 832C BF07 78C2 DE71 5433 8596 FA8E

No comments: