Difference between revisions of "Memory Management"

From 3dbrew
Jump to navigation Jump to search
Line 25: Line 25:
  
  
== RegionData ==
+
== RegionDescriptor ==
  
 
Size : 0x10 bytes
 
Size : 0x10 bytes
Line 53: Line 53:
  
  
== FCRAM Region Data ==
+
== FCRAM Region Descriptor ==
  
 
Size : 0x50 bytes
 
Size : 0x50 bytes
Line 64: Line 64:
 
|-
 
|-
 
| 0x0
 
| 0x0
| RegionData
+
| RegionDescriptor
| RegionData for app memory
+
| RegionDescriptor for app memory
 
|-
 
|-
 
| 0x10
 
| 0x10
| RegionData
+
| RegionDescriptor
| RegionData for sys memory
+
| RegionDescriptor for sys memory
 
|-
 
|-
 
| 0x20
 
| 0x20
| RegionData
+
| RegionDescriptor
| RegionData for base memory
+
| RegionDescriptor for base memory
 
|-
 
|-
 
| 0x30
 
| 0x30
 
| u32
 
| u32
| Ptr to start of FCRAM region config
+
| Ptr to start of FCRAM region descriptor
 
|-
 
|-
 
| 0x34
 
| 0x34
Line 89: Line 89:
 
| 0x3C
 
| 0x3C
 
| u32
 
| u32
| Base mem start in FCRAM
+
| Base memory start in FCRAM
 
|-
 
|-
 
| 0x40
 
| 0x40
 
| u32
 
| u32
| Physical FCRAM memory used by the kernel (used by [[SVC|svcGetSystemInfo]])
+
| Count of physical FCRAM used by the kernel, in bytes. (used by [[SVC|svcGetSystemInfo]])
 
|-
 
|-
 
| 0x44
 
| 0x44
Line 106: Line 106:
 
| s16
 
| s16
 
| Error info for thread listed above
 
| Error info for thread listed above
 +
|-
 +
| 0x4E
 +
| u16
 +
| Alignment
 
|}
 
|}
 +
 +
 +
== Kernel Region Descriptor ==

Revision as of 01:00, 4 February 2016

How The Kernel Allocates And Tracks Memory

MemoryBlockHeader

Size : 0xC bytes

Offset Type Description
0x0 u32 Size in pages
0x4 MemoryBlockHeader* Next
0x8 MemoryBlockHeader* Prev


RegionDescriptor

Size : 0x10 bytes

Offset Type Description
0x0 MemoryBlockHeader*
0x4 MemoryBlockHeader*
0x8 u32 Region start
0xC u32 Region size


FCRAM Region Descriptor

Size : 0x50 bytes

Offset Type Description
0x0 RegionDescriptor RegionDescriptor for app memory
0x10 RegionDescriptor RegionDescriptor for sys memory
0x20 RegionDescriptor RegionDescriptor for base memory
0x30 u32 Ptr to start of FCRAM region descriptor
0x34 u32 FCRAM start
0x38 u32 FCRAM size in pages
0x3C u32 Base memory start in FCRAM
0x40 u32 Count of physical FCRAM used by the kernel, in bytes. (used by svcGetSystemInfo)
0x44 u32 ?
0x48 KThread* Thread operating on region data
0x4C s16 Error info for thread listed above
0x4E u16 Alignment


Kernel Region Descriptor