当PC首次启动时,它开始在物理地址0xffff0处执行.该地址包含对BIOS的jmp指令.
现在我的问题是,我总是假设物理地址映射到RAM.如果RAM最初包含垃圾值,那么将jmp指令准确地放在0xffff0中是什么?对于不同的BIOS,jmp指令总是相同还是不同?0xffff0是否从RAM映射到BIOS然后(意味着它是"硬映射")?
查看此英特尔手册:
转到第9-6页和后续页面,它们都描述了CPU的初始启动模式.获取的第一条指令来自ffffff00(硬连线到ROM BIOS):
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 software-
initialization code must be located at this address.
Run Code Online (Sandbox Code Playgroud)
并记住在这个阶段它仍然是现实的:
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).
Run Code Online (Sandbox Code Playgroud)
然后再看一下,在图9-3中,是64K内存的位置 - 从ffffffff到ffff0000,并表示有EPROM或系统BIOS,因此不是RAM.
见图8.4:http://www.iakovlev.org/index.html? p = 946