forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to retrieve the firmware version string

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
sauron_le_noir



Joined: 05 Jul 2008
Posts: 229

PostPosted: Wed Jun 10, 2009 6:40 am    Post subject: How to retrieve the firmware version string Reply with quote

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 ?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Dariusc123456



Joined: 12 Aug 2008
Posts: 394

PostPosted: Wed Jun 10, 2009 7:07 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
sauron_le_noir



Joined: 05 Jul 2008
Posts: 229

PostPosted: Wed Jun 10, 2009 7:23 am    Post subject: Reply with quote

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[i].sysconf_ver);

_sw(0x34420000 | ((int)ver_info & 0xFFFF), mod->text_addr + sysconfPatches[i].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
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Wed Jun 10, 2009 7:25 am    Post subject: Reply with quote

What the fuk is "number form"
_________________
If not actually, then potentially.
Back to top
View user's profile Send private message
cory1492



Joined: 10 Dec 2004
Posts: 216

PostPosted: Wed Jun 10, 2009 9:11 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Dariusc123456



Joined: 12 Aug 2008
Posts: 394

PostPosted: Wed Jun 10, 2009 12:27 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message AIM Address
sauron_le_noir



Joined: 05 Jul 2008
Posts: 229

PostPosted: Thu Jun 11, 2009 8:16 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Dariusc123456



Joined: 12 Aug 2008
Posts: 394

PostPosted: Fri Jun 12, 2009 10:18 am    Post subject: Reply with quote

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

Code:
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:

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

PSP_MODULE_INFO("fw-str", 0, 1, 1);
#define printf pspDebugScreenPrintf
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;
}
int main(int argc, char *argv[]){
     pspDebugScreenInit();
     printf("PSP Current Firmware: %s\n", getVersion(sceKernelDevkitVersion()));
     return 1;
}
Back to top
View user's profile Send private message AIM Address
Dariusc123456



Joined: 12 Aug 2008
Posts: 394

PostPosted: Fri Jun 12, 2009 10:21 am    Post subject: Reply with quote

removed!
Back to top
View user's profile Send private message AIM Address
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Fri Jun 12, 2009 10:52 am    Post subject: Reply with quote

Quote:

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.
Back to top
View user's profile Send private message
Dariusc123456



Joined: 12 Aug 2008
Posts: 394

PostPosted: Sat Jun 13, 2009 12:16 am    Post subject: Reply with quote

Just get the address that has the firmwar version patch to show ether M33, GEM, TDP, or HEN, or whatever it may be.
Back to top
View user's profile Send private message AIM Address
cory1492



Joined: 10 Dec 2004
Posts: 216

PostPosted: Sat Jun 13, 2009 2:33 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
sauron_le_noir



Joined: 05 Jul 2008
Posts: 229

PostPosted: Sun Jun 14, 2009 5:47 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group