Cpuinfo falsification
Encyclopedia
cpuinfo falsification is a lowest common denominator technique that can be used on GNU
GNU
GNU is a Unix-like computer operating system developed by the GNU project, ultimately aiming to be a "complete Unix-compatible software system"...

 operating systems to provide backwards compatible behaviour of the compiler and software tools. This technique is typically used on IBM compatible computers using 80x86 series processors, but can be used on other architectures, where applicable.

Background

On GNU
GNU
GNU is a Unix-like computer operating system developed by the GNU project, ultimately aiming to be a "complete Unix-compatible software system"...

 based operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

s, some software tools, such as the compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

 and package building tools, detect CPU specific extensions that are incompatible with existing machines. This may cause incompatibility issues during compilation or operation of software on computers being utilized as backward compatible replacements.

The cpuinfo falsification project

The cpuinfo falsification project provides an assortment of patches to the GNU operating system to provide i386 compatible behaviour of the compiler and software tools without the need for explicit cross compilation.

setarch

The Unix setarch command provides the facility to generate falsified generic architecture information for system building. However, this does not currently work on GNU
GNU
GNU is a Unix-like computer operating system developed by the GNU project, ultimately aiming to be a "complete Unix-compatible software system"...

 based operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

s:

# The setarch utility does not work at this time
setarch i386
uname -m
i686 <--- It's not working.

uname_hack

The uname_hack kernel module causes generic architecture information to be provided by the kernel.

uname

The uname
Uname
uname is a software program in Unix and Unix-like computer operating systems that prints the name, version and other details about the current machine and the operating system running on it...

 utility is fixed by loading the uname hack module. This provides falsified processor information for "lowest common denominator" compatibility.

uname -m
i686 <--- This is no good
insmod uname_hack.ko
uname -m
i386 <--- This will work just fine on a Pentium

/proc/cpuinfo

The /proc/cpuinfo file is patched by using a bindmount to overlay a file containing falsified CPU related information:

if [ -e /etc/cpuinfo] ; then
mount—bind /etc/cpuinfo /proc/cpuinfo
fi
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK