Skip to content

Commit

Permalink
MemSpace
Browse files Browse the repository at this point in the history
  • Loading branch information
Liu committed Jun 23, 2024
1 parent 2934aef commit 0c4333a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 8 deletions.
7 changes: 0 additions & 7 deletions docs/SDK/sdks.md

This file was deleted.

38 changes: 38 additions & 0 deletions docs/memspace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Memory Address Space 内存地址空间

PSP 1000 的物理内存为 32MB. PSP 2000/3000 的物理内存为 64MB。

32MB 即 2^25B,物理内存地址范围为 0x00000000~0x02000000.

# 虚拟地址空间

| 虚拟地址 | 用途 |
| ----------------------------------- | -------------------------- |
| 0x00000000~0x40000000(2^30B=1024MB) | 用户态可访问内存(缓存) |
| 0x40000000~0x80000000 | 用户态可访问内存(未缓存) |
| 0x80000000~0xA0000000(2^29B=512MB) | 内核态可访问内存(缓存) |
| 0xA0000000~0xC0000000 | 内核态可访问内存(未缓存) |

# 虚拟内存如何映射到物理内存?

## 通过下面的地址访问物理内存时会经过缓存

| VM Start | VM End | Size | Segement | PM Start | PM End |
| ---------- | ---------- | ---- | ------------------------------- | ---------- | ---------- |
| 0x88000000 | 0x887fffff | 8MB | 内核态(缓存) | 0x00000000 | 0x007fffff |
| 0x08800000 | 0x09ffffff | 24MB | 用户态(缓存) | 0x00800000 | 0x01ffffff |
| 0x0a00000 | 0x0bffffff | 32MB | 用户态(缓存)(PSP2000/PSP3000) | 0x02000000 | 0x04000000 |

## 通过下面的地址访问物理内存时不经过缓存

# 虚拟内存如何映射到其他物理设备?

| VM Start | VM End | Size | Segement | Description |
| ---------- | ---------- | ---- | ---------------- | ------------------------------------------ |
| 0x00010000 | 0x00013fff | | 用户态(缓存) | 操作按钮 |
| 0x04000000 | 0x041fffff | 2MB | 用户态(缓存) | 显存/帧缓冲区 |
| 0xbfc00000 | 0xbfcfffff | 1MB | 内核态(未缓存) | 内存中的硬件异常表(Exception Vector Table) |

# 游戏的默认加载地址

0x08804000,属于用户态缓存区域。
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ nav:
- Font: 'libs\font.md'
- VFPU: ''
- Media Engine: 'mediaengine.md'
- Module Load: 'moudleload.md'
- CMake: 'cmake.md'
- Debug: 'debug.md'
- Release: 'release.md'
- CI / CD: 'githubactions.md'
- Reverse Engineering:
- Disasm: 'assembly.md'
- Memory Space: 'moudleload.md'
- Memory Space: 'memspace.md'
- Patch:
- 'patch.md'
- 'patchexe.md'
Expand Down

0 comments on commit 0c4333a

Please sign in to comment.