4  Memory Map

index

4.1  Overview

startendsizedescription
0x000000000x017fffff24MBPhysical address of the RAM
0x800000000x817fffff24MBLogical address of the RAM, cached
0xC00000000xC17fffff24MBLogical address of the RAM, not cached
0xc8000000 2MBEmbedded Framebuffer (EFB)
0xCC000000  Hardware registers
0xCC000000  CP - Command Processor
0xCC001000  PE - Pixel Engine
0xCC002000  VI - Video Interface
0xCC003000  PI - Processor Interface (Interrupt Interface)
0xCC004000  MI - Memory Interface
0xCC005000  AI - Audio Interface
0xCC006000  DI - DVD Interface
0xCC006400  SI - Serial Interface
0xCC006800  EXI - External Interface
0xCC006C00  Streaming Interface
0xCC008000  GX FIFO (Graphic display lists)
0xe00000000xe0003fff16kL2 Cache
0xfff00000 1MBIPL (mapped here at bootup)
index

4.2  RAM usage

index

4.2.1  Dolphin-OS globals

4.2.1.1   Boot Info  

    4.2.1.1.1  DVD Disc ID  
startsizedescription
0x800000000x04Gamecode
0x800000040x02Company
0x800000060x01Disk ID
0x800000070x01Version
0x800000080x01Streaming
  
0audio streaming off
1audio streaming on
0x800000090x01StreamBufSize
0x8000000a0x0fpadding zeros



    4.2.1.1.2  system Info  
startsizedescription
0x8000001c DVD magic word
  
 0xc2339f3d
0x800000204Magic word (how did the console boot?)
  
valuedescription
0x0D15EA5Enormal boot
0xE5207C22booted from jtag
0x800000244Version
0x800000284Memory Size
  
0x0180000024MB on retail console
0x8000002C4Console type
  
valueDescription
0x00000001Retail1
0x00000002HW2 production board
0x00000003The latest production board
0x00000004Reserved
0x1XXXXXXXDevkits
0x10000000MAC emulator
0x10000001PC Emulator
0x10000002'Arthur'
0x10000003'Minnow'
0x100000041st Devkit HW
0x100000052nd Devkit HW
0x10000006latest Devkit HW
0x10000007Reserved
0x2XXXXXXXTDEV-kits
0x20000005HW2 TDEV system
0x20000006The latest TDEV system
0x20000007Reserved
0x800000304ArenaLo (==0x00000000)
   
0x800000344ArenaHi (==0x817fe8c0)
   
0x800000384FST Location in ram (==0x817fe8c0)
   
0x8000003C4FST Max Length (==0x00000024)
   


4.2.1.2   Debugger info (?)  
startsizedescription
0x800000404flag for "debugger present" (used by __OSIsDebuggerPresent)
0x80000044 Debugger trap Bitmap ? set to 0 at sdk lib start
0x80000048 Address of the Routine to call instead of the patched one ? (==0x014268d0)
0x8000004c Temp for LR, Routine where we came from ?
0x8000005016padding zeros

4.2.1.3   Debugger Hook (?)  
This small Routine apparently uses the above info to (probably) replace certain functions for debugging purposes (hook a debugger, add sanity checks ...)
.>80000060  38 a0 00 40  li r5,0x40
r5=0x40
.>80000064  7c 68 02 a6  mflr r3
r3=lr
.>80000068  90 65 00 0c  stw r3,0x0c(r5)
.>8000006c  80 65 00 08  lwz r3,0x08(r5)
.>80000070  64 63 80 00  oris r3,r3,0x8000
.>80000074  7c 68 03 a6  mtlr r3
lr=r3
.>80000078  38 60 00 30  li r3,0x30
.>8000007c  7c 60 01 24  mtmsr r3
msr=0x30
.>80000080  4e 80 00 20  blr
jump (lr)
 
4.2.1.4   Dolphin OS Globals  
 
