Files
linux-insides-zh/Booting/linux-bootstrap-2md.md
2016-01-28 16:58:46 -05:00

21 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 在内核安装代码的第一步
内核启动的第一步
--------------------------------------------------------------------------------
在[上一节中](https://0xax.gitbooks.io/linux-insides/content/Booting/linux-bootstrap-1.html)我们开始接触到内核启动代码,并且分析了初始化部分,最后我们停在了对`main`函数(`main`函数是第一个用C写的函数的调用`main`函数位于[arch/x86/boot/main.c](https://github.com/torvalds/linux/blob/master/arch/x86/boot/main.c)。
在这一节中我们将继续对内核启动过程的研究,我们将
* 认识`保护模式`
* 如何从实模式进入保护模式
* 堆和字符界面初始化
* 内存检测cpu验证键盘初始化
* 还有更多
现在让我们开始我们的旅程
保护模式
--------------------------------------------------------------------------------
在操作系统可以使用Intel 64位CPU的[长模式](http://en.wikipedia.org/wiki/Long_mode)之前内核必须首先将CPU切换到保护模式运行。
什么是[保护模式](https://en.wikipedia.org/wiki/Protected_mode)保护模式于1982年被引入到Intel CPU家族并且从那之后知道Intel 64出现保护模式都是Intel CPU的主要运行模式。