# 地址空间

地址空间(address space)是qemu内存虚拟化的重要组成部分。不过这个模拟起来还真实有点复杂，也涉及到多个在qemu中关键的数据结构。

让我们一点点探索把。

## 从初始化开始

地址空间比较抽象，那我们就从初始化的地方开始吧。

[从初始化开始](/understanding_qemu/00-as/01-initialization.md)

## MemoryRegion

初始化时首先遇到的一个数据结构是MemoryRegion，那就以这个为切入点看看地址空间的模拟方式。

[MemoryRegion](/understanding_qemu/00-as/02-memoryregion.md)

## AddressSpace Part1

初始化时第二个遇到的数据结构就是AddressSpace了。可以说这是整个qemu地址空间模拟的中枢。

也正是因为这个是中枢，所以一次估计讲不完，咱就先讲一节。

[AddressSpace Part1](/understanding_qemu/00-as/03-addressspace1.md)

## FlatView

随着细节的展开，又遇到了一个和AddressSpace相关的数据结构 -- FlatView。

[FlatView](/understanding_qemu/00-as/04-flatview.md)

## RAMBlock

前几个数据结构都是用来描述地址空间的，现在就来看看虚拟的地址空间和真实的内存之间的对应关系 -- RAMBlock。

[RAMBlock](/understanding_qemu/00-as/05-ramblock.md)

## AddressSpace Part2

讲完了FlatView和RAMBlock，这下可以回来补充AddressSpace的内容了。可以看看有了这两者后地址空间的样子。

[AddressSpace Part2](/understanding_qemu/00-as/06-addressspace2.md)

## 眼见为实

是时候亲眼看一看地址空间中这些数据结构的样子了。

[眼见为实](/understanding_qemu/00-as/07-witness.md)

## 添加MemoryRegion

现在我们对重要数据结构已经有了基本的概念，是时候动态得看看添加一个MemoryRegion时都发生了些什么了。

[添加MemoryRegion](/understanding_qemu/00-as/08-commit_mr.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://richardweiyang-2.gitbook.io/understanding_qemu/00-as.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
