实验一:系统软件启动过程-5

简介: 实验一:系统软件启动过程-5

附录B“启动后第一条执行的指令”

附录B“启动后第一条执行的指令”

intel 资料的说明

【参考 IA-32 Intel Architecture Software Developer’s Manual Volume 3: System Programming Guide Section 9.1.4】

9.1.4 First Instruction Executed

The first instruction that is fetched and executed following a hardware reset is located at physical address FFFFFFF0H. This address is 16 bytes below the processor’s uppermost physical address. The EPROM containing the softwareinitialization code must be located at this address.

The address FFFFFFF0H is beyond the 1-MByte addressable range of the processor while in real-address mode. The processor is initialized to this starting address as follows. 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).

The first time the CS register is loaded with a new value after a hardware reset, the processor will follow the normal rule for address translation in real-address mode (that is, [CS base address = CS segment selector * 16]). To insure that the base address in the CS register remains unchanged until the EPROM based softwareinitialization code is completed, the code must not contain a far jump or far call or allow an interrupt to occur (which would cause the CS selector value to be changed).

单步调试和查看 BIOS 代码

如果你是想看 BIOS 的汇编,可试试如下方法: 练习 2 可以单步跟踪,方法如下:

1 修改 lab1/tools/gdbinit,

set architecture i8086
target remote :1234

2 在 lab1 目录下,执行

make debug

这时 gdb 停在 BIOS 的第一条指令处:

0xffff0: ljmp $0xf000,$0xe05b

3 在看到 gdb 的调试界面(gdb)后,执行如下命令,就可以看到 BIOS 在执行了

si
si
...

4 此时的CS=0xf000, EIP=0xfff0,如果想看 BIOS 的代码

x /2i 0xffff0

应该可以看到

0xffff0: ljmp $0xf000,$0xe05b
0xffff5: xor %dh,0x322f

进一步可以执行

x /10i 0xfe05b

可以看到后续的 BIOS 代码。


目录
相关文章
|
数据处理 芯片
实验一:系统软件启动过程-4
实验一:系统软件启动过程-4
251 0
|
NoSQL 小程序 编译器
实验一:系统软件启动过程-2
实验一:系统软件启动过程-2
165 0
|
存储 IDE 安全
实验一:系统软件启动过程-3
实验一:系统软件启动过程-3
304 0
|
弹性计算 数据安全/隐私保护
实验一:系统软件启动过程-1
实验一:系统软件启动过程-1
87 0
实验一:系统软件启动过程-1
|
8月前
|
存储 Linux 芯片
【启动】芯片启动过程全解析
【启动】芯片启动过程全解析
183 0
|
Web App开发 运维 Shell
Linux运维面试题:请简要说明Linux系统在目标板上的启动过程?
Linux运维面试题:请简要说明Linux系统在目标板上的启动过程? 该问题是Linux运维面试最常见的问题之一,问题答案如下: 1.用户打开PC的电源,BIOS开机自检,按BIOS中设置的启动设备(通常是硬盘)启动; 2.
1553 0
|
9月前
|
存储 Linux Windows
【操作系统】实验十 设备驱动程序设计
【操作系统】实验十 设备驱动程序设计
218 0
WinCE系统启动时自动运行应用程序之二
Windows CE 4.2平台下创建工程SMDK2440(目录为C:/WINCE420/PUBLIC/SMDK2440)且Build(或者Rebuild)成功;假定需要自动运行的的应用程序为CEDEMO.exe
|
9月前
|
运维 Linux Shell
day02-Linux运维-系统介绍与环境搭建_硬件 系统核心 解释器shell 外围操作系统
day02-Linux运维-系统介绍与环境搭建_硬件 系统核心 解释器shell 外围操作系统

热门文章

最新文章