BDA
BDA : BIOS DATA AREA
BDA 存放System Bios 會使用到的重要的資料,
範圍 : 40:00 ~ "50" : 00 (Segment)
重要的Register :
40:1A Keyboard, Head of buffer pointer (word)
40:1C Keyboard, End of buffer pointer (word)
40:1E Keyboard buffer (16 words)
Keyboard Buffer can only holds 15 words.
When the buffer is full, additional keys are discarded by the INT9.
An error beep is generated for each discard.
40:6C Timer Ticks Count (Dword)
40:0E Extended BIOS Data Area Segment
EBDA 範圍 : EBDA:0 ~ EBDA:11D
EBDA is to hold data for a motherboard mouse port, hard disk parameters, and disk track buffers.
CMOS
The system contains a small amout of CMOS memory that retains its data while the system power is off.
CMOS chip also has a Real-Time Clock that keeps current time.
Accessing 限制
必須關閉interrupts (include NMI(port 70h bit 7) ) when access (read/write) CMOS
因為要確保在寫入index(70h port)時,別的中斷不會access CMOS
另外是read 時,也需要check Bit 7 of Register A,
Bit 7 of Register A 代表RTC updating ,
//loop for RTC updating
do {
Status = BDA_CMOS->Io.Write (
BDA_CMOS,
EfiCpuIoWidthUint8,
0x70,
1,
®_A_OFFSET);
Status = BDA_CMOS->Io.Read (
BDA_CMOS,
EfiCpuIoWidthUint8,
0x71,
1,
&DATA);
} while (((DATA & 0x80) == 0x80));
RTC
A real time clock alarm is a feature that can be used to allow a computer to 'wake up' after shut down to execute tasks every day or on a certain day.
限會員,要發表迴響,請先登入