Closed ijacquez closed 5 years ago
Setting LOADHIGH
seems to have fixed the issue. Is there a reason why this needs to be set?
How are you booting ps2link? ps2link likely cannot boot another version of ps2link because that will overwrite ps2link before the loading can complete.
I'm booting it via uLaunchELF. I also have it set to autostart via FMCB.
Is that why other executables weren't working? I didn't see any option to set the start address.
I am a little unsure of what you did.
Were you able to boot the copy of ps2link that you compiled, and hence the executables that failed, were software that you attempted to boot from ps2link? Or was it ps2link itself that would not boot up properly?
If it is the former, then can you specify what software you tried to boot from ps2link?
Yes, I was able to boot the compiled ps2link.elf
. The problem lies in the software I was trying to boot.
Can you try to edit ee/Rules.make to use -lkernel-nopatch instead of -lkernel?
I thought I already reworked ps2link to not execute its applications this way, but it still seems to boot things by starting threads. This could cause problems with the kernel patches we now have.
This requires rebuilding PS2SDK? I'll give it a shot.
Edit: To be clear, this is with LOADHIGH = 0
?
I mean, edit the ee/Rules.make file of ps2link. Sorry for the confusion.
I think the LOADHIGH option should not matter. If the kernel patches were indeed related, then perhaps the LOADHIGH option was just causing the problem to be avoided.
I'll try what you suggested with LOADHIGH = 0
since it works when set to 1.
I get the same error with this being the only change.
diff --git a/ee/Rules.make b/ee/Rules.make
index 37d3dc9..df46af0 100644
--- a/ee/Rules.make
+++ b/ee/Rules.make
@@ -17,7 +17,7 @@ EE_ASFLAGS := -G0 $(EE_ASFLAGS)
# Link with following libraries. This is a special case, and instead of
# allowing the user to override the library order, we always make sure
# libkernel is the last library to be linked.
-EE_LIBS += -lc -lkernel
+EE_LIBS += -lc -lkernel-nopatch
Edit: Here is what I see.
Edit: I only ran one executable then exited. And here, I ran directly from my USB stick.
I see, thanks for the screenshot.
I think there is a problem with the addresses that were selected for the normal version. By setting _stack to 0x00100000 and _stack_size to 0x8000, the stack's top is at 0x00108000, which either allows ps2link to get partially overwritten once that ELF get loaded or it will corrupt the loaded ELF...
You can try changing ps2link/ee/Makefile as shown (on top of getting it to use -lkernel-nopatch), to correct this problem:
# Normal low loading version
...
STACKADDR = 0xf8000
Glad that helped. I can't test until next week, but is this a regression, excluding the kernel patches?
I can verify next week. If all is well, would this be merged in?
If it is an actual problem, it'll be a 15-year old bug.
Please test it when you can. Then it'll be merged in.
Related commit: b99f07a
Thanks, I'll test this out. I will be able to test in 1-2 days.
All is well! Thanks for fixing this.
I had v1.2 pre-built and it worked fine. I decided to build ps2link myself, and for every executable I try to upload, I get CPU exceptions (seems to vary from executable to executable).
The "cause" is 70008010.
PS2LINK.ELF
frommc1
Makefile
options changed)Any suggestions? Anything I could try?