Intel 80386 Reference Programmer's Manual 80386程序员参考手册 Chapter 1 -- Introduction to the 80386 第1章 - 80386的介绍 The 80386 is an advanced 32-bit microprocessor optimized for multitasking operating systems and designed for applications needing very high p…
2.1 Memory Organization and Segmentation 内存组织和分段 The physical memory of an 80386 system is organized as a sequence of 8-bit bytes. Each byte is assigned a unique address that ranges from zero to a maximum of 2^(32) -1 (4 gigabytes). 80386系统的物理内存被看做8位…
从上一次学习MIT的操作系统课程又过去了一年.上次学习并没有坚持下去.想来虽有种种原因,其还在自身无法坚持罢了.故此次再鼓起勇气重新学习,发现课程都已由2014改版为2016了.但大部分内容并没有改变.在这一年多的时间里,也曾学习过其他课程,比如孟宁的Linux内核分析,也看过其他人写的文章.但还是有很多内容无法全部理解,而且从网上文章或讨论中也看出,象我这种似懂非懂的状态很多人都有.比如,在看到linux0.11中的那个TSS结构时就一直在想,为什么要这样设计呀?系统明明没有使用到那么多结构成…
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…
注:觉得本章内容与理解操作系统不直接相关,所以本章并未看完,也就没有翻译完,放在这里中是为了保证手册的完整.有兴趣的人可以去原址查看. https://pdos.csail.mit.edu/6.828/2016/readings/i386/c03.htm Chapter 3 Applications Instruction Set 程序指令集 This chapter presents an overview of the instructions which programmers can u…
Chapter 2 -- Basic Programming Model: 基本的程序模式 Introduces the models of memory organization. Defines the data types. Presents the register set used by applications. Introduces the stack. Explains string operations. Defines the parts of an instruction.…
10.5 Initialization Example初始化的例子 译注:本来想把这个例子全部注释完,但由于对intel汇编实不熟悉,有太多的伪指令,本人也是免强看懂,所以就不再做翻译了. $TITLE ('Initial Task') #此处title为开始标识,$符号表示取地址 NAME INIT #为一段程序命名 init_stack SEGMENT RW #定义栈段 可读写 标识符为init_stack DW DUP(?) #保留20个双字位置 tos LABEL WORD #定义一个标…
10.3 Switching to Protected Mode  切换到保护模式 Setting the PE bit of the MSW in CR0 causes the 80386 to begin executing in protected mode. The current privilege level (CPL) starts at zero. The segment registers continue to point to the same linear address…
Chapter 10 Initialization 第10章 初始化 After a signal on the RESET pin, certain registers of the 80386 are set to predefined values. These values are adequate to enable execution of a bootstrap program, but additional initialization must be performed by…
译注:一些异常没有翻译,因为看书时主要为了理解linux代码,所以代码中没有主要使用的就没有仔细看.这部分内容后期再看时再进行翻译. 9.8 Exception Conditions 异常条件 The following sections describe each of the possible exception conditions in detail. Each description classifies the exception as a fault, trap, or abort…
9.7 Error Code 错误代码 With exceptions that relate to a specific segment, the processor pushes an error code onto the stack of the exception handler (whether procedure or task). The error code has the format shown in Figure 9-7 . The format of the error…
9.6 Interrupt Tasks and Interrupt Procedures 中断任务和中断处理程序 Just as a CALL instruction can call either a procedure or a task, so an interrupt or exception can "call" an interrupt handler that is either a procedure or a task. When responding to an i…
Chapter 9 Exceptions and Interrupts 第9章 异常和中断 Interrupts and exceptions are special kinds of control transfer; they work somewhat like unprogrammed CALLs. They alter the normal program flow to handle external events or to report errors or exceptional…
8.2 I/O Instructions I/O指令 The I/O instructions of the 80386 provide access to the processor's I/O ports for the transfer of data to and from peripheral devices. These instructions have as one operand the address of a port in the I/O address space. T…
Chapter 8 Input/Output 输入/输出 This chapter presents the I/O features of the 80386 from the following perspectives: 本章从以下方面来介绍80386的I/O特性: Methods of addressing I/O ports I/O端口的寻址方式 Instructions that cause I/O operations 引起IO操作的指令 Protection as it appl…
7.5 Task Switching 任务切换 The 80386 switches execution to another task in any of four cases: 80386在以下四种情况下会切换另一个任务去执行: The current task executes a JMP or CALL that refers to a TSS descriptor. 当前任务执行了一个引用了TSS描述符的JMP或CALL. The current task executes a JMP…
7.1 Task State Segment 任务状态段 All the information the processor needs in order to manage a task is stored in a special type of segment, a task state segment (TSS). Figure 7-1 shows the format of a TSS for executing 80386 tasks. (Another format is used…
6.4 Page-Level Protection 页级保护 Two kinds of protection are related to pages: 与页相关的保护有两类: Restriction of addressable domain. 可寻址域的约束 Type checking. 类型检验 6.4.1 Page-Table Entries Hold Protection Parameters页表项保存保护参数 Figure 6-10 highlights the fields of…
6.3.5 Some Instructions are Reserved for Operating System 为操作系统保留的一些指令 Instructions that have the power to affect the protection mechanism or to influence general system performance can only be executed by trusted procedures. The 80386 has two classe…
6.3.4 Gate Descriptors Guard Procedure Entry Points 门描述符守卫程序入口 To provide protection for control transfers among executable segments at different privilege levels, the 80386 uses gate descriptors. There are four kinds of gate descriptors: 为了在不同特权级别的可…
6.3.2 Restricting Access to Data  数据访问的约束 To address operands in memory, an 80386 program must load the selector of a data segment into a data-segment register (DS, ES, FS, GS, SS). The processor automatically evaluates access to a data segment by co…
6.3 Segment-Level Protection 段级保护 All five aspects of protection apply to segment translation: 段转换时会提供以下5个方面的保护: Type checking 类型检验 Limit checking 限长检验 Restriction of addressable domain 可寻址域的限定 Restriction of procedure entry points 程序入口点的限定 Restricti…
Chapter 6 Protection 第六章 保护 6.1 Why Protection? 为什么要保护? The purpose of the protection features of the 80386 is to help detect and identify bugs. The 80386 supports sophisticated applications that may consist of hundreds or thousands of program module…
5.3 Combining Segment and Page Translation  联合使用段与分页转换 Figure 5-12 combines Figure 5-2 and Figure 5-9 to summarize both phases of the transformation from a logical address to a physical address when paging is enabled. By appropriate choice of options…
5.2 Page Translation 页转换 In the second phase of address transformation, the 80386 transforms a linear address into a physical address. This phase of address transformation implements the basic features needed for page-oriented virtual-memory systems…
5.1 Segment Translation 段转换 Figure 5-2 shows in more detail how the processor converts a logical address into a linear address. 图5-2展示了处理器将一个逻辑地址转换为线性地址的细节. To perform this translation, the processor uses the following data structures: 处理器使用以下数据结构实现转…
Chapter 5 Memory Management 内存管理 The 80386 transforms logical addresses (i.e., addresses as viewed by programmers) into physical address (i.e., actual addresses in physical memory) in two steps: 80386通过两步将一个逻辑地址(程序所引用的地址)转移为物理地址(实际的物理内存地址). Segment t…
4.2 Systems Instructions 系统指令 Systems instructions deal with such functions as: 系统指令具有以下功能: Verification of pointer parameters (refer to Chapter 6): 验证指印参数(参见第6章) ARPL> -- Adjust RPL RPL= request provilege level LAR -- Load Access Rights LSL -- Load…
4.1 Systems Registers 系统寄存器 The registers designed for use by systems programmers fall into these classes: 为系统程序设计的寄存器分为如下几类: EFLAGS 标志寄存器FLAGS Memory-Management Registers 内存管理寄存器 Control Registers 控制寄存器 Debug Registers 调试寄存器 Test Registers 测试寄存器 4.1…
1.1.2 Part II -- Systems Programming 系统编程 This part presents those aspects of the architecture that are customarily used by programmers who write operating systems, device drivers, debuggers, and other software that supports applications programs in…