PDA

View Full Version : Porting homebrew to 4.xx kernels.



wraggster
June 30th, 2008, 18:41
Alek posted this article:


As we spoke some days ago here, 1.50 kernel would probably disappear. Therefore, we spoke about migrating homebrews to 3.xx kernels, and i linked to this post on ps2dev.

So, what's new when porting to 4.xx kernels instead of 3.xx ones? Following the same guide as CpuWhiz on his post;


1. Homebrew must be in prx format. To do that, after the PSPSDK includes (include $(PSPSDK)/lib/build.mak), add this two lines:

BUILD_PRX = 1
PSP_FW_VERSION = 401

The last line (PSP_FW_VERSION) isn't really needed in this case, just for the compilation when making #ifdef branches or not; but as 4.00/4.01 hasn't included anything relevant on that affairs, you can skip that line.


2. Homebrew must be in user mode. On your main.c code, for the proper pbp compilation,

PSP_MODULE_INFO("module1", 0, 1, 0);

Remember that the PSP_MODULE_INFO system goes like this -> PSP_MODULE_INFO("module_name", mode, mayor_revision, minor_revision), and we put an "0" on mode for user mode; meanwhile 0x1000 would be for kernel mode. And also, add this line;

PSP_HEAP_SIZE_MAX();

Considering that you have a newer PSPSDK that can compile within it.


3. That would be enough for what it takes. Got any problem within running it, once compiled? Re-check latest steps from that ps2dev post to check for your kernel calls.

So, to sum up, due to the poor changes from 3.xx to 4.00/4.01, you just need to keep on the prx format, AND the user mode on the pbp code. Probably some of you already knew this, but bleh, this can't be bad to have in mind, as one user commented on the "Bye Bye, 1.50" post.

http://alek.dark-alex.org/index.php?itemid=158

Sterist
June 30th, 2008, 19:01
is he doing his best not to say "no more kernel mode" or am i mistaken?

Buddy4point0
June 30th, 2008, 19:23
Man, I like the 1.50 kernal.
Getting rid of it is sad but I guess It could leave room for more and better features.

urherenow
June 30th, 2008, 19:25
confused...

if it HAS to be user mode, how do things like CFW upgraders work? What about programs that play with the flash0/flash1?

Sterist
June 30th, 2008, 19:48
confused...

if it HAS to be user mode, how do things like CFW upgraders work? What about programs that play with the flash0/flash1?

^^ --not limited to that, but yeah that´s what i had in mind.

kernel also has a bit of memory to offer, if used properly

but he did say ``in the pbp code´´

ab88
July 1st, 2008, 08:37
confused...

if it HAS to be user mode, how do things like CFW upgraders work? What about programs that play with the flash0/flash1?

You run your main thread in user mode and call a kernel mode prx to do the tasks. As far as I'm aware. Or something along those lines.

blaz3d
July 1st, 2008, 16:21
ab88 is absolutly right although the pbp needs to be user mode it can call on prx's for kernel commands

i said i wasnt going to buy a slim until the last peices of homebrew i use are recompiled

peace