mirror of
https://github.com/MintCN/linux-insides-zh.git
synced 2026-02-14 07:46:08 +08:00
Update Booting/linux-bootstrap-2md.md
This commit is contained in:
@@ -353,9 +353,10 @@ ENDPROC(memset)
|
||||
//heap_end = heap_end_ptr + 512
|
||||
heap_end = (char *)((size_t)boot_params.hdr.heap_end_ptr + 0x200);
|
||||
```
|
||||
which means `heap_end_ptr` or `_end` + `512`(`0x200h`). The last check is whether `heap_end` is greater than `stack_end`. If it is then `stack_end` is assigned to `heap_end` to make them equal.
|
||||
|
||||
Now the heap is initialized and we can use it using the `GET_HEAP` method. We will see how it is used, how to use it and how the it is implemented in the next posts.
|
||||
接下来代码判断`heap_end`是否大于`stack_end`,如果条件成立,将`stack_end`设置成`heap_end`(这么做是因为在大部分系统中全局堆和堆栈是相邻的)。
|
||||
|
||||
到这里位置,全局堆就被正确初始化了。在全局堆被初始化之后,我们就可以使用`GET_HEAP`方法。至于这个函数的实现和使用,我们将在后续的章节中看到。
|
||||
|
||||
CPU validation
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user