------------------------------------------------------------------------------ Dolphin OS Low Memory ------------------------------------------------------------------------------ In PowerPC architecture lower 256 bytes of main memory are reserved for internal OS use. This map describes all known OS low memory variables. ('Known' mean I'm pretty sure about their meaning). Usually OS accessing low memory as 0x80000000 + offset (cached). 80000000 4 B DiskID : GameName 80000004 2 B DiskID : Company 80000006 1 B DiskID : Disk number 80000007 1 B DiskID : Game version 80000008 1 B DiskID : Streaming 0 = audio streaming off 80000009 1 B DiskID : StreamBufSize 8000000A 20 padding(0) 80000020 4 A Magic word, boot method : 0x0D15EA5E = booted from bootrom 0xE5207C22 = booted from JTAG 80000024 4 A Version (usually set to 1 by apploader) 80000028 4 B Physical memory size (in bytes, 0x1800000 usual) 8000002C 4 B Console type 00000001 = Retail1 00000002 = Retail2 00000003 = Retail3 00000004 = Retail4 1XXXXXXX = Devkits and emulators 10000000 = Mac emulator 10000001 = PC emulator 10000002 = "Arthur" 10000003 = "Minnow" 10000004 = Devkit1 10000005 = Devkit2 10000006 = Devkit3 10000007 = Devkit4 80000030 4 O ArenaLo 80000034 4 O ArenaHi 80000038 4 FST Location in main memory 8000003C 4 FST Max Length 80000040 4 A Debug present flag. 80000044 4 A Exception mask (to debug) 80000048 4 A Exception hook destination 8000004C 4 A Return from exception address (to return from hook) 80000050 16 padding (0) 80000060 ... Debug exception hook. Unused space padded by zeroes. Typical code : { // Save return address LoMem->db.exceptionReturn = mflr(); // Set link register mtlr(OSPhysicalToCached(LoMem->db.ExceptionDestination)); // Enable translation mtmsr(MSR_IR | MSR_DR); } 800000C0 4 O Current OS context (physical address) 800000C4 4 O Previous OS interrupt mask 800000C8 4 O OS interrupt mask 800000CC 4 TV Mode 0 = NTSC 1 = PAL 2 = DEBUG 3 = DEBUG PAL 4 = MPAL 5 = PAL60 800000D0 4 B ARAM size (internal + expansion) in bytes (set in IPL's ARInit call) 800000D4 4 O Current OS context 800000D8 4 O Default OS thread 800000DC 8 O Active threads queue +0 pointer to head thread +4 pointer to tail thread 800000E4 4 O Current OS thread 800000E8 4 A Debug monitor size (in bytes) 800000EC 4 A Debug monitor location (usually at the top of main memory) 800000F0 4 A Console simulated memory size (usually same as physical memory size) 800000F4 4 A DVD BI2 location in main memory (size of BI2 is 0x2000 bytes) 800000F8 4 Bus clock fixed value (162000000 hz) 800000FC 4 Core clock fixed value (486000000 hz) Additionally Dolphin OS is using 0x80003000..0x800030FF area, as second part of OS globals (not completed, but YAGCD has more). 80003000 . . . 800030D4 4 A DOL size (total size of text/data sections), in bytes If FST on DVD is placed after DOL, then BB2 FSTLength is added to this value. 800030D8 8 B OS system time (set, when console is powered up) . . . 800030FC Variables, which are marked as B are changed by bootrom or IPL. Variables, which are marked as A are changed lately in apploader, when game is booting. Variables, which are marked as O, are changed after OSInit call. Remember, that IPL also have hard-linked Dolphin OS inside, so those variables, which are marked as O, are also changed in IPL. ------------------------------------------------------------------------------ org 10 Mar 2005