有關於P Code的BootBlock 相關流程在下面有詳細的解釋,如果你在追蹤程式碼的時候有問題,可以參考下面流程。
搜尋討論區's Keyword: "關於boot block... "
~轉載自程式設計俱樂部討論區~
1. Power on
2. BB's entry point
3. check shadow enable or NOT
if Enabled then jump far to F000:E05B
else jump far to BB tasktable ( <- step 4 )
4. many tasks within BB phase
...
check if BIOS checksum fails or specific device attached ?
if Y then jump to BB flashtable and execute crisis
else jump to POST entry point ( < step 5 )
5. many tasks within POST phase
...
...
shadow BIOS and enable shadow (address F000:FFF0 is set EA 5B E0 00 F0)
...
...
Boot to OS or DOS
如同前人所言,只是檢查是否 shadow有開或關. 因為:cold reset及 s/w reset都會進來這裡 !
Case 1:
s/w reset 只對CPU reset,chipset setting仍保留,如此將導致: shadow still enabled when s/w reset !!! 也導致 s/w reset後 CPU是到 DRAM裡抓指令執行,所以在那邊放了 EA 5B E0 00 F0 (最後將跳到 POST entry point)
Case 2:
cold reset 連同 CPU/chipset/others 都 reset,因此 shadow is disabled.故 reset 後CPU是去 ROM抓指令. 在該處也有 jump instruction(只是它會讓 CPU跳到BB去執行...非 POST entry point)
Notes:
1. "why shadow enabled or NOT" 會影響 "去哪裡抓指令",請查閱本網站的文章.
2. shadow control 會 embedded 在 chipset內.故 chipset 被 reset 會讓 shadow 是 disabled
* trace 過程中倒是發現:不管 BB entry point 或是 POST entry point,1st instruction都是 cli ( machine code: FA ) ^_^