Pandora Finding the Pandora version with a Bash script


PowerGod

Forum Addict!
Joined
Jun 20, 2011
Messages
4,419
How can I find the version of Pandora with a bash script ?

I started searching the total RAM, and if it has more then 256 Mb then it's not a Classic one

if [ $(free -m | grep -e "^Mem:" | awk '{ print $2 }') > 256 ]; then echo "Pandora Rebirth OR Pandora 1 Ghz"; else echo "Pandora Classic"; fi But what can I search to know if it is a 1 Ghz ?

Is reported somewhere the CPU used ? Or maybe I can look at some other parameter ?
 
Last edited by a moderator:
This is what i use, but there's other solutions:

Code:
#using the GPU clock to detect the current CPU model
MEMCLOCK=$(cat /proc/pandora/sys_mhz_max)

#1GHz unit detected
if [ "$MEMCLOCK" == 400 ]
 then
  echo "it's a 1GHz"
fi

#600MHz unit detected
if [ "$MEMCLOCK" == 332 ]
 then
  echo "it's a CC/RB"
fi
 
Last edited by a moderator:
Why do you want that?

It's possible to change /proc/pandora/sys_mhz_max to 400 on CC unit, or even change it to something like 334 and Linux-SWAT's script will fail miserably.
 
Last edited by a moderator:
I was thinking that too, but for for now is the only idea i found...

I'm making a script to get all the useful info about games from pndrun.out of DraStic, to format them for the wiki automatically, and I'm searching to reduce to the minimum the request of information to the user...
 
I use my script at boot :p .

BTW, there's plenty of info in dmesg.
 
Last edited by a moderator:
Look at which sgx it has?


My 1GHz /proc/cpuinfo:

Code:
Processor : ARMv7 Processor rev 2 (v7l)
BogoMIPS : 1095.51
Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc08
CPU revision : 2


Hardware : Pandora Handheld Console
Revision : 0020
Serial : 0000000000000000
 
Last edited by a moderator:
My 512 Unit have "CPU variant : 0x1". 

imho, this is the best way to sort out :

CPUV=$(awk -F: '/CPU variant/{print $2}' < /proc/cpuinfo)

MEM=$(awk '/MemTotal:/{print $2}'</proc/meminfo)


if [[ $CPUV == "0x3" ]];then

  echo "1Ghz"

elif [ $MEM -gt 500000 ];then

  echo 512Unit

else

  echo "Original Unit"

fi

 
 
Thanks all :) I didn't know about these secret files

elif [ $MEM -gt 500000 ];then
Isn't it better to compare with 256 ? I remember that a years ago, my Rebirth with the old firmware was using a little more then 256 Mb, but with this script it can be identified as Classic
 
Well you could go the other way around :

if [ $(awk '/MemTotal:/{print $2}'</proc/meminfo) -lt 264000 ];then


  echo "Original Unit"

elif [[ $(awk -F: '/CPU variant/{print $2}' < /proc/cpuinfo) == "0x1" ]];then

  echo 512Unit

else

  echo "1Ghz"

fi
 
I think I'll use this  :)

I gave a look at my /proc/cpuinfo and I have "Processor : ARMv7 Processor rev 3 (v7l)"

Isn't it strange that the revision in my Rebirth is newer than the one of linuxbochs 1Ghz ?!  :huh:  maybe it's related to the variant...
 
Last edited by a moderator:
Back
Top