mirror of
https://github.com/MintCN/linux-insides-zh.git
synced 2026-04-24 18:50:42 +08:00
fix unrecognized image links
This commit is contained in:
BIN
Initialization/images/CONFIG_NR_CPUS.png
Normal file
BIN
Initialization/images/CONFIG_NR_CPUS.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
BIN
Initialization/images/NX.png
Normal file
BIN
Initialization/images/NX.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.1 KiB |
BIN
Initialization/images/brk_area.png
Normal file
BIN
Initialization/images/brk_area.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.5 KiB |
BIN
Initialization/images/kernel_command_line.png
Normal file
BIN
Initialization/images/kernel_command_line.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -94,7 +94,7 @@ noexec [X86]
|
||||
|
||||
我们可以在启动的时候看到:
|
||||
|
||||

|
||||

|
||||
|
||||
之后我们可以看到下面函数的调用:
|
||||
|
||||
@@ -471,7 +471,7 @@ void __init early_alloc_pgt_buf(void)
|
||||
|
||||
我们也可以使用 `readelf` 工具来找到它:
|
||||
|
||||

|
||||

|
||||
|
||||
之后我们用 `_pa` 宏得到了新的 `brk` 区段的物理地址,我们计算页表缓冲区的基地址和结束地址。因为我们之前已经创建好了页面缓冲区,所以现在我们使用 `reserve_brk` 函数为 `brk` 区段保留内存块:
|
||||
|
||||
|
||||
@@ -390,7 +390,7 @@ void __init setup_nr_cpu_ids(void)
|
||||
|
||||
Here `nr_cpu_ids` represents number of CPUs, `NR_CPUS` represents the maximum number of CPUs which we can set in configuration time:
|
||||
|
||||

|
||||

|
||||
|
||||
Actually we need to call this function, because `NR_CPUS` can be greater than actual amount of the CPUs in the your computer. Here we can see that we call `find_last_bit` function and pass two parameters to it:
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ and initializes handler for the `CPU` [hotplug](https://www.kernel.org/doc/Docum
|
||||
|
||||
After this we can see the kernel command line in the initialization output:
|
||||
|
||||

|
||||

|
||||
|
||||
And a couple of functions such as `parse_early_param` and `parse_args` which handles linux kernel command line. You may remember that we already saw the call of the `parse_early_param` function in the sixth [part](/Initialization/linux-initialization-6.md) of the kernel initialization chapter, so why we call it again? Answer is simple: we call this function in the architecture-specific code (`x86_64` in our case), but not all architecture calls this function. And we need to call the second function `parse_args` to parse and handle non-early command line arguments.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user