How to retrieve the firmware version string

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
sauron_le_noir
Posts: 203
Joined: Sat Jul 05, 2008 8:03 am

How to retrieve the firmware version string

Post by sauron_le_noir »

I know 2 methods to retrieve the firmware version

1> read in flash0 flash0:/vsh/etc/version.txt
2> use isceKernelDevkitVersion(void);

but all this 2methode don't return me if it is a 5.3 5.3M33 5.3HEN etc ...
what i need is the string that appears in the vhs system information

is it in memory and if yes where ? and how to retrieve it ?
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

The firmware is in a number form. So to get that number into a string, you have to get 3 parts from it. For example, the number may be 01050010 which could stand for 1.50. 01 05 00 are the main ones we are looking for. 05000000 could stand for 5.00. Take a look in the source code of the 3.xx to get a code to convert that firmware version into a string.
sauron_le_noir
Posts: 203
Joined: Sat Jul 05, 2008 8:03 am

Post by sauron_le_noir »

i know that what i want is the string present in the vhs menu i try to understand the version and mac spool code of davee but i have some difficulties to understand what is is doing

_sw(0x3C020000 | ((int)ver_info >> 16), mod->text_addr + sysconfPatches.sysconf_ver);

_sw(0x34420000 | ((int)ver_info & 0xFFFF), mod->text_addr + sysconfPatches.sysconf_ver + 4);

_sw(val,adrs) store a word at adrs (thx to corry to explain me that)
mod->text_addr ???? he is using a plugins to perform this what is the equivalent
for a kernel prx ?
ver_info is a pointer to version string
so what is the base adresse for a kernel prx that i must use to read the string version
Last edited by sauron_le_noir on Wed Jun 10, 2009 7:29 am, edited 2 times in total.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

What the fuk is "number form"
If not actually, then potentially.
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

Do they even sell vhs with/without menus anymore?

Any particular reason why you didn't just keep asking in the same thread as before sauron_le_noir?
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

Art wrote:What the fuk is "number form"
0x02070110
What ever you want to call it. Hex, unsigned int, I dont care. Im just in a rush because im busy
sauron_le_noir
Posts: 203
Joined: Sat Jul 05, 2008 8:03 am

Post by sauron_le_noir »

no cory i just ask the question to maximize the chance to have a respons to my question see the reply on the other site ;):p:p:p:p
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

Here is a code to make the psp firmware a string from sceKernelDevkitVersion()

Code: Select all

char *getVersion(int x)
{
	static char ver[5], hex[9];
	sprintf(hex, "%08X", x);
	ver[0]=hex[1];
	ver[1]='.';
	ver[2]=hex[3];
	ver[3]=hex[5];
	ver[4]='\0';
	return ver;
}
This was copy from the 3.XXOE Open Source. Example

Code: Select all

#include <stdio.h>
#include <pspkernel.h>
#include <pspdebug.h>

PSP_MODULE_INFO&#40;"fw-str", 0, 1, 1&#41;;
#define printf pspDebugScreenPrintf
char *getVersion&#40;int x&#41;
&#123;
	static char ver&#91;5&#93;, hex&#91;9&#93;;
	sprintf&#40;hex, "%08X", x&#41;;
	ver&#91;0&#93;=hex&#91;1&#93;;
	ver&#91;1&#93;='.';
	ver&#91;2&#93;=hex&#91;3&#93;;
	ver&#91;3&#93;=hex&#91;5&#93;;
	ver&#91;4&#93;='\0';
	return ver;
&#125;
int main&#40;int argc, char *argv&#91;&#93;&#41;&#123;
     pspDebugScreenInit&#40;&#41;;
     printf&#40;"PSP Current Firmware&#58; %s\n", getVersion&#40;sceKernelDevkitVersion&#40;&#41;&#41;&#41;;
     return 1;
&#125;
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

removed!
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

but all this 2methode don't return me if it is a 5.3 5.3M33 5.3HEN etc ...
what i need is the string that appears in the vhs system information
If not actually, then potentially.
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

Just get the address that has the firmwar version patch to show ether M33, GEM, TDP, or HEN, or whatever it may be.
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

Dariusc123456 wrote:Just get the address that has the firmwar version patch to show ether M33, GEM, TDP, or HEN, or whatever it may be.
* while keeping in mind VSH uses unicode
sauron_le_noir
Posts: 203
Joined: Sat Jul 05, 2008 8:03 am

Post by sauron_le_noir »

that was the question darius a sample to retrieve the pointer of the vhs version menu. By the way i don't like function returning static variable there are not reentrant and i'm programming in c since 1988 ;)
thx corry i presume that the psp is using utf8 for the unicode encoding.
Post Reply