【译】x86程序员手册38-10.2实在址模式下的软件初始化
10.2 Software Initialization for Real-Address Mode
实地址模式的软件初始化
In real-address mode a few structures must be initialized before a program can take advantage of all the features available in this mode.
在实地址模式,程序在能利用这个模式下的的所有可用特性之前,新架构必须被初始化。
10.2.1 Stack 栈
No instructions that use the stack can be used until the stack-segment register (SS) has been loaded. SS must point to an area in RAM.
在栈段寄存器(SS)被装入前,使用栈的指令都不能用。SS必须指向RAM的一块区域。
10.2.2 Interrupt Table 中断表
The initial state of the 80386 leaves interrupts disabled; however, the processor will still attempt to access the interrupt table if an exception or nonmaskable interrupt (NMI) occurs. Initialization software should take one of the following actions:
80386的初始化状态中,中断是关的;然而,如果异常或非屏中断(NMI)发生,处理器仍将试图访问中断表。初始化软件应当采取下列的动作之一:
- Change the limit value in the IDTR to zero. This will cause a shutdown if an exception or nonmaskable interrupt occurs. (Refer to the 80386 Hardware Reference Manual to see how shutdown is signalled externally.)
修改IDTR的限长值为0。这样,当异常或非屏蔽中断的发生时,将关机。(参见80386硬件参考手册,如何使用外部信号关机。)
- Put pointers to valid interrupt handlers in all positions of the interrupt table that might be used by exceptions or interrupts.
在中断表的所有位置都放置一个有效的中断处理程序的指针,用来处理异常或中断。
- Change the IDTR to point to a valid interrupt table.
修改IDTR以指向一个中断表。
10.2.3 First Instructions 第一条指令
After RESET, address lines A{31-20} are automatically asserted for instruction fetches. This fact, together with the initial values of CS:IP, causes instruction execution to begin at physical address FFFFFFF0H. Near (intrasegment) forms of control transfer instructions may be used to pass control to other addresses in the upper 64K bytes of the address space. The first far (intersegment) JMP or CALL instruction causes A{31-20} to drop low, and the 80386 continues executing instructions in the lower one megabyte of physical memory. This automatic assertion of address lines A{31-20} allows systems designers to use a ROM at the high end of the address space to initialize the system.
在REST之后,地址线A{31-20}被自动使用(asserted,一般而言assert都是查看位是否为1,所以这里应该是指高12位自动变成1。)来取指令。这个事实,与CS:IP的初始化值一起,导致指令执行在物理地址FFFFFFF0H处(译注:CS此时是0,而IP为FFF0H)。近(段内)控制转移指令可以用来传递控制到地址空间的高端64K中的另一个地址。第一条远(段间)JMP或CALL指令会导致线性地址A{31-20}丢掉低端,80386继续执行指令在低端1M的物理内存中。这种地址线自动验证A{31-20}就允许系统设计者使用位于地址空间高端的部分ROM来初始化系统。
(这部分是真的看不懂,所以基本不要相信我翻译的,大致就是说,在实地址模式下,虽然可以用32位来表示地址,但实际上地址高端部分是要被丢弃掉的,所以实际上在实地址模式下,能做的寻址就是1M以下。而本人理解的是,BIOS此时就是在这样环境下运行的,所以BIOS不能使用1M以上的地址,但具本人跟踪BIOS代码来看,BIOS代码至少有部分代码是工作在保护模式下的,只是在BIOS运行结束后又将机器重置回实地址模式了。)
【译】x86程序员手册38-10.2实在址模式下的软件初始化的更多相关文章
- 【译】x86程序员手册39-10.3切换到保护模式
10.3 Switching to Protected Mode 切换到保护模式 Setting the PE bit of the MSW in CR0 causes the 80386 to b ...
- 【译】x86程序员手册10 - 第4章系统架构
1.1.2 Part II -- Systems Programming 系统编程 This part presents those aspects of the architecture that ...
- 【译】x86程序员手册01
Intel 80386 Reference Programmer's Manual 80386程序员参考手册 Chapter 1 -- Introduction to the 80386 第1章 - ...
- 【译】x86程序员手册31- 第9章 异常和中断
Chapter 9 Exceptions and Interrupts 第9章 异常和中断 Interrupts and exceptions are special kinds of control ...
- 【译】x86程序员手册11- 4.1系统寄存器
4.1 Systems Registers 系统寄存器 The registers designed for use by systems programmers fall into these cl ...
- 【译】x86程序员手册09-第3章程序指令集
注:觉得本章内容与理解操作系统不直接相关,所以本章并未看完,也就没有翻译完,放在这里中是为了保证手册的完整.有兴趣的人可以去原址查看. https://pdos.csail.mit.edu/6.828 ...
- 【译】x86程序员手册03 - 2.1内存组织和分段
2.1 Memory Organization and Segmentation 内存组织和分段 The physical memory of an 80386 system is organized ...
- 【译】x86程序员手册02 - 基本的程序模式
Chapter 2 -- Basic Programming Model: 基本的程序模式 Introduces the models of memory organization. Defines ...
- 【译】x86程序员手册30-8.2 I/O指令
8.2 I/O Instructions I/O指令 The I/O instructions of the 80386 provide access to the processor's I/O p ...
随机推荐
- [NOI2018] 归程 可持久化并查集
题目描述 本题的故事发生在魔力之都,在这里我们将为你介绍一些必要的设定. 魔力之都可以抽象成一个n 个节点.m 条边的无向连通图(节点的编号从 1至 n).我们依次用 l,a描述一条边的长度.海拔. ...
- mac下破解apk文件以及apktool的相关使用
Android apktool是一个用来处理APK文件的工具,可以对APK进行反编译生成程序的源代码和图片.XML配置.语言资源等文件,也可以添加新的功能到APK文件中.用该工具来汉化Android软 ...
- linux下开机启动svn配置
1.在 vi /etc/rc.local文件下添加以下: /home/svn/subversion-1.8.18/bin/svnserve -d --listen-port 3690 -r /home ...
- Burnside&Polya
以前只是直接用了这两个式子..今天才仔细看了证明..[网上的真是难懂啊 我看的几个博客地址(各有优缺): 其实如果能懂的话 只看博客B就可以了 首先是一些置换群方面的定义和性质 博客A:http:/ ...
- bzoj1878 [SDOI2009]HH的项链——树状数组
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1878 离线树状数组,巧妙的思路呢: 给每种项链记录一个最后出现的位置lst,根据项链最后出现 ...
- 在datagrid中,IE浏览器报错:SCRIPT5007: 无法获取属性“rowspan”的值: 对象为 null 或未定义
项目总采用datagird时,产生界面如下图原本标题上有功能按钮,此时消失 错误:SCRIPT5007: 无法获取属性"rowspan"的值: 对象为 null 或未定义, 造 ...
- Log4j日志等级
Log4j根据日志信息的重要程度,分OFF.FATAL.ERROR.WARN.INFO.DEBUG.ALL 当然再细分的话 还有 FATAL(严重错误), 但是Log4j官方建议实际实用的话,Log4 ...
- Ocelot(十)- 路由
Ocelot的主要功能是接收传入的http请求并将其转发到下游服务.Ocelot目前仅以另一个http请求的形式支持此功能(将来可能是任何传输机制). Ocelot描述了将一个请求路由到另一个请求作为 ...
- SS上网配置(Window 7/8/10 )详解
SS很多人都会用到,尤其是做外贸的朋友,今天我们来说下SS相关的配置. 首先从官网下载解压后的目录如结构下: 点击***.exe,选择以管理员身份运行,切记打开后界面如下 服务器地址为一段I ...
- C语言atoi()函数:将字符串转换成int(整数)
头文件:#include <stdlib.h> atoi() 函数用来将字符串转换成整数(int),其原型为:int atoi (const char * str); [函数说明]atoi ...