TWI801412B - Debug method - Google Patents
Debug method Download PDFInfo
- Publication number
- TWI801412B TWI801412B TW107131240A TW107131240A TWI801412B TW I801412 B TWI801412 B TW I801412B TW 107131240 A TW107131240 A TW 107131240A TW 107131240 A TW107131240 A TW 107131240A TW I801412 B TWI801412 B TW I801412B
- Authority
- TW
- Taiwan
- Prior art keywords
- memory
- processing unit
- central processing
- debug
- test
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 17
- 238000012545 processing Methods 0.000 claims description 26
- 238000001514 detection method Methods 0.000 claims description 21
- 238000012360 testing method Methods 0.000 claims description 16
- 230000003321 amplification Effects 0.000 claims 1
- 238000003199 nucleic acid amplification method Methods 0.000 claims 1
- 238000011161 development Methods 0.000 abstract description 7
- 230000006870 function Effects 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 101000746134 Homo sapiens DNA endonuclease RBBP8 Proteins 0.000 description 1
- 101000969031 Homo sapiens Nuclear protein 1 Proteins 0.000 description 1
- 102100021133 Nuclear protein 1 Human genes 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000004904 shortening Methods 0.000 description 1
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
本發明是有關於一種偵錯方法,特別是指一種基本輸入輸出系統的偵錯方法。The present invention relates to an error detection method, in particular to a basic input output system error detection method.
參閱圖1,習知的電腦主機9包含一個中央處理器(CPU)91、一個電連接該中央處理器的晶片組(PCH)92、一個電連接該晶片組的基本輸入輸出系統(BIOS)93、及一個電連接該晶片組的通用非同步收發傳輸器(Universal Asynchronous Receiver/Transmitter;UART)94。該基本輸入輸出系統93的開機程序操作在一個正常模式(Release Mode)及一個偵錯模式(Debug Mode)之間。當該基本輸入輸出系統93操作在該偵錯模式時,該晶片組92藉由該通用非同步收發傳輸器94將該基本輸入輸出系統93的偵錯資訊,經由一個支援該通用非同步收發傳輸器94之標準的連接埠,例如COM1,傳送至另一個電腦主機8,使得一個程式開發者可以藉由該電腦主機8取得偵錯模式的相關偵錯資訊,進而據以修改該基本輸入輸出系統93的程式碼。Referring to Fig. 1, the known
由於支援該通用非同步收發傳輸器94之標準的連接埠的傳輸速度相當緩慢,使得該基本輸入輸出系統93在該正常模式及該偵錯模式時,該開機程序在執行開機自我檢測(Power ON Self Test;POST)的時間差異相當的大。舉例來說,在該正常模式下,執行開機自我檢測的時間約為78秒,而在該偵錯模式下,執行開機自我檢測的時間卻約為264秒。這樣的時間差異顯示偵錯的效率不佳,也就導致開發基本輸入輸出系統的時間變長,因此成為一個待解決的問題。Because the transmission speed of the standard connection port supporting the UART 94 is quite slow, when the
因此,本發明的目的,即在提供一種可以提高效率的偵錯方法。Therefore, the object of the present invention is to provide a debugging method that can improve efficiency.
於是,本發明偵錯方法,適用於一包含一個中央處理器及一個記憶體的電腦主機並包含步驟(a)~(d)。Therefore, the error detection method of the present invention is applicable to a computer host including a central processing unit and a memory and includes steps (a)-(d).
於步驟(a),藉由該中央處理器執行一個基本輸入輸出系統的程式碼,以執行一個開機自我檢測(POST)。In step (a), a BIOS code is executed by the CPU to execute a power-on self-test (POST).
於步驟(b),該基本輸入輸出系統的程式碼提供一個驅動程式,使得多個偵錯資訊可以對應輸出至該記憶體的一個位址區塊。In step (b), the program code of the BIOS provides a driver so that a plurality of debugging information can be correspondingly output to an address block of the memory.
於步驟(c),在該開機自我檢測的初始階段,當該記憶體完成初始化之後,該中央處理器將該等偵錯資訊儲存至該記憶體的該位址區塊。In step (c), at the initial stage of the POST, after the memory is initialized, the CPU stores the error detection information in the address block of the memory.
於步驟(d),當該開機自我檢測結束之後,藉由該中央處理器執行一個應用軟體,以讀取儲存於該記憶體的該位址區塊的該等偵錯資訊。In step (d), after the POST is finished, the central processing unit executes an application software to read the debug information stored in the address block of the memory.
在一些實施態樣中,該中央處理器包括一個快取記憶體,該偵錯方法還包含一個步驟(e),在該開機自我檢測的初始階段,當該快取記憶體完成初始化之後,且該記憶體初始化之前,該快取記憶體被虛擬成該記憶體的該位址區塊,使得該中央處理器將該等偵錯資訊儲存至該快取記憶體。In some implementation aspects, the central processing unit includes a cache memory, and the error detection method further includes a step (e), in the initial stage of the power-on self-test, after the cache memory is initialized, and Before the memory is initialized, the cache memory is virtualized as the address block of the memory, so that the central processing unit stores the debugging information in the cache memory.
在一些實施態樣中,其中,在步驟(c)中,當該記憶體完成初始化之後,該中央處理器還先將該快取記憶體所儲存的該等偵錯資訊儲存至該記憶體的該位址區塊。In some implementation aspects, wherein, in step (c), after the memory is initialized, the central processing unit first stores the debugging information stored in the cache memory in the memory the address block.
在另一些實施態樣中,該偵錯方法還適用於一個電腦主機,並還包含一個步驟(f),在該開機自我檢測的過程中,藉由該電腦主機經由一個擴增偵錯埠(Extended Debug Port;XDP)與該中央處理器連線,以在該基本輸入輸出系統執行該開機自我檢測(POST)的過程中,就能夠讀取該記憶體的該位址區塊所儲存的該等偵錯資訊。In some other implementations, the error detection method is also applicable to a computer host, and further includes a step (f), in the process of the power-on self-test, through the computer host through an extended error detection port ( Extended Debug Port; XDP) is connected with the central processing unit, so that the BIOS stored in the address block of the memory can be read during the process of the BIOS executing the power-on self-test (POST). Wait for debugging information.
本發明的功效在於:藉由將該開機自我檢測過程中所產生的該等偵錯資訊儲存至該記憶體,使得該開機自我檢測的執行時間相較於習知技術大幅地縮短,進而使得開發者的偵錯效率大幅地提高。如此,不但能夠有效地縮短開發時間,還因為該偵錯模式與該正常模式的執行時間相差不多,開發者可以不需要針對分別該偵錯模式及該正常模式開發兩種版本的基本輸入輸出系統的程式碼,也就是說,開發者只需要提供一個版本的程式碼,即已同時包含該偵錯模式之功能的正常模式,進而有效提高基本輸入輸出系統的開發效率。The effect of the present invention is: by storing the error detection information generated during the POST process into the memory, the execution time of the POST is greatly shortened compared with the prior art, thereby enabling development The error detection efficiency of the operator is greatly improved. In this way, not only can the development time be effectively shortened, but also because the execution time of the debug mode and the normal mode is almost the same, the developer does not need to develop two versions of the basic input output system for the debug mode and the normal mode respectively That is to say, the developer only needs to provide one version of the code, that is, the normal mode that already includes the function of the debug mode, thereby effectively improving the development efficiency of the basic input output system.
在本發明被詳細描述之前,應當注意在以下的說明內容中,類似的元件是以相同的編號來表示。Before the present invention is described in detail, it should be noted that in the following description, similar elements are denoted by the same numerals.
參閱圖2與圖3,本發明偵錯方法適用於一個電腦主機5,該電腦主機5包含一個中央處理器(CPU)1、一個電連接該中央處理器1的晶片組(PCH)3、一個電連接該晶片組3的基本輸入輸出系統(BIOS)4、及一個電連接中央處理器1的記憶體2。該中央處理器1包括一個快取記憶體(Cache)11,該記憶體2即為該電腦主機5的系統記憶體,例如DDR SDRAM。該偵錯方法包含步驟S1~S6。Referring to Fig. 2 and Fig. 3, the error detection method of the present invention is applicable to a
於步驟S1,在該電腦主機5開機時,該中央處理器1經由該晶片組3執行該基本輸入輸出系統4的程式碼,以執行一個開機自我檢測(POST)。In step S1, when the
於步驟S2,該基本輸入輸出系統4的程式碼提供一個驅動程式(Driver),使得多個偵錯資訊可以對應輸出至該記憶體2的一個位址區塊。In step S2, the program code of the BIOS 4 provides a driver, so that a plurality of debugging information can be correspondingly output to an address block of the
於步驟S3,在該開機自我檢測的初始(Initial)階段,當該快取記憶體11完成初始化之後,且該記憶體2初始化之前,該快取記憶體11被虛擬成該記憶體2的一個位址區塊,使得該中央處理器1將該等偵錯資訊儲存至該快取記憶體11。In step S3, in the initial stage of the power-on self-test, after the
於步驟S4,在該開機自我檢測的初始階段,當該記憶體2完成初始化之後,該中央處理器1先將該快取記憶體11所儲存的該等偵錯資訊儲存至該記憶體2的該位址區塊,再將後續產生的該等偵錯資訊儲存至該記憶體2的該位址區塊。In step S4, in the initial stage of the POST, after the
於步驟S5,當該開機自我檢測結束之後,藉由該中央處理器1執行一個應用軟體,以讀取儲存於該記憶體2的該位址區塊的該等偵錯資訊。更詳細地說,該中央處理器1執行該基本輸入輸出系統4的程式碼,而完成一個開機程序,使得使用者可以藉由該中央處理器1執行該應用軟體。該應用軟體例如是UltraEdit,只要具備能將記憶體2所儲存的資料讀出的功能即可,例如以轉換ASCII編碼的形式顯示。In step S5, after the POST is finished, the central processing unit 1 executes an application software to read the debug information stored in the address block of the
於步驟S6,在該開機自我檢測的過程中,藉由另一個電腦主機7經由一個擴增偵錯埠(Extended Debug Port;XDP)與該中央處理器1連線,以在該基本輸入輸出系統執行該開機自我檢測(POST)的過程中,就能夠讀取該記憶體2的該位址區塊所儲存的該等偵錯資訊。換句話說,藉由該擴增偵錯埠讀取該等偵錯資訊具有即時處理的性質,能夠滿足開發者需要即時更新之偵錯資訊的需求。舉例來說,當該開機自我檢測的過程異常,導致系統在執行開機自我檢測的過程卡住,無法完成該開機程序時,藉由該電腦主機7可以即時地讀取該記憶體2的該等偵錯資訊,使得開發者能夠進一步掌握程式碼的異常狀況。In step S6, in the process of the power-on self-test, another
在本實施例中,該偵錯資訊例如是該程式碼執行至哪一個位置或階段,如檢測至哪個裝置,或者,程式中任何一個相關的暫存器數值等等,如register PPI Notify: EfiPeiSecurity2、Install PPI: EfiPeiLoadFile、StatusCodePei.Entry(FFF 39594)、PcdPeim.Entry(FFF51320)、Size: 90、Power Failure PWR_FLR bit: 1…等等,都不在此限。此外,由於硬體的發展趨勢,該快取記憶體11及該記憶體2的容量都已經能夠完整地儲存在不同執行階段時,已對應產生的該等偵錯資訊。In this embodiment, the error detection information is, for example, which location or stage the program code is executed to, such as which device is detected, or any relevant register value in the program, etc., such as register PPI Notify: EfiPeiSecurity2 , Install PPI: EfiPeiLoadFile, StatusCodePei.Entry(FFF 39594), PcdPeim.Entry(FFF51320), Size: 90, Power Failure PWR_FLR bit: 1... etc. are not limited here. In addition, due to the development trend of hardware, the capacities of the
綜上所述,在該快取記憶體11初始化之後,藉由該快取記憶體11儲存在開機自我檢測過程中所產生的該等偵錯資訊,而在該記憶體2初始化之後,先將該快取記憶體11中的該等偵錯資訊複製至該記憶體2,再將新產生的該等偵錯資訊儲存至該記憶體2中,不但使得本發明不需要利用習知的低速的UART連接埠來傳輸偵錯資訊,而達到大幅縮短偵錯模式的執行時間的優點。更因為該偵錯模式與該正常模式的執行時間已相差不多,而能將該偵錯模式與該正常模式合而為一,使得開發者只要開發一個版本的基本輸入輸出系統4的程式碼,更是能夠大大地提昇開發效率,故確實能達成本發明的目的。In summary, after the
惟以上所述者,僅為本發明的實施例而已,當不能以此限定本發明實施的範圍,凡是依本發明申請專利範圍及專利說明書內容所作的簡單的等效變化與修飾,皆仍屬本發明專利涵蓋的範圍內。But the above-mentioned ones are only embodiments of the present invention, and should not limit the scope of the present invention. All simple equivalent changes and modifications made according to the patent scope of the present invention and the content of the patent specification are still within the scope of the present invention. Within the scope covered by the patent of the present invention.
1:中央處理器11:快取記憶體2:記憶體3:晶片組4:基本輸入輸出系統5:電腦主機7:電腦主機8:電腦主機9:電腦主機91:中央處理器92:晶片組93:基本輸入輸出系統94:通用非同步收發傳輸器S1~S6:步驟 1: central processing unit 11: cache memory 2: memory 3: chip set 4: basic input output system 5: mainframe computer 7: mainframe computer 8: mainframe computer 9: mainframe computer 91: central processing unit 92: chip set 93: Basic input and output system 94: Universal asynchronous transceiver transmitter S1~S6: steps
本發明的其他的特徵及功效,將於參照圖式的實施方式中清楚地呈現,其中: 圖1是一方塊圖,說明習知的一個電腦主機及另一個電腦主機; 圖2是一方塊圖,說明本發明偵錯方法適用的一個電腦主機;及 圖3是一流程圖,說明本發明偵錯方法的一個實施例。Other features and functions of the present invention will be clearly presented in the implementation manner with reference to the drawings, wherein: FIG. 1 is a block diagram illustrating a conventional computer host and another computer host; FIG. 2 is a block diagram , illustrating a host computer to which the error detection method of the present invention is applicable; and FIG. 3 is a flow chart illustrating an embodiment of the error detection method of the present invention.
S1~S6:步驟 S1~S6: steps
Claims (2)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW107131240A TWI801412B (en) | 2018-09-06 | 2018-09-06 | Debug method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW107131240A TWI801412B (en) | 2018-09-06 | 2018-09-06 | Debug method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TW202011193A TW202011193A (en) | 2020-03-16 |
| TWI801412B true TWI801412B (en) | 2023-05-11 |
Family
ID=70766778
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW107131240A TWI801412B (en) | 2018-09-06 | 2018-09-06 | Debug method |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI801412B (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1983179A (en) * | 2005-12-15 | 2007-06-20 | 英业达股份有限公司 | Boot self-test debugging system and method |
| TW201810037A (en) * | 2016-08-17 | 2018-03-16 | 上海兆芯集成電路有限公司 | Input/output expander chip and verification method therefor |
| TWI620061B (en) * | 2017-05-15 | 2018-04-01 | 神雲科技股份有限公司 | Error detecting apparatus of server and error detecting method thereof |
| TWI626539B (en) * | 2017-04-25 | 2018-06-11 | 精英電腦股份有限公司 | Computer System Error Warning Method |
| TW201821990A (en) * | 2016-12-14 | 2018-06-16 | 英業達股份有限公司 | Computer system and detection method |
-
2018
- 2018-09-06 TW TW107131240A patent/TWI801412B/en active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1983179A (en) * | 2005-12-15 | 2007-06-20 | 英业达股份有限公司 | Boot self-test debugging system and method |
| TW201810037A (en) * | 2016-08-17 | 2018-03-16 | 上海兆芯集成電路有限公司 | Input/output expander chip and verification method therefor |
| TW201821990A (en) * | 2016-12-14 | 2018-06-16 | 英業達股份有限公司 | Computer system and detection method |
| TWI626539B (en) * | 2017-04-25 | 2018-06-11 | 精英電腦股份有限公司 | Computer System Error Warning Method |
| TWI620061B (en) * | 2017-05-15 | 2018-04-01 | 神雲科技股份有限公司 | Error detecting apparatus of server and error detecting method thereof |
Also Published As
| Publication number | Publication date |
|---|---|
| TW202011193A (en) | 2020-03-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10139876B2 (en) | Efficient reboot of an operating system executed in a virtual machine | |
| US9501289B2 (en) | Method of a UEFI firmware and computer system thereof | |
| US10489582B1 (en) | Firmware security vulnerability verification service | |
| US10606677B2 (en) | Method of retrieving debugging data in UEFI and computer system thereof | |
| CN113377586B (en) | Automatic detection method and device for server and storage medium | |
| CN104182269A (en) | Physical memory forensic method for KVM (Kernel-based Virtual Machine) | |
| CN119336682B (en) | Method for performing hot removal operation, hot plug system, device, medium and product | |
| CN111338864A (en) | Memory problem detection method, device, computer equipment and storage medium | |
| CN102609320B (en) | Microprocessor and method for configuring debug logic in microprocessor | |
| US7430683B2 (en) | Method and apparatus for enabling run-time recovery of a failed platform | |
| CN110955566B (en) | Error detecting method | |
| JP5551828B2 (en) | Replay architecture execution with probeless trace collection | |
| TWI801412B (en) | Debug method | |
| US11599342B2 (en) | Pathname independent probing of binaries | |
| TWI794997B (en) | Method and apparatus and computer program product for debugging solid state disk devices | |
| CN100386733C (en) | Debugging support unit with execution stopping capability on chip electronic hardware and method thereof | |
| WO2022199622A1 (en) | Method for running startup program of electronic device, and electronic device | |
| CN110321171B (en) | Startup detection device, system and method | |
| JP2022520914A (en) | Testing read-only memory using a memory-embedded self-test controller | |
| CN110399726A (en) | TPM physical chip detection method, apparatus, device and readable storage medium | |
| US8051329B1 (en) | Method and system for initializing a computing system | |
| WO2019169615A1 (en) | Method for accessing code sram, and electronic device | |
| TW484053B (en) | Remote monitoring method and system | |
| CN117608906A (en) | Crash detection and analysis method, device and storage medium | |
| CN115687039A (en) | A cloud platform verification method, component and ARM cloud platform |