[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CPUID module

From: Yoshinori K. Okuji
Subject: Re: CPUID module
Date: Fri, 18 May 2007 20:35:35 +0200
User-agent: KMail/1.9.4

On Friday 18 May 2007 17:50, Robert Millan wrote:
> Here's a patch to implement cpuid.mod.


> This module checks for CPU features 
> (currently only the long_mode flag, but more could be added if needed)
> using cpuid.  The idea behind this is that grub.cfg scripts can use it to
> decide wether a 64-bit or 32-bit Linux image should be boot (e.g. like
> Debian multiarch CDs do).  I haven't investigated what the syntax for that
> hack would be, although I assume it's possible.

Personally, I think it would be cleaner to just return true or false (like 
test) rather than setting an environment variable. For instance:

if cpuid --long-mode; then ...; else ...; fi

> Cpuid detection code has been borrowed from gcc and is FSF-copyrighted.
> I'm not sure where would the file go.  I noticed that other utility modules
> (e.g. hello/hello.c) add themselves in the top dir, so I suppose
> i386/cpuid.c would be ok?
> Or perhaps we could have an "util" dir for modules?

No. Please use commands/i386/. "util" is strictly for utilities for an host 
operating system.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]