Jump to content
1 post in this topic

Recommended Posts

Is there a way to change the value that comes from calling this?:

 

/usr/sbin/sysctl -n hw.cpufamily

 

 

I'll explain why.

 

If you have a AMD processor, this command will return the value "1943433984".

 

Some people seems to use that as a way to know which type of CPU you have, to configure building of source codes in GCC.

 

1943433984 means 0x73d67300, which means 'core' or 'prescott' processors. They don't have 64bit instructions. And most AMD CPUs have support to 64bit.

 

So, is it possible to change this variable in sysctl?

 

 

EDIT:

 

I just made a workaround. Create a file named 'sysctl', put the code below, save it in your home directory.

 

#!/bin/bash
hwvar=$2
if [[ $hwvar =~ hw.cpufamily ]]; then
echo 1114597871
else
 /usr/sbin/sysctl_orig $*
fi

 

Open the Terminal, then make it executable:

 

chmod 755 ~/sysctl

 

Now rename the original sysctl binary.

 

sudo cp /usr/sbin/sysctl /usr/sbin/sysctl_orig

 

And copy our substitute:

 

sudo cp -i ~/sysctl /usr/sbin

 

Type 'y' to confirm overwrite.

 

Typing '/usr/sbin/sysctl -n hw.cpufamily' should give you the new value (1114597871)

 

Hope it helps.

Link to comment
https://www.insanelymac.com/forum/topic/275790-changing-cpu-family-amd/
Share on other sites

×
×
  • Create New...