Wednesday, September 28, 2016

BIOS CODE Instruction

Start Code
Start Code Instruction (English)
启动代码意义解释(中文)
00
Passes control to OS Loader (typically INT19h).
//完成启动的控制,转向操作系统的载入(相当于INT19H 的功能.)
03
Disable NMI, Parity, video for EGA, and DMA controllers. Initialize BIOS, POST, Runtime data area. Also initialize BIOS modules on POST entry and GPNV area. Initialized CMOS as mentioned in the Kernel Variable "wCMOSFlags."
// 禁止不可屏蔽中断,奇偶校验,EGA显卡,DMA控制器.初始化 BIOS,POST,实时时钟数据区.初始化BIOS模块中的上电自检(POST)入口和GPNV区域,初始化核心变量之CMOS中的一些标志.
04
Check CMOS diagnostic byte to determine if battery power is OK and CMOS checksum is OK. Verify CMOS checksum manually by reading storage area. If the CMOS checksum is bad, update CMOS with power-on default values and clear passwords. Initialize status register A.Initializes data variables that are based on CMOS setup questions.Initializes both the 8259 compatible PICs in the system.
检查CMOS诊断位,判断电池电量是否OK.验证CMOS校验码(保存在CMOS).如果校验码错,则清除密码(译者注:利用这个原理,可以修改CMOS数据,使其校验通不过,这样就清除了开机密码啦!),并载入上电默认的参数设置,初始化状态寄存器(如同在BIOS设置的选项:载入默认的设置),同时初始化8259(中断优先级).
05
Initializes the interrupt controlling hardware (generally PIC) and interrupt vector table.
初始化中断控制器和中断向量表
06
Do R/W test to CH-2 count reg. Initialize CH-0 as system timer.Install the POSTINT1Ch handler. Enable IRQ-0 in PIC for system timer interrupt.Traps INT1Ch vector to "POSTINT1ChHandlerBlock."
CH-2计数寄存器进行读写测试,初始化CH-0为系统时钟.加载POST INT1CH 中断服务程序(就是把服务程序的地址放到中断向量表中).IRQ-0(系统时钟中断)
07
Fixes CPU POST interface calling pointer.
定位CPU上电自检接口的调用指针
08
Initializes the CPU. The BAT test is being done on KBC. Program the  keyboard controller command byte is being done after Auto detection of KB/MS using AMI KB-5.
初始化CPU,基本检测将在键盘控制器(KBC)中完成.对键盘控制器命令字节的编程将在自动检测键盘/鼠标(使用 AMI KB-5)后完成.
0A
Initializes the 8042 compatible Key Board Controller.
初始化8042(或兼容芯片)键盘控制器.
0B
Detects the presence of PS/2 mouse.
检测PS/2鼠标是否存在.
0C
Detects the presence of Keyboard in KBC port.
检测键盘是否存在
0E
Testing and initialization of different Input Devices. Also, update the Kernel Variables.Traps the INT09h vector, so that the POST INT09h handler gets control for IRQ1. Uncompress all available language, BIOS logo, and Silent logo modules.
测试和初始化不同的输入设备,同时,更新核心参数.设置INT09号中断向量,使之与IRQ1挂接.解压缩:可以使用的语言模块,BIOS LOGO画面,全屏开机画面模块.
13
Early POST initialization of chipset registers.
上电自检前期初始化芯片寄存器.
20
Relocate System Management Interrupt vector for all CPU in the system.
重新安排所有CPU要用的系统管理中断向量.
24
Uncompress and initialize any platform specific BIOS modules. GPNV is initialized at this checkpoint.
解压缩并初始化各个平台的细节模块.在这一步GPNV被初始化.
2A
Initializes different devices through DIM.See DIM Code Checkpoints section of document for more information.
按照设计资料手册初始化不同的硬件设备.(得到更多的测试点信息,请看设计资料手册.)
2C
Initializes different devices. Detects and initializes the video adapter installed in the system that have optional ROMs.
继续初始化设备,检测并初始化所安装的显示适配器(内建基本调用程序).
2E
Initializes all the output devices.
初始化所有的输出设备
31
Allocate memory for ADM module and uncompress it. Give control to ADM module for initialization. Initialize language and font modules for ADM.Activate ADM module.
解压缩ADM模块并分配其内存,把控制权交给ADM模块去初始化.初始化语言和字体模块.
33
Initializes the silent boot module. Set the window for displaying text information.
初始化"无声"(就是看不到基本信息,只有开机画面)启动模式.设置显示文字信息的窗口.
37
Displaying sign-on message, CPU information, setup key message, and any OEM specific information.
显示开始信息,CPU型号信息,进入设置模式信息(就是按什么键进入BIOS设置)和其他设备制造商的特别信息.
38
Initializes different devices through DIM. See DIM Code Checkpoints section of document for more information. USB controllers are initialized at this point.
根据设计资料手册初始化不同设备,在这一步,USB控制器被初始化.
39
Initializes DMAC-1 & DMAC-2.
初始化DMA控制器12.
3A
Initialize RTC date/time.
初始化实时时钟的时间日期.
3B
Test for total memory installed in the system. Also, Check for DEL or ESC keys to limit memory test. Display total memory in the system.
测试所有安装的内存.同时检测"DEL""ESC",若按下,则停止测试内存.显示总安装内存容量.
3C
Mid POST initialization of chipset registers.
在上电自检期间初始化芯片寄存器
40
Detect different devices (Parallel ports, serial ports, and coprocessor in CPU, … etc.) successfully installed in the system and update the BDA,EBDA…etc.
检测设备(并口,串口,处理器...等等),更新BIOS数据区,扩展BIOS数据区.
52
Updates CMOS memory size from memory found in memory test. Allocates memory for Extended BIOS Data Area from base memory. Programming the memory hole or any kind of implementation that needs an adjustment in system RAM size if needed.
根据测试到的内存大小更新CMOS数据.从基本内存中分配内存给扩展BIOS数据区.编程内存的缺口(针对某些需要调整内存大小的程序.)
60
Initializes NUM-LOCK status and programs the KBD typematic rate.
初始化"NUM_LOCK"键的状态.设定键盘 重复按键的重复速率.
75
Initialize Int-13 and prepare for IPL detection.
初始化INT-13,准备进行初始载入程序检测.
78
Initializes IPL devices controlled by BIOS and option ROMs.
根据BIOS设定 和 ROM信息,初始化IPL的控制设备
84
Log errors encountered during POST.
记录在上电自检中遇到的错误.
85
Display errors to the user and gets the user response for error.
显示错误给用户,检测用户对错误的处理动作.
87
Execute BIOS setup if needed / requested. Check boot password if installed.
进入BIOS设置程序如果需要或者用户选择,检查启动密码.
7C
Generate and write contents of ESCD in NVRam.
产生并重写ESCD(位于NVRam).
8C
Late POST initialization of chipset registers.
为上电自检末期初始化芯片寄存器.
8D
Build ACPI tables (if ACPI is supported)
建立高级电源控制界面(ACPI),如果支持的话.
8E
Program the peripheral parameters. Enable/Disable NMI as selected
设定外围设备的参数,根据设定允许/禁止不可屏蔽中断(NMI).
90
Initialization of system management interrupt by invoking all handlers.Please note this checkpoint comes right after checkpoint 20h
初始化所有使用者之系统中断.(注意此步测试点在20H号以后进行.)
A1
Clean-up work needed before booting to OS.
在准备启动到系统之前清除工作区. 
A2
Takes care of runtime image preparation for different BIOS modules. Fill the free area in F000h segment with 0FFh. Initializes the Microsoft IRQ Routing Table. Prepares the runtime language module. Disables the system configuration display if needed.
(当心不同BIOS模块准备运行的时间),填充段0F000H0FFH. 初始化微软的IRQ安排表,准备运行语言模块,禁止系统信息显示(如果需要的话.).
A4
Initialize runtime language module. Display boot option popup menu.
初始化运行语言模块,显示启动菜单.
A7
Displays the system configuration screen if enabled. Initialize the CPU’s before boot, which includes the programming of the MTRR’s.
如果允许,显示系统信息,初始化CPU在启动之前(包含在设置MTRR).
A9
Wait for user input at config display if needed.
如果需要,等待用户输入在信息显示之时. 
AA
Uninstall POST INT1Ch vector and INT09h vector.
卸载上电自检所用之INT1CH INT09H向量. 
AB
Prepare BBS for Int 19 boot. Init MP tables.
准备进行INT19的启动引导,初始化MP.
AC
End of POST initialization of chipset registers. De-initializes the ADM module.
为上电自检末期初始化芯片寄存器,不初始化ADM模块. 
B1
Save system context for ACPI. Prepare CPU for OS boot including final MTRR values.
保存ACPI的系统设备环境,设定CPU来准备进行操作系统启动(包括MTRR).
C0
Early CPU Init Start -- Disable Cache – Init Local APIC
前期CPU初始化开始:禁止缓存,初始化局部APIC.
C1
Set up boot strap processor Information
设置协处理器信息.
C2
Set up boot strap processor for POST
为上电自检设置协处理器
C5
Enumerate and set up application processors
列举并设置应用处理器
C6
Re-enable cache for boot strap processor
为协处理器使能缓存. 
C7
Early CPU Init Exit
前期CPU初始化退出. 
Before D0
If boot block debugger is enabled, CPU cache-as-RAM functionality is enabled at this point. Stack will be enabled from this point.
如果启动模块调试器允许,此时CPU cache-as-RAM 功能使能,堆栈也会可以使用.
D0
Early Boot Strap Processor (BSP) initialization like microcode update, frequency and other CPU critical initialization. Early chipset initialization is done.
前期BSP 初始化,例如:微码更新,频率及其它 CPU默认的初始化.前期芯片初始化完成.
D1
Early super I/O initialization is done including RTC and keyboard controller.Serial port is enabled at this point if needed for debugging. NMI is disabled.Perform keyboard controller BAT test. Save power-on CPUID value in scratch CMOS. Go to flat mode with 4GB limit and GA20 enabled.
前期I/O口初始化完成(包括实时时钟,键盘控制器)串口被使能如果调试需要的话,NMI 禁止,运行键盘控制器基本保证检验(BAT)测试.保存上电时的CPUIDCMOS暂存区.进入平坦模式(寻址4GB空间),GA20允许.
D2
Verify the boot block checksum. System will hang here if checksum is bad.
检验启动模块的校验码,如果校验出错,则系统挂起. 
D3
Disable CACHE before memory detection. Execute full memory sizing module. If memory sizing module not executed, start memory refresh and do memory sizing in Boot block code. Do additional chipset initialization.Re-enable CACHE. Verify that flat mode is enabled.
在内存检测之前禁止缓存,执行内存大小检测模块.如果该模块没有执行,开始内存刷新并在启动模块代码里面执行内存大小检测.进行额外的芯片初始化工作,重新使能缓存,验证平坦模式是否使能.
D4
Test base 512KB memory. Adjust policies and cache first 8MB. Set stack.
测试基本的512K内存,调整分配策略并隐藏前8MB.设置堆栈.
D5
Bootblock code is copied from ROM to lower system memory and control is given to it. BIOS now executes out of RAM. Copies compressed boot block  code to memory in right segments. Copies BIOS from ROM to RAM for faster  access. Performs main BIOS checksum and updates recovery status accordingly.
ROM中拷贝启动模块的代码到低端系统内存区,并把控制权交给启动模块.拷贝解压缩的启动模块代码到高端内存,拷贝BIOSROM到内存以高速地访问.执行BIOS主模块的校验并因此而更新"是否需要恢复BIOS"的标志.
D6
Both key sequence and OEM specific method is checked to determine if BIOS recovery is forced. If BIOS recovery is necessary, control flows to checkpoint E0. See Bootblock Recovery Code Checkpoints section of document for more information.
检测按键及OEM特殊方法是否激活来决定恢复/刷新BIOS软件.如果需要进行,则进入测试号E0H,(了解更多信息,请看启动模块中恢复/刷新BIOS部分的内容.)
D7
Both key sequence and OEM specific method is checked to determine if BIOS  Restore CPUID value back into register. The module is moved to system memory and control is given to it. Determine Bootblock-Runtime interface whether to execute serial flash.
检测按键及OEM特殊方法是否激活来决定是否恢复CPUID到寄存器中.该模块载入到系统内存并取得控制权,执行启动模块刷新接口(执行串口FLASH刷新). 
D8
The Runtime module is uncompressed into memory. CPUID information is stored in memory.
刷新模块解压缩到内存中.CPUID的信息也保存在内存中.
D9
Store the Uncompressed pointer for future use in PMM. Copying Main BIOS into memory. Leaves all RAM below 1MB Read-Write including E000 and F000 shadow areas but closing SMRAM.
保存解压缩指针以备将来在PMM中使用,拷贝主BIOS模块到内存中.许可所有低于1MB的内存读写(包括0E000H-0F000H映射区域)但是关闭 SMRAM.
DA
Restore CPUID value back into register. Give control to BIOS POST (ExecutePOSTKernel). See POST Code Checkpoints section of document for more information.
恢复CPUID值到寄存器中.移交控制权与BIOS POST(执行上电自检的内核.)了解更多信息,请参考POST Code Checkpoints 部分.(前面的03-08,C1-C8) 
DC
System is waking from ACPI S3 state
系统从ACPIS3模式唤醒. 
E0
Initialize the floppy controller in the super I/O. Some interrupt vectors are initialized. DMA controller is initialized. 8259 interrupt controller is initialized. L1 cache is enabled.
初始化I/O口中的软盘控制器及必需的一些中断向量,DMA控制器,8259中断控制器等.使能一级缓存.
E1-E8 EC-EE
OEM memory detection/configuration error. This range is reserved for chipset vendors & system manufacturers. The error associated with this value may be different from one platform to the next.
OEM 内存测试和配置错误,这部分号码为芯片制造商/系统制造商保留.这个错误内涵随着平台的不同而变化. 
E9
Set up floppy controller and data. Attempt to read from floppy.
设置软盘控制器和数据,尝试进行软驱读写. 
EA
Enable ATAPI hardware. Attempt to read from ARMD and ATAPI CDROM.
允许ATAPI硬件(光驱等),尝试从ARMD/ATAPI读取信息.
EB
Disable ATAPI hardware. Jump back to checkpoint E9.
禁止ATAPI硬件,跳转到测试号E9H.
EF
Read error occurred on media. Jump back to checkpoint EB.
发生读介质错误,跳转到测试号EBH.
F0
Search for pre-defined recovery file name in root directory.
在启动目录里面查找每个预定义的恢复文件.
F1
Recovery file not found.
恢复文件(用来刷新BIOS的文件)没有找到.
F2
Start reading FAT table and analyze FAT to find the clusters occupied by the recovery file.
开始读取FAT表并分析恢复文件所在的簇.
F3
Start reading the recovery file cluster by cluster.
开始一簇一簇地读取恢复文件.
F4
The recovery file size does not equal the found flash part size.
恢复文件的大小和所检测到的FLASH ROM的大小不符.
F5
Disable L1 cache.
禁止一级缓存.
FA
Check the validity of the recovery file configuration to the current configuration of the flash part.
检测恢复文件和默认的FLASH芯片配置是否相符. 
FB
Make flash write enabled through chipset and OEM specific method. Detect proper flash part. Verify that the found flash part size equals the recovery file size.
通过芯片和OEM特殊方法使能FLASH芯片读写.检测正确的FLASH芯片,检验其大小是否和恢复文件的大小相符.
FC
Erase the flash part.
擦除FLASH芯片.
FD
Program the flash part.
编程写入FLASH芯片.
FF
The flash has been updated successfully. Make flash write disabled.Disable ATAPI hardware. Restore CPUID value back into register. Give control to F000 ROM at F000:FFF0h.
BIOS已经被成功地更新,禁止FLASH芯片写入.禁止ATAPI硬件,恢复CPUID值到寄存器中,把控制权交给0F000H ROM(0F000:FFF0H)


When you use the Power on self Test, pls check these AMI BIOS code and then do with it.