mirror of
https://github.com/MintCN/linux-insides-zh.git
synced 2026-04-25 03:01:26 +08:00
Update Booting/linux-bootstrap-2.md
This commit is contained in:
@@ -379,10 +379,10 @@ if (cpu_level < req_level) {
|
||||
|
||||
除此之外,`check_cpu`方法还做了大量的其他检测和设置工作,下面就简单介绍一些:1)检查cpu标志,如果cpu是64位cpu,那么就设置[long mode](http://en.wikipedia.org/wiki/Long_mode), 2) 检查CPU的制造商,根据制造商的不同,设置不同的CPU选项。比如对于AMD出厂的cpu,如果不支持SSE+SSE2,那么就禁止这些选项。
|
||||
|
||||
内存侦测
|
||||
内存分布侦测
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
接下来,内核调用`detect_memory`方法进行内存侦测,以得到系统当前内存的使用分布。该方法使用多种编程接口,包括`0xe820`(获取全部内存分配),`0xe801`和`0x88`(获取临近内存大小),进行内存侦测。在这里我们只介绍[arch/x86/boot/memory.c](https://github.com/torvalds/linux/blob/master/arch/x86/boot/memory.c)中提供的`detect_memory_e820`方法。
|
||||
接下来,内核调用`detect_memory`方法进行内存侦测,以得到系统当前内存的使用分布。该方法使用多种编程接口,包括`0xe820`(获取全部内存分配),`0xe801`和`0x88`(获取临近内存大小),进行内存分布侦测。在这里我们只介绍[arch/x86/boot/memory.c](https://github.com/torvalds/linux/blob/master/arch/x86/boot/memory.c)中提供的`detect_memory_e820`方法。
|
||||
|
||||
该方法首先调用`initregs`方法初始化`biosregs`数据结构,然后向该数据结构填入`0xe820`编程接口所要求的参数:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user