Linux系统引导过程(BIOS和Bootloader部分)

本文详细介绍了Linux系统引导过程中的BIOS和Bootloader部分。首先,CPU在实模式下从0xfffffff0地址开始执行BIOS,进行POST自检和硬件初始化。然后,BIOS查找并加载引导程序到0x00007c00地址执行,如LILO或GRUB。引导加载程序负责加载内核到内存中,为Linux内核的运行做准备。
摘要由CSDN通过智能技术生成

Linux系统引导过程(BIOS和Bootloader部分)

KEY:x86体系 CPU 系统引导 启动过程 Linux LILO bootstrapping

BIOS(0xfffffff0)

X86体系计算机系统的自举(bootstrapping)过程起始于对CPU的RESET引脚的触发。这个操作会把CPU的一些寄存器置为默认值,比如代码段寄存器CS(code segment)被置为0xf000、指令指针寄存器(EIP)被置为0x0000fff0等,其它寄存器的初始值如下表(下表未列的其它寄存器值均为未定义):

 

32位还是16位?

细心注意开机时有部分寄存器的值是32位的。其实在386以后的32位处理器在实模式下产生的地址也是32位的,只不过16位程序只使用固定的16位兼容的一个地址空间罢了(KEMIN:这个结论有待进一步的验证)。举例如开机第一指令8086上应该是0xffff0,但是在80368却是0xfffffff0。这个地址在保护模式是通过EIP加上 保存在由段选择子指向的段描述符里的[基址 ]得到的,但是在实模式下[段描述 ]符尚没有初始化,那么基地址从哪来的呢?INTEL解释说为了提高访问的速度,每个段寄存器都有隐藏部分用作缓存,看下面:

The CS register has two parts: the visible segment selector part and the hidden base address part. In real-address mode, the base address is normally formed by shifting the 16-bit segment selector value 4 bits to the left to produce a 20-bit base address. However, during a hardware reset, the segment
selector in the CS register is loaded with F000H and the base address is loaded with FFFF0000H. The starting address is thus formed by adding the base address to the value in the EIP register (that is, FFFF0000 + FFF0H = FFFFFFF0H).

Every segment register has a “visible” part and a “hidden” part. (The hidden part is sometimes referred to as a “descriptor cache” or a “shadow register.”) When a segment selector is loaded into the visible part of a segment register, the processor also loads the hidden part of the segment register with the base address, segment limit, and access control information from the segment descriptor pointed to by the segment selector. The information cached in the segment register (visible and hidden) allows the processor to translate addresses without taking extra bus cycles to

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值