PS3 Memory Map

Investigation into how Linux on the PS3 might lead to homebrew development.

Moderators: cheriff, emoon

Post Reply
User avatar
StrontiumDog
Posts: 55
Joined: Wed Jun 01, 2005 1:41 pm
Location: Somewhere in the South Pacific

PS3 Memory Map

Post by StrontiumDog »

Hi,

Has anyone got any information about the PS3 memory map, or any links they can point to?

More precisely, does anyone have any idea what:

#define GPU_IOIF (0x0d000000UL)

could be defining? It seems to be an address, but an address of what?

And yes I know its an address in the GPU, but I am trying to reconcile that with some other information.

Strontium Dog
User avatar
StrontiumDog
Posts: 55
Joined: Wed Jun 01, 2005 1:41 pm
Location: Somewhere in the South Pacific

Post by StrontiumDog »

The Memory mao of the PS3 under linux is weird.

Reference: http://forums.ps2dev.org/viewtopic.php?t=7172

Fact: Linux only uses the 256MB XDRAM directly and currently the only memory in the 256MB GDDR that gets used is the hidden "physical" frame buffer that is blitted into from the virtual frame buffer in XDRAM. Yes thats a hardware blit. So much for no acceleration :)

Fact: Linux consumes 18MB of the 256MB for the virtual Frame Buffer (7% of the available ram).

Fact: Linux can only see 0xE0000000 = 234881024 bytes = 224MB. So the top 16MB seems to be reserved by the Hypervisor. Reasonable enough.

Fact: I have this weird pointer called GPU_IOIF that is hard coded to be exactly 16MB below the top of available Ram. Coincidence, I think not.

Fact: Linux only reports it has Total memory = 200888kB ???

Where does all the other ram go? Not making much sense to me at the moment.

I feel I am missing something here, because it isn't adding up.

Strontium Dog
ldesnogu
Posts: 94
Joined: Sat Apr 17, 2004 10:37 pm

Post by ldesnogu »

StrontiumDog wrote:Fact: Linux can only see 0xE0000000 = 234881024 bytes = 224MB. So the top 16MB seems to be reserved by the Hypervisor. Reasonable enough.

That should read 32 MB I guess.
Fact: Linux only reports it has Total memory = 200888kB ???

Where does all the other ram go? Not making much sense to me at the moment.
Don't forget the kernel size itself plus the RAM it uses for its internal needs.

More about this here.
User avatar
StrontiumDog
Posts: 55
Joined: Wed Jun 01, 2005 1:41 pm
Location: Somewhere in the South Pacific

Post by StrontiumDog »

ldesnogu wrote:
StrontiumDog wrote:Fact: Linux can only see 0xE0000000 = 234881024 bytes = 224MB. So the top 16MB seems to be reserved by the Hypervisor. Reasonable enough.

That should read 32 MB I guess.
Ahhh, yeah. Oops.
Fact: Linux only reports it has Total memory = 200888kB ???
Where does all the other ram go? Not making much sense to me at the moment.
Don't forget the kernel size itself plus the RAM it uses for its internal needs.

More about this here.
Thanks. So the kernel is consuming 29,171,712 bytes of memory by my calculation.

Strontium Dog
zoltan
Posts: 1
Joined: Tue Mar 13, 2007 7:03 am

Post by zoltan »

Frame buffer memory size can be changed when compiling kernel. By default you have a 2x9M framebuffer (2 frames)

linux-2.6.18
PS3FB_NUM_FRAMES_MAX (default=2 -> 18M)

linux-2.6.21 (.config)
CONFIG_FB_PS3_DEFAULT_SIZE_M (default=18M)

Zoltan
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

StrontiumDog wrote:Fact: Linux can only see 0xE0000000 = 234881024 bytes = 224MB.
You mean 0x0E000000 bytes.
#define GPU_IOIF (0x0d000000UL)
IOIF0 and IOIF1 are the two I/O interfaces on the CBE. From the code (ps3fb.c:xdr_settings) that's definitely involved with some io mapping.
I would guess that it's telling the GPU to map xdr_lpar (= the physical address of the kernel's framebuffers) into the GPU's address space at 0x0d000000.

Basically it looks to me like: allocate a framebuffer in kernel (videomemory), find the physical address of that (xdr_lpar), tell the GPU to map that at GPU_IOIF (lv1_gpu_context_iomap), then use that mapped address when asking the GPU to blit.
Post Reply