keeping an app in RAM?

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

keeping an app in RAM?

Post by JorDy »

can someone explain to me (or help me) how i can keep my programme "alive" in RAM. Im guessing it involes modifying your BIOS so you can call your function constantly. Does PS2Link stay "alive" in RAM or does it have aother method so you can capture output from your elfs?

Thanks in advance
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

Uh.. what?
Shoot Pixels Not People!
Makeshift Development
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

Um im not very good at explaining things, I want my appliction to stay alive in RAM and not be over written when i load another elf. For example
http://forums.ps2dev.org/viewtopic.php?t=5436
Moonlight modifies the bootstrap so his patching function is called all the time so it is not overwritten.
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

are you asking about ps2 or psp? here is the ps2 forum.
for ps2 you need to load yourself in a lower adress (which is not normally used) and load the app you want as a thread.
for psp you need prx
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

no as a ps2 i was using the psp one as an example where here modified the boot. i want to go as high as i can what is the best area to use? and how do i load it as a thread? do you mean use loadmodule not loadexec
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

PS2 and PSP are not even remotely the same when it comes to this.
If you look at the toolchain you'll see that by default homebrew programs are loaded at a specific address, just below that is a small piece of ram where ps2link lives, and between that and kernel memory is a tiny bit of space where loaders launch a loader core so they can safely load other programs into memory.

You can find the memory addresses, how to load there, and how to load a program as a thread all in ps2link. If you can't figure it out from there, then no offense but what you want to do is probably well above your head.

Keep in mind that the only reason ps2link can survive how it does is because of a other programs letting it. Once another program is launched you have no choice but to sit back and hope it doesn't use the memory you are in, and you have no guarentee it'll give up control and let your program do anything anymore.
Shoot Pixels Not People!
Makeshift Development
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

yeah ive noticed that programs like hdloader kill ps2link so it must be over written. I know how to change were my games are loaded that is fine its just getting the right address. Do programs like cheat devices survive by loading in unused memory?
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

We don't deal with hacking official games here.
Shoot Pixels Not People!
Makeshift Development
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

im not hacking official games i was wondering if that is how cheat devices are able to run throught a game
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

Really couldn't tell ya, and I doubt you'll get much of a response about it here.
Shoot Pixels Not People!
Makeshift Development
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

ok thanks for the help anyway
misfire
Posts: 110
Joined: Mon Sep 06, 2004 7:53 am
Location: Germany

Post by misfire »

JorDy wrote:yeah ive noticed that programs like hdloader kill ps2link so it must be over written. I know how to change were my games are loaded that is fine its just getting the right address. Do programs like cheat devices survive by loading in unused memory?
Yes. This is how cheat devices work. They are loaded in unused memory space (0x80000, for instance) and hook some syscalls to "keep alive."
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

but does the game not clear all memory apart from kernel used memory, this is the problem i have with one or two of my homebrew apps which kill my process by overwritting it
misfire
Posts: 110
Joined: Mon Sep 06, 2004 7:53 am
Location: Germany

Post by misfire »

Nope. Calling LoadExecPS2() only wipes the user memory (0x00100000 - 0x02000000).

The kernel is located below 0x80000, so load your program at 0x80000/0xA0000/0xC0000/etc., and it will stay there.
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

i see i never realsied it only wiped that range i always thought it was higher. thankyou
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Of course LOADEE (which is loaded by LoadExecPS2 to start your new app) will be loaded into some part of user memory, probably 0x80000 but don't remember that for a fact so 0x80000 -> 0x90000 is probably out. Of course just cause your memory survives doesn't mean that your code will still work without effort at least if you are utilising SIFRPC stuff as EELOAD will reset the IOP and remove any IOP sides of your handlers. It will also remove threads, dmac and interrupts handlers if I remember rightly so you need to do something clever to find a way of getting your code restarted ;)

All depends what you actually want to achieve I guess.
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

I had searched the forums of LoadExec and i came across all the info you just told me and a little about loadEE thats were i became stumped on the survival after everythign has been reset. well im working on it with help from misfire
misfire
Posts: 110
Joined: Mon Sep 06, 2004 7:53 am
Location: Germany

Post by misfire »

I don't know where EELOAD resides, but the CodeBreaker cheat device places its cheat engine at 0x80000.

On my console I can use 0x80000 - 0x81DC0 without any problems. The memory space above seems to be used by the runtime core of my DMS3 modchip/EELOAD/or whatever.
Post Reply