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 

Question about RAM?

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



Joined: 23 Jul 2007
Posts: 87
Location: wilmington, NC

PostPosted: Tue Jan 29, 2008 2:35 pm    Post subject: Question about RAM? Reply with quote

im curious to know if its possible for a prx to be coded that would partition a little block of memory on the memory stick to use as a reserve backup in case RAM is all used up, is it possible?

I had asked this because of the issue with the fat psp (32MB) not having enough RAM for some apps, unlike the slim which has plenty of room in its RAM (62MB)
_________________
the questions of today are awnswered by the blood and bullets of tomorrow! ---EagleEye--- (Socom FTB2)
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Tue Jan 29, 2008 5:47 pm    Post subject: Reply with quote

No, without a proper MMU you can't do it in a way that's transparent to applications.
Back to top
View user's profile Send private message
M.Jackson



Joined: 10 Sep 2007
Posts: 85

PostPosted: Wed Jan 30, 2008 3:17 am    Post subject: Reply with quote

Well, theoretically speaking this is still possible but just highly impractical. You can still "map" part of the memory stick into an address space outside the physical RAM. As a result, any attempt to access that range will immediately trigger a bus error which could be caught by a special exception handler in which you can complete the access by transfering data from the memory stick to the target register of the offending instruction (or the other way around). But obviously the drawback of this is that every instruction that tries to access the mapped space will demand one call to the exception handler making it virtually no different from running every of those instructions in a simulator. And if such access is frequent, this could consume significant amount of CPU time dramatically degrading the performance of your code.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Wed Jan 30, 2008 5:16 am    Post subject: Reply with quote

What he wants sounds more like app-level memory management in any case. That is something that is specific to every app. Since apps use memory in different ways, a different handling of low memory would be needed for every app. Simply setting aside a small block of RAM would make no difference to the vast majority of apps as they are now.
Back to top
View user's profile Send private message AIM Address
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Wed Jan 30, 2008 8:22 am    Post subject: Reply with quote

this could be done through handles :

mem_handle_t halloc(int size) : return a handle to a memory block

void hfree(mem_handle_t mh) : free a memory block and invalidate handle

void *haquire/hlock(mem_handle_t mh) : if memory block is already in RAM, return the locked address of the memory block. If not, try to allocate an unlocked memory block of the right size and read from MS after saving the old contents in MS and return the new locked address of the memory block.

void hrelease/hunlock(mem_handle_t mh) : unlock the memory block so it can be swap to MS if necessary. The address is not valid any longer so you need to use haquire/hlock again to get a new valid address.

it reminds me of Win16
Back to top
View user's profile Send private message
jean



Joined: 05 Jan 2008
Posts: 489

PostPosted: Wed Jan 30, 2008 7:30 pm    Post subject: Reply with quote

mmhhhh.....seems like an unsatisfied skype user to me... :)))))
Back to top
View user's profile Send private message
Rangu2057



Joined: 23 Jul 2007
Posts: 87
Location: wilmington, NC

PostPosted: Fri Feb 01, 2008 12:42 pm    Post subject: Reply with quote

thanks for the reply guys as i've had this question on my mind for a long time :) I still wonder why i never asked when the question came to me :/

i am a little pissed about skype only on the slim, but im happy as long as i can play homebrew on my psp :)
_________________
the questions of today are awnswered by the blood and bullets of tomorrow! ---EagleEye--- (Socom FTB2)
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo 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