startendsizedescription
0x800000840x800000bf padding zeros
0x800000c0 4Current OS context (physical address)
0x800000C4 4Previous OS interrupt mask
0x800000C8 4current OS interrupt mask
0x800000CC  TV Mode
   
valuedescription
0ntsc
1pal
2debug
3debug pal
4mpal
5pal 60
0x800000d0  ARAM size (internal+expansion) in bytes. set by ARAM driver, usually 16mb.
0x800000D4  current OS Context (logical address)
0x800000D8  default OS thread (logical address)
0x800000Dc  active Thread queue, head thread (==0x8146afd0)
0x800000e0  active Thread queue, tail thread (=0x8146afd0) ptr to table of ptrs
0x800000e4  used by init_proc at startup
   if ((*800000e4)&0xeef == 0xeef) do OSResetSystem(0,0,0), jump to address passed to init_proc. also used from within irq?
0x800000e6  used by __start (debugger check ?)
0x800000e8  tested at startup (debugger check?)
   ==2 o. ==3 -> ? ; ==4 -> __set_debug_bba
0x800000ec  tmbinc: memory top ? (==0x81800000)
    
0x800000F0  Simulated Memory Size (==0x01800000)
    
0x800000F4  Pad Spec (?) (==0x817fc8c0)
   used for SN-debugger check at startup; if != 0 => pointer to debugger control block
   
-> struct debugger control block
offsetsizeDescription
0x00 pointer
0x0c debugger type
0x24 pointer
<- struct debugger control block
0x800000F8  Bus Clock Speed
   162 MHz (=0x09a7ec80, 162000000)
0x800000FC  CPU Clock Speed
   486 MHz (=0x1cf7c580, 486000000)
index

4.2.2  Exception Handlers

startendsizedescription
0x80000100  System Reset Interrupt
0x80000200  Machine Check Interrupt
0x80000300  DSI Interrupt
0x80000400  ISI Interrupt
0x80000500  External Interrupt
0x80000600  Alignment Interrupt
0x80000700  Program Interrupt
0x80000800  FP unavailable Interrupt
0x80000900  Decrementer Interrupt
0x80000C00  System Call Interrupt
0x80000d00  Trace Interrupt
0x80000f00  Performance Monitor Interrupt
0x80001300  IABR Interrupt
0x80001400  reserved
0x80001700  Thermal Interrupt
0x800018000x80002fff unused/reserved (*)
(*) note: psoload v2 uses this area to stay resident in memory, it is unused by Dolphin-OS
index

4.2.3  Dolphin-OS globals

startendsizeDescription
0x80003000  exception handler vectors (from sdk libs & ipl)
    
0x80003040  interrupt handler vectors (from sdk libs & ipl)
    
0x800030c8 4First Module Header Pointer in Module Queue
0x800030cc 4Last Module Header Pointer in Module Queue
0x800030d0 4Module String Table Pointer
0x800030d8 4System Time
0x800030E0  ?
   tmbinc: 6=production pads
0x800030e6  ?
   pointer
0x800030e8 1?
   set by OsInit() (debugger stuff?)
0x800030e9 1 
   set by OsInit() (debugger stuff?)
0x800030F2 1Boot status
   
valuedescription
0first boot
1already booted
index

4.2.4  User Memory

4.2.4.1   user program area  
startendsizedescription
0x80003100  Start of code (usually)
0x80003140  Entry point (early SDK v1.0 applications)
0x81200000  Load Address of the Apploader


note: of course the entrypoint of an application can be anything, those listed here are just some typical examples.
4.2.4.2   stack area  
startendsizedescription
  Bottom of Stack
   Top of Stack
4.2.4.3   heap area  
startendsizedescription
?   ArenaLo - Bottom of Heap
0x817fe8c0  ArenaHi - Top of Heap


note: the address of ArenaHi is not a constant, but should be set to the bottom of the FST which is read from the DVD so its size depends on the application. the value given here is just an example.
4.2.4.4   'high memory'  
startendsizedescription
0x817fe8c0 24FST (used by Dolphin-OS)
0x817fffff  Memory Top
index