Change partition attribute ?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Change partition attribute ?

Post by Cpasjuste »

Hello, i would like to know if there is a way to change the attribute of a partition ?
I would like to change the slim partition 8 (currently with kernel attr it seems, 000C) to user attribute (000F).

I think moonlight already did this sort of thing in the past when the slim comes out, but i can't find any help from what i see in the sdk includes.

Any help would be greatly appreciated :)
sauron_le_noir
Posts: 203
Joined: Sat Jul 05, 2008 8:03 am

Post by sauron_le_noir »

From a blog:
artition 8: (new in the psp slim!)

topaddr = 0x8A000000, size = 0x1C00000 (28 MB), attr = 0x0C

Partition 10: (new in psp slim!)

topaddr = 0x8BC00000, size = 0x400000 (4 MB), attr = 0x0C

So it seems at first the new partitions are for kernel mode use, but i guess they can be unlocked for user mode use with the SetDdrMemoryProtection function :)
===================================================================

from moonlight
Techincal stuff, the memory protection of te extra slim memory is in these hardware registers: 0xbc000040-0xbc00007F.

Set all to 0xFF, and you have access to it in user mode (note: sceKernelSetDdrMemoryProtection wouldn't do it)., but anyways is done automatically by m33 when launching homebrew, so no need to care about that.
===============================================================
and from 3.71M33 sdk
it seems Moonlight has incorporated the addition 32 MBytes to Malloc() when using his SDK for M33-3 (Looking at sample memory test).
===================================================================
hope that this help you
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Hi sauron, thanks for the reply.

I think that setting this registers to 0xFF "just" allow access to this partition from user mode, what is done by the m33 firmware u think, but do not change the attribute.

What i want to do is load an user mode module to this partition, but it's currently impossible due to the fact that it has the kernel mode attributes.

Using the sceKernelSetDdrMemoryProtection function won't work too.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

I don't think its possible to load a kernel module to user memory.

Also, if its even possible, while changing the partition to kernel, it should ideally be one contiguous block like what is done with the remaining 32MB in user mode. But it would have the 24MB user memory sandwiched between the first kernel partition.
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Torch wrote:I don't think its possible to load a kernel module to user memory.

Also, if its even possible, while changing the partition to kernel, it should ideally be one contiguous block like what is done with the remaining 32MB in user mode. But it would have the 24MB user memory sandwiched between the first kernel partition.
I don't whant to change the slim partition to kernel attr, it's already the case.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

Cpasjuste wrote: I don't whant to change the slim partition to kernel attr, it's already the case.
Sorry I mixed up kernel and user in my entire post.

What are you trying to achieve by loading the module into that particular partition? No matter where its loaded, you can still allocate memory for operation from the entire user memory (including extra memory) while in homebrew mode, and even in VSH mode.
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

I dont want to use the user memory at all :)
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

Cpasjuste wrote:I dont want to use the user memory at all :)
Then that automatically excludes anything that runs during the XMB because Sony code already makes it into user memory.

That only leaves Game mode homebrew. You'd have to disable the M33 patches in systemctrl.prx which converts the UMD Cache into user memory.
I believe it only does this if it finds the LARGE_MEMORY tag in the EBOOT.PBP.

Even if its already flagged as kernel mode, its highly unlikely that the sceKernelLoad functions will allow loading into that partition. In fact in game mode (after disabling M33 patch which in turn disables UMD Cache module first) I don't think its even partitioned, but must be addressed as raw memory.
Post Reply