BIOS: 系统Reset的方法和差异性

BIOS有三种RESET 的方法: KBC RESET、PORT92、0xCF9,方法如下:

1. KBC Reset
对 KBC(0x60/0x64 port) 写入 0xFE 指令。

2. port 0xCF9 Reset
对 0xCF9 port 写入 0x06、0x0E 指令 (在chipset spec会定义其 Bit 設起時,Reset不同之處).
Bit 1 决定是否作 Reset.
Bit 2 决定 software reset OR hardware reset
Bit 3 决定是否 Reset S3、S4、S5 state
所以 0x06 和0 x0E 都是hardware reset.

# cat /home/devel/working/ (example to reboot system) By (Amos Kong)
import commands

def outb(data, port):
    print "outb(0x%x, 0x%x)" % (port, data)
    outb_cmd = ("echo -e '\%s' | dd of=/dev/port seek=%d bs=1 count=1" %
                (oct(data), port))
    print outb_cmd

outb(0x06, 0xcf9)
outb(0x0E, 0xcf9)

3. port 0x92 (System Control Port A) Reset
对 0x92 port 的Bit 0 设置1,发出 INIT# 对 16 PCI clocks,CPU进行初始化

以上(1)和(3)都是做Software Reset,(2)可以做Software Reset、Hardware Reset、Global Reset. Global Reset是针对 power loss 的情況下做的完整的chipset Reset (发生情況: A global reset will occur after 4 seconds if an acknowledge from the processor is not received.)

* 补充: software reset、hardware reset、warm boot、cold boot的定做和定义
+ Software Reset: activating INIT# for 16 PCI clocks.(只对CPU做Reset)
+ Hardware Reset: hardware reset by activating PLTRST# and SUS_STAT# active for a minimum of about 1 milliseconds. (对CPU和大部分的Chipset做Reset)
+ Warm Boot: 在UEFI BIOS中是下 Software Reset的动作。在DOS按Ctrl+ALT+DEL就是warm boot.
+ Cold Boot: 在ACPI spec可以查到cold boot定义为从 G3(mechanical off)、S5(G2)、S4 开机都算是cold boot.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.