View Full Version : 3.02 OE Kernel Homebrew
codes02
01-01-2007, 08:08 PM
Does anyone have any idea on what must be modified in sources/makefiles to allow a homebrew app/game to run in the 3.02 kernel of 3.02 OE?
Do we need to split the app into user elf/prx and kernel prx like in 2.71 SE-C/ Hen-D?
Or do that plus other changes?
FreePlay
01-03-2007, 02:40 AM
No idea. I tried using the kmode exploit for 2.80 under POPS mode (to ensure that I could actually get code to run in the first place), but no dice.
codes02
01-03-2007, 10:53 PM
well evidently at least normal home brew in the 3.02 kernel of OE is possible as those VNC, pmp, atrac3plus, and pmf progs were just released for the 3.02 kernel of OE.
the only change i have seen so far is adding the -DPSPFW302 flag under CFLAGS.
FreePlay
01-04-2007, 02:51 AM
Hmm. Guess I need to update my toolchain.
-----
Bah, no I don't. I used Ahman's example and I've got stuff running :) Excellent tip.
*eyelash
01-04-2007, 05:44 AM
hi guys, i dont understand...
look this main.c:
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspctrl.h>
#include <stdlib.h>
#include <string.h>
PSP_MODULE_INFO("PSPHelloWorld", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(0);
// TWILIGHT ZONE! <do doo do doo>
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
// END OF TWILIGHT ZONE!
int main(void)
{
SetupCallbacks();
pspDebugScreenInit();
sceCtrlSetSamplingCycle(0);
sceCtrlSetSamplingMode(PSP_CTRL_MODE_DIGITAL);
pspDebugScreenPrintf("PSP Hello World\n");
pspDebugScreenPrintf("Homebrew with 3.02 OE Kernel\n");
do {
sceDisplayWaitVblankStart();
} while (1);
return 0;
}
and this make:
TARGET = psphelloworld
OBJS = main.o
INCDIR = C:\pspdev\include
CFLAGS = -O2 -G0 -Wall -DPSPFW302
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR = C:\pspdev\lib
LIBS =
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = PSP Hello World
PSP_EBOOT_ICON =
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
this compiles OK and make EBOOT. But in the GAME folder using kernel 3.02 OE its dont run... show the icon, but when run.... PAN... corrupt...
thanks! :(
Dark_AleX
01-04-2007, 08:32 AM
The executable to be packed in the pbp, MUST BE an user mode prx inside a pbp, not an elf. Unlike 2.71 SE or 2.71 HEN, static elf's are not supported by OE, because the patch to do the same than in 2.71 SE didn't work. (look at it closer is one of my todo things).
Kernel mode can be accesed by loading a kernel prx. The kernel prx MUST BE compiled with "USE_KERNEL_LIBS = 1", and if you add aditional libraries to it, make sure they are kernel libraries, not user ones.
Here i attach you the nanddumper sample originally made for 2.71 HEN, that still works on 3.0X OE.
Old sdk's couldn't put a prx inside a pbp. And latest ones could but have a bug when putting it. jim/tyranid fixed apparently this bug like a week ago (i didn't check yet if generated pbp are fine), so you may want to update the pspsdk.
Anyways, you can also use the makefile of the nanddumper to force the prx inside the pbp.
SpectroPlasm
01-04-2007, 01:27 PM
Hi Alex :) welcome to the forums!, feel free to browse around, we are very honoured to have you with us, we hope you'll like it :).
*eyelash
01-04-2007, 01:31 PM
Thanks to you Dark_Alex,
test the solution i will (yoda's voice.. hehe)
*eyelash
01-04-2007, 04:07 PM
Alex, i compiled OK, but, i have a question: why makefile generate .elf and .prx of nanddumper and nanddumpermain? is this normal?
thanks!
*eyelash
01-04-2007, 04:27 PM
Thanks Alex! Its works fine! :p
I attached the example ive created!
codes02
01-04-2007, 09:21 PM
Thank you D_A. I thought you might have patched the kernel in a similar way to SE/HEN but wasn't too sure of the limitations.
Hope for new sdk soon. :D
Any how, it would seem then, if the 2.71 nandDumper still works in the 3.02 kernel that the -DPSPFW302 is not nessisary, but then why were their different releases for the vnc, pmf, etc. apps for 2.71 and 3.02 (with that flag seeming to be the only change?
Does anyone know if they utilize some obscure (or perhaps not that obscure) thing that has changed (thus requiring the cflag)?
FreePlay
01-04-2007, 10:52 PM
Is -DPSPFW302 actually something global or is this just a flag to define for use in your own program??
*eyelash
01-04-2007, 11:16 PM
i thing this is a just one flag to use in your homebrew.
codes02
01-05-2007, 01:59 AM
On the sdk, just realized it was released with 3.03 OE-A, thx dax!
Freeplay: this was not used in my programs, it was used in ahman's ports of pmpmod, pmf player, pspvnc, and atrac3plus player to the 3.02 OE kernel.
Thus my questioning it's purpose :-P .
Edit : Sry Freeplay, misread your post. -DPSPFW302 is a CFLAG, from a homebrew's make file
Dark_AleX
01-05-2007, 09:02 AM
The difference between homebrew support of hen/SE and OE are two:
- Static elf's not currently supported.
- Kernel prx's could have user imports in 2.71, but sce restricted that in 2.80 and later, because they are that funny. (well, this should have been done from the beginning, but sce separation between kernel and user mode was never very good).
*eyelash
01-10-2007, 02:15 AM
Dax, thanks to you!
But i have one question, i attached the kernelcalls.prx ive made, this is fine, but when i call the Test, this returns a non sense number -2741....
this is code in user mode prx:
int res = LoadStartModule("kernelcalls.prx");
if (res < 0)
{
printf("Error loading/starting kernelcalls.prx!\n");
}
else
{
printf(" = %d\n",Teste(1,3));
}
Thanks again!
rabbit
01-10-2007, 02:56 AM
Is the function Teste() or Test()?
*eyelash
01-10-2007, 02:57 AM
is Teste()
AhMan
01-11-2007, 04:50 PM
The macro PSPFW302 is only used by me to conditionallly compile the code for firmware 3.0x. The DEVHOOK macro was used for firmware 2.71. Without either macros, it will compile for fw 1.5 The DEVHOOK macro name was not very descriptive, since I was using it at the time where devhook 2.71 first support homebrews.
BTW, if you compile those ports with PSPFW302, it will also work under fw 2.71, but not vice versa. This is 'cos 3.02 OE no longer allows loading encrypted sigcheck modules via sceKernelLoadModule. This can be bypassed via DA supplied kubridge APIs or the ones I used in my samples.
vBulletin® v3.7.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.