TW201727482A - Debug message outputting method and computer program product for BIOS - Google Patents
Debug message outputting method and computer program product for BIOS Download PDFInfo
- Publication number
- TW201727482A TW201727482A TW105101674A TW105101674A TW201727482A TW 201727482 A TW201727482 A TW 201727482A TW 105101674 A TW105101674 A TW 105101674A TW 105101674 A TW105101674 A TW 105101674A TW 201727482 A TW201727482 A TW 201727482A
- Authority
- TW
- Taiwan
- Prior art keywords
- debug
- subroutine
- message
- output
- code
- Prior art date
Links
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
本發明是有關於除錯訊息輸出方法,特別是指一種用於基本輸入輸出系統之除錯訊息輸出方法。The present invention relates to a method for outputting a debug message, and more particularly to a method for outputting a debug message for a basic input/output system.
當例如電腦的資訊處理系統重置或啟動時,安裝於電腦內的基本輸入輸出系統(Basic Input/Output System,在下簡稱BIOS)會針對電腦硬體執行多個測試程序,即針對如處理器、主機板、記憶體等之電腦硬體進行檢查及測試。一般而言,每一測試程序有多個子程序(sub-routine),在該等子程序中的某些個特定子程序中,例如需執行冗長測試步驟的子程序,通常會分別加入一除錯訊息(debug message)。當BIOS在執行每一子程序時,只要該子程序具有除錯訊息,電腦就會將所執行的子程序的對應除錯訊息輸出,如此電腦因執行某個特定子程序時發生錯誤而停止時可由所輸出的除錯訊息而得知該個特定子程序執行時發生錯誤,以便後續針對該個特定子程序進行除錯。When the information processing system of a computer is reset or started, for example, a Basic Input/Output System (hereinafter referred to as BIOS) installed in the computer performs a plurality of test programs for the computer hardware, that is, for example, a processor, Check and test the computer hardware such as the motherboard and memory. In general, each test program has multiple sub-routines. In some specific subroutines of the subroutines, for example, subroutines that need to perform lengthy test steps are usually added to a debugger. Message (debug message). When the BIOS executes each subroutine, as long as the subroutine has a debugging message, the computer will output the corresponding debugging message of the executed subroutine, so that the computer stops when an error occurs when executing a specific subroutine. It is known from the output of the debug message that an error occurs when the particular subroutine is executed, so as to subsequently debug the specific subroutine.
現有的測試程序中只在某些特定子程序具有除錯訊息。然而,當發生錯誤的子程序並非該等具有除錯訊息的特定子程序時,因為沒有被加入除錯訊息,即便該發生錯誤的子程序被執行,也不會有除錯訊息被輸出,導致無法得知是哪個子程序發生錯誤。為避免這樣的情形發生,另一個作法是盡可能的在所有的子程序中都加入除錯訊息,但是依據現有的機制,若在全部的子程序都加入除錯訊息,則因為每一個子程序只要被執行就會輸出除錯訊息,造成傳輸資訊大量增加而使傳輸速度變慢,BIOS執行測試的速度也相對變慢,甚至會因為大量傳輸資料而產生錯誤。In the existing test program, only some specific subroutines have debug messages. However, when the subroutine in which the error occurs is not the specific subroutine with the debug message, since the debug message is not added, even if the subroutine in which the error occurred is executed, no debug message is output, resulting in It is impossible to know which subroutine has an error. In order to avoid such a situation, another way is to add debug messages to all subroutines as much as possible, but according to the existing mechanism, if all the subroutines add debug messages, because each subroutine As long as it is executed, it will output a debugging message, causing a large increase in the transmission information and slowing down the transmission speed. The BIOS performs the test at a relatively slow speed, and even generates errors due to a large amount of data transmission.
因此,如何改善上述缺點,遂成為本案進一步要探討的主題。Therefore, how to improve the above shortcomings has become a topic to be further explored in this case.
因此,本發明之目的,即在提供一種用於基本輸入輸出系統之除錯訊息輸出方法。Accordingly, it is an object of the present invention to provide a method of outputting a debug message for a basic input/output system.
於是,本發明用於基本輸入輸出系統之除錯訊息輸出方法,藉由一電腦裝置來實施,該基本輸入輸出系統包含多個測試程序,每一測試程序包括多個子程序,每一子程序包含一對應的除錯指令,每一子程序之該除錯指令相關於一具有一唯一代碼的除錯訊息,該方法包含以下步驟:Therefore, the method for outputting a debug message for a basic input/output system of the present invention is implemented by a computer device. The basic input/output system includes a plurality of test programs, each test program includes a plurality of subprograms, each subprogram includes A corresponding debug instruction, the debug instruction of each subroutine is related to a debug message having a unique code, and the method comprises the following steps:
在執行到一測試程序中的一子程序時,至少根據一特定判斷條件及該子程序所對應的該除錯指令所相關的該除錯訊息之該代碼,判定是否輸出該子程序所對應的該除錯指令所相關的該除錯訊息。When executing a subroutine in a test program, determining whether to output the subroutine according to at least one specific judgment condition and the code of the debug message associated with the debug command corresponding to the subroutine The debug message associated with the debug command.
本發明之功效在於:在每一子程序包含一對應的除錯指令的環境下,藉由該電腦裝置,至少根據該特定判斷條件及該除錯指令所相關的該除錯訊息之該代碼,判定是否輸出該子程序所對應的該除錯指令所相關的該除錯訊息。因此,在每一子程序包含一對應的除錯指令的環境下,能解決因為沒有除錯訊息而導致無法得知是哪個子程序發生錯誤的問題。此外,藉由有條件的輸出除錯訊息,能有效地增加BIOS執行測試的速度。The effect of the present invention is that, in the environment that each subroutine includes a corresponding debug command, the computer device, at least according to the specific judgment condition and the code of the debug message related to the debug command, Determining whether to output the debug message related to the debug command corresponding to the subroutine. Therefore, in the environment where each subroutine includes a corresponding debug command, it can solve the problem that it is impossible to know which subroutine has an error because there is no debug message. In addition, by conditionally outputting debug messages, the speed at which the BIOS performs tests can be effectively increased.
參閱圖1,說明了一用來實施本發明實施例的一種用於基本輸入輸出系統(Basic Input/Output System,在下簡稱BIOS)之除錯訊息輸出方法的電腦裝置1。例如,該電腦裝置1可包含一儲存單元11、一處理單元12及一使用者輸入介面14。Referring to FIG. 1, a computer apparatus 1 for implementing a method for outputting a debug message for a basic input/output system (hereinafter referred to as BIOS) for implementing an embodiment of the present invention is illustrated. For example, the computer device 1 can include a storage unit 11, a processing unit 12, and a user input interface 14.
該儲存單元11儲存有該BIOS,該BIOS包含多個測試程序,每一測試程序包括多個子程序,每一子程序包含一對應的除錯指令,每一子程序之該除錯指令相關於一具有一唯一代碼的除錯訊息,且每一子程序之該除錯指令包含一確認碼。The storage unit 11 stores the BIOS, the BIOS includes a plurality of test programs, each test program includes a plurality of sub-programs, each sub-program includes a corresponding debug command, and the debug command of each sub-program is related to one A debug message having a unique code, and the debug command of each subroutine includes a confirmation code.
該處理單元12電連接該儲存單元11及該使用者輸入介面14。The processing unit 12 is electrically connected to the storage unit 11 and the user input interface 14 .
參閱圖1與圖2,示例說明了該電腦裝置1如何實施本發明實施例一種用於BIOS之除錯訊息輸出方法。在此實施例中,例如,該BIOS一共有N個子程序,而該處理單元12將依序執行該等測試程序,並在執行每一測試程序期間依序執行該測試程序的該等子程序。值得注意的是,本實施例該除錯訊息輸出方法,例如在該BIOS未接收到來自該電腦裝置1之作業系統(operating system, OS)(未示出)或該使用者輸入介面14的任何相關執行請求下,將會依序執行該BIOS的所有子程序,其中”i”被定義為該處理單元12當前所執行的第i個子程序。Referring to FIG. 1 and FIG. 2, an example of how the computer device 1 implements a debug message output method for a BIOS according to an embodiment of the present invention is illustrated. In this embodiment, for example, the BIOS has a total of N subroutines, and the processing unit 12 will execute the test programs in sequence, and sequentially execute the subroutines of the test program during execution of each test program. It should be noted that the debug message output method in this embodiment, for example, does not receive any operating system (OS) (not shown) or the user input interface 14 from the computer device 1 in the BIOS. Under the relevant execution request, all subroutines of the BIOS will be executed in sequence, where "i" is defined as the i th subroutine currently executed by the processing unit 12.
在步驟201中,初始時,該處理單元12執行第1個子程序,也就是i=1。In step 201, initially, the processing unit 12 executes the first subroutine, i.e., i=1.
在步驟202中,該處理單元12判斷第i個子程序之該除錯指令中所包含的該確認碼與一預設碼是否匹配。若判斷結果為肯定時,亦即二者間存在一匹配時,流程進行步驟203。否則,流程進行步驟205。在本實施例中,該處理單元12亦可將該確認碼儲存於該儲存單元11,例如儲存在該儲存單元11中的一由互補式金屬氧化物半導體(Complementary Metal-Oxide-Semiconductor, CMOS)所組成的隨機存取記憶體(Random Access Memory, RAM)或一暫存器(未示出)。另一方面,該預設碼可藉由例如一經由外接的目標探針(In-target probe, ITP)或是擴展除錯埠(extended debug port, XDP)所連接的除錯設備(未示出),在該處理單元12中斷子程序之執行或執行完所有子程序後,根據該使用者輸入介面14所產生的輸入信號來設定該預設碼例如為1。然而,在某些實施例中,該預設碼亦可被設定為0。In step 202, the processing unit 12 determines whether the confirmation code included in the debug command of the i-th sub-program matches a preset code. If the result of the determination is affirmative, that is, if there is a match between the two, the flow proceeds to step 203. Otherwise, the flow proceeds to step 205. In this embodiment, the processing unit 12 may also store the confirmation code in the storage unit 11, for example, a complementary metal-oxide-semiconductor (CMOS) stored in the storage unit 11. The composition is a random access memory (RAM) or a register (not shown). On the other hand, the preset code can be connected to the debug device via an external target probe (ITP) or an extended debug port (XDP), for example (not shown). After the processing unit 12 interrupts execution of the subroutine or executes all subroutines, the preset code is set to 1, for example, according to an input signal generated by the user input interface 14. However, in some embodiments, the preset code can also be set to zero.
在步驟203中,該處理單元12判斷該第i個子程序之該除錯指令所相關的該除錯訊息之該代碼與一特定判斷條件所包含的多個不同的條件碼間是否存在一匹配。若判斷結果為肯定時,流程進行步驟204,否則,流程進行步驟205。In step 203, the processing unit 12 determines whether there is a match between the code of the debug message related to the debug command of the i-th sub-program and a plurality of different condition codes included in a specific judgment condition. If the result of the determination is affirmative, the process proceeds to step 204. Otherwise, the flow proceeds to step 205.
在步驟204中,當該處理單元12判斷出該第i個子程序之該除錯指令中所包含的該確認碼與該預設碼匹配,同時亦判斷出該第i個子程序之該除錯指令所相關的該除錯訊息之該代碼與該特定判斷條件所包含的該等條件碼間存在一匹配時,較佳地,該處理單元12不僅將該第i個子程序之該除錯指令所相關的該除錯訊息輸出至例如一外部顯示器(未示出),還將該第i個子程序一併輸出至該外部顯示器,以致該第i個子程序與該除錯訊息可一起被顯示在該外部顯示器以供使用者觀看,但不以此為限。值得注意的是,在其他實施例中,該處理單元12可僅將該第i個子程序之該除錯指令所相關的該除錯訊息輸出至一外部的顯示器或電腦(未示出)。In step 204, the processing unit 12 determines that the confirmation code included in the debugging instruction of the i-th sub-program matches the preset code, and also determines the debugging instruction of the i-th sub-program. When there is a match between the code of the related debug message and the condition code included in the specific judgment condition, preferably, the processing unit 12 is not only related to the debug command of the i-th sub-program. And outputting the debug message to, for example, an external display (not shown), and outputting the i-th sub-program to the external display, so that the i-th sub-program and the debug message can be displayed together on the external The display is for the user to watch, but is not limited to this. It should be noted that in other embodiments, the processing unit 12 may output only the debug message associated with the debug command of the i-th sub-program to an external display or computer (not shown).
跟隨在步驟202-204之後的步驟205中,該處理單元12判斷該處理單元12該第i個子程序是否為第N個子程序,亦即判斷是否i=N。若判斷結果為肯定時,流程結束。否則,流程進行步驟206。Following step 205 following steps 202-204, the processing unit 12 determines whether the i th subroutine of the processing unit 12 is the Nth subroutine, that is, whether i=N. If the result of the judgment is affirmative, the flow ends. Otherwise, the flow proceeds to step 206.
在步驟206中,該處理單元12執行第(i+1)個子程序,亦即將i設為i+1。之後,重複步驟202-206直到i=N。In step 206, the processing unit 12 executes the (i+1)th subroutine, that is, i is set to i+1. Thereafter, steps 202-206 are repeated until i=N.
值得注意的是,在本實施例中,圖2之步驟203中所提及的該等條件碼例如可預先儲存在該儲存單元11中。然而,在實際使用時,該處理單元12例如可在執行到某個測試程序發生錯誤而停止處理時,根據該外部顯示器所顯示之所有除錯訊息及子程序並經由該使用者輸入介面14之人為輸入操作來更新該特定條件。如此,可有效且確實地判定出哪一個子程序發生錯誤並可減少習知用於輸出與顯示每一子程序之除錯訊息所浪費的資源。It should be noted that, in this embodiment, the condition codes mentioned in step 203 of FIG. 2 may be stored in the storage unit 11 in advance, for example. However, in actual use, the processing unit 12 can, for example, execute all the debugging messages and subroutines displayed by the external display and execute the user input interface 14 when an error occurs in a certain test program. A human input operation updates the specific condition. In this way, it is possible to effectively and surely determine which subroutine has an error and reduce the resources that are conventionally used to output and display the debug information of each subroutine.
另外,值得注意的是,在其他實施例中,例如圖2中的步驟202可被省略,而該處理單元12只須在步驟203中判斷出該第i個子程序之該除錯指令所相關的該除錯訊息之該代碼與該特定判斷條件所包含的該等條件碼間存在一匹配時,就執行步驟204。In addition, it should be noted that in other embodiments, for example, step 202 in FIG. 2 may be omitted, and the processing unit 12 only needs to determine in step 203 that the debug instruction of the i-th sub-program is related. When there is a match between the code of the debug message and the condition codes included in the specific judgment condition, step 204 is performed.
此外,值得注意的是,若在執行圖2之程序期間,當該處理單元12接收到來自該OS或該使用者輸入介面14的一相關於特定測試程序或特定子程序之執行請求時,該處理單元12將不再依序執行剩下的子程序。在此情況下,此執行請求被視作一動態或選擇性執行請求,並且該處理單元12將優先執行該執行請求所相關的該特定測試程序或該特定子程序。如此,該特定測試程序或該特定子程序有可能是之前已執行過的測試程序或子程序,並且該處理單元12回應於該執行請求,將會再一次執行該執行過的特定測試程序或特定子程序,但不以此為限。In addition, it is worth noting that, during execution of the procedure of FIG. 2, when the processing unit 12 receives an execution request from the OS or the user input interface 14 relating to a particular test program or a particular subroutine, Processing unit 12 will no longer execute the remaining subroutines in sequence. In this case, the execution request is treated as a dynamic or selective execution request, and the processing unit 12 will prioritize execution of the particular test program or the particular subroutine to which the execution request is associated. As such, the specific test program or the specific subroutine may be a test program or a subroutine that has been executed before, and the processing unit 12, in response to the execution request, will execute the executed specific test program or specific once again. Subprogram, but not limited to this.
綜上所述,在每一子程序包含一對應的除錯指令的環境下,藉由該處理單元12,該電腦裝置1之該處理單元12根據該特定條件及該除錯指令所相關的該除錯訊息之該代碼,及該除錯指令所包含的該確認碼及該預設碼,判定是否輸出該除錯指令所相關的該除錯訊息。因此,在每一子程序包含一對應的除錯指令的環境下,本發明之除錯訊息輸出方法能解決因為沒有輸出除錯訊息而導致無法得知是哪個子程序發生錯誤的問題。此外,藉由有條件的輸出除錯訊息,能有效地增加BIOS執行測試的速度。In summary, in the environment that each subroutine includes a corresponding debug command, the processing unit 12 of the computer device 1 according to the specific condition and the debug command is associated with the processing unit 12. The code of the debug message, and the confirmation code and the preset code included in the debug command, determine whether to output the debug message related to the debug command. Therefore, in the environment where each subroutine includes a corresponding debug command, the debug message output method of the present invention can solve the problem that it is impossible to know which subroutine has an error because no debug message is output. In addition, by conditionally outputting debug messages, the speed at which the BIOS performs tests can be effectively increased.
惟以上所述者,僅為本發明之實施例而已,當不能以此限定本發明實施之範圍,凡是依本發明申請專利範圍及專利說明書內容所作之簡單的等效變化與修飾,皆仍屬本發明專利涵蓋之範圍內。However, the above is only the embodiment of the present invention, and the scope of the invention is not limited thereto, and all the equivalent equivalent changes and modifications according to the scope of the patent application and the patent specification of the present invention are still The scope of the invention is covered.
1‧‧‧電腦裝置
14‧‧‧使用者輸入介面
11‧‧‧儲存單元
201~206‧‧‧步驟
12‧‧‧處理單元
1‧‧‧Computer equipment
14‧‧‧User input interface
11‧‧‧ storage unit
201~206‧‧‧Steps
12‧‧‧Processing unit
本發明之其他的特徵及功效,將於參照圖式的實施方式中清楚地呈現,其中: 圖1是一方塊圖,示例說明一電腦裝置,其用來實施本發明實施例之一用於基本輸入輸出系統之除錯訊息輸出方法;及 圖2是一流程圖,示例說明圖1之電腦裝置如何實施本發明實施例之除錯訊息輸出方法。Other features and advantages of the present invention will be apparent from the embodiments of the present invention. FIG. 1 is a block diagram illustrating a computer apparatus for performing one of the embodiments of the present invention. A method for outputting a debug message of an input/output system; and FIG. 2 is a flowchart illustrating an example of how the computer device of FIG. 1 implements a debug message output method according to an embodiment of the present invention.
201~206‧‧‧步驟 201~206‧‧‧Steps
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW105101674A TWI566179B (en) | 2016-01-20 | 2016-01-20 | Debug Message Outputting Method and Computer Program Product for BIOS |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW105101674A TWI566179B (en) | 2016-01-20 | 2016-01-20 | Debug Message Outputting Method and Computer Program Product for BIOS |
Publications (2)
Publication Number | Publication Date |
---|---|
TWI566179B TWI566179B (en) | 2017-01-11 |
TW201727482A true TW201727482A (en) | 2017-08-01 |
Family
ID=58407956
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW105101674A TWI566179B (en) | 2016-01-20 | 2016-01-20 | Debug Message Outputting Method and Computer Program Product for BIOS |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI566179B (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI259358B (en) * | 2004-04-16 | 2006-08-01 | Quanta Comp Inc | A system and a method for decoding port data |
TW200821822A (en) * | 2006-11-15 | 2008-05-16 | Inventec Corp | Power on self test method |
TW201217965A (en) * | 2010-10-26 | 2012-05-01 | Top Victory Invest Ltd | executing the debug instructions to check whether the error of the video processing module is matched with the error types corresponding to the debug instructions |
TWI533122B (en) * | 2012-01-05 | 2016-05-11 | 緯創資通股份有限公司 | Boot detecting circuit, computer system and boot detecting method thereof |
-
2016
- 2016-01-20 TW TW105101674A patent/TWI566179B/en not_active IP Right Cessation
Also Published As
Publication number | Publication date |
---|---|
TWI566179B (en) | 2017-01-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9921949B2 (en) | Software testing | |
JP4472615B2 (en) | Programmable device modeling method and apparatus | |
US9886294B2 (en) | Method and device for testing an electronic control unit using a simulator running on a computer of different core type | |
JP5270330B2 (en) | Multicore microcomputer system simulation method and simulation apparatus | |
EP2204738A2 (en) | Method and system for performing software verification | |
US9678816B2 (en) | System and method for injecting faults into code for testing thereof | |
US8868976B2 (en) | System-level testcase generation | |
US9792402B1 (en) | Method and system for debugging a system on chip under test | |
US10698805B1 (en) | Method and system for profiling performance of a system on chip | |
US9262305B1 (en) | Simulation observability and control of all hardware and software components of a virtual platform model of an electronics system | |
US20100280817A1 (en) | Direct pointer access and xip redirector for emulation of memory-mapped devices | |
US10229033B2 (en) | System, method and apparatus for debugging of reactive applications | |
CN114328045A (en) | I2C debugging method, system and device for BMC and computer readable storage medium | |
JP5452336B2 (en) | Peripheral device failure simulation system, peripheral device failure simulation method, and peripheral device failure simulation program | |
AU2017438670B2 (en) | Simulation device, simulation method, and simulation program | |
TWI566179B (en) | Debug Message Outputting Method and Computer Program Product for BIOS | |
JP2019179284A (en) | Simulation system and simulation program | |
CN114968751A (en) | Program debugging method and program debugging device of code-free development platform | |
JP2010244376A (en) | Software development device, and debugging method using the same | |
US10296432B2 (en) | Systems and methods for invasive debug of a processor without processor execution of instructions | |
Chopey et al. | The model of software execution time remote testing | |
US8914274B1 (en) | Method and system for instruction set simulation with concurrent attachment of multiple debuggers | |
JP2006323726A (en) | Monitor program and real-time trace system | |
JP2005353020A (en) | Simulation system for computer program | |
US20230376403A1 (en) | Debug device, debug system, and debug method for testing storage device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | Annulment or lapse of patent due to non-payment of fees |