TWI427536B - System and apparatus for deleting and writing data of dmi in the linux operation system - Google Patents
System and apparatus for deleting and writing data of dmi in the linux operation system Download PDFInfo
- Publication number
- TWI427536B TWI427536B TW98102395A TW98102395A TWI427536B TW I427536 B TWI427536 B TW I427536B TW 98102395 A TW98102395 A TW 98102395A TW 98102395 A TW98102395 A TW 98102395A TW I427536 B TWI427536 B TW I427536B
- Authority
- TW
- Taiwan
- Prior art keywords
- pnp
- data
- module
- virtual
- space
- Prior art date
Links
Landscapes
- Debugging And Monitoring (AREA)
Description
本發明涉及一種資料擦寫的方法及裝置,尤其涉及一種DMI資料擦寫的方法及裝置。 The invention relates to a method and a device for erasing data, in particular to a method and a device for erasing DMI data.
DMI(Desktop Management interface,桌面管理介面)是幫助收集電腦系統資訊的管理系統,用來儲存電腦系統自身及週邊的相關資料,這些資料包括主板序列號(Serial Number),主辦生產廠商(Manufacture),電腦系統每次引導、啟動、關閉時硬體的故障資訊(Event Log)等。 DMI (Desktop Management Interface) is a management system that helps collect information about computer systems. It is used to store information about the computer system itself and its surrounding areas. This information includes the serial number of the motherboard and the manufacturer (Manufacture). The hardware event information (Event Log) of the computer system each time it boots, starts, and shuts down.
DMI通常將上述資料保存在BIOS(Basic Input Output System,基本輸入輸出系統)中一個4KB大小的資料區域中,這一資料區域通常被稱為MIFD(Management Information Format Database,管理資訊格式資料庫)中。 DMI usually saves the above data in a 4KB data area in the BIOS (Basic Input Output System). This data area is usually called MIFD (Management Information Format Database). .
訪問DMI MIFD中資料的方式有兩種。第一種方式是基於列表的方法(Table-based Method),第二種方式是透過即插即用的功能介面(Plug-and-Play function interface)。其中,第一種方式只提供查看MIFD資料的功能,並不能擦寫MIFD中的資料。第二種方式透過PnP(Plug-and-Play,即插即用)調用常式(Calling Convention)可以擦寫MIFD資料。然而,PnP調用常式 只能在實模式(Real-mode)與16位元保護模式(16-bit protected mode)系統下可用。DOS系統是16位元實模式,可以直接調用PnP調用常式。DOS系統下擦寫DMI MIFD資料就是透過第二種方式實現的。 There are two ways to access data in the DMI MIFD. The first method is a Table-based Method, and the second is through a Plug-and-Play function interface. Among them, the first method only provides the function of viewing MIFD data, and can not erase the data in MIFD. The second way is to erase the MIFD data by calling the PnP (Plug-and-Play) call to the Calling Convention. However, the PnP call routine It is only available in Real-mode and 16-bit protected mode systems. The DOS system is a 16-bit real mode that can directly call the PnP call routine. The DMI MIFD data is erased under the DOS system through the second method.
然而,Linux系統是32位元保護模式(32-bit protected mode),其不能直接調用PnP調用常式。如上所述,主板序列號(Serial Number)、主板生產廠商(Manufacture)、電腦系統每次引導、啟動、關閉時硬體的故障資訊(Event Log)都是DMI MIFD中的資料。以下,分別以清除主板Event Log與燒寫主板的序列號為例說明Linux系統下擦寫DMI MIFD資料的方法。 However, the Linux system is a 32-bit protected mode, which cannot directly call the PnP call routine. As mentioned above, the serial number of the motherboard, the manufacturer of the motherboard, and the event log of the hardware system each time the computer system boots, starts, and shuts down are the data in the DMI MIFD. In the following, the method of erasing the DMI MIFD data under the Linux system is illustrated by taking the serial number of the main board Event Log and the programming main board as an example.
主板Event Log記載了系統每次引導、啟動、關閉時的硬體故障資訊,透過查看此記錄即可知道異常情況的原因及時間等資訊,為解決該異常問題提供了依據。然而,Event Log的儲存區域有限,當儲存區域存滿了之後,系統進行引導、啟動等操作時就會報出錯資訊,要求清除以前的Event Log。此外,當主板出廠之前,製造商也會清除Event Log。傳統的清除Event Log的方法有:一是進入BIOS頁面執行BIOS廠商提供的Configuration/Setup Utility工具清除Event Log;二是安裝DOS系統,在DOS系統下直接調用PnP調用常式來清除Event Log。 The main board Event Log records the hardware fault information every time the system boots, starts, and shuts down. By viewing this record, you can know the cause and time of the abnormal situation, and provide a basis for solving the abnormal problem. However, the Event Log has a limited storage area. When the storage area is full, the system will report an error message when booting, starting, etc., and request to clear the previous Event Log. In addition, the manufacturer will also clear the Event Log before the motherboard is shipped. The traditional methods for clearing Event Log are as follows: First, enter the BIOS page to execute the Configuration/Setup Utility tool provided by the BIOS manufacturer to clear the Event Log; second, install the DOS system, and directly call the PnP call routine to clear the Event Log under the DOS system.
生產廠商在制作主板過程中要燒寫主板序列號。目前燒寫主板序列號的方法也是透過安裝DOS系統,在DOS系統下直接調用PnP調用常式來執行燒寫的動作。 The manufacturer must write the serial number of the motherboard during the process of making the motherboard. At present, the method of programming the serial number of the motherboard is also to install the DOS system, and directly call the PnP calling routine to perform the programming operation under the DOS system.
上述對DMI MIFD資料的清除或者燒寫要麼需要進入BIOS介面,要麼需要另外的安裝DOS系統,無疑都是非常麻煩的。此外,由於 DOS系統是一種單線程的作業系統,因此,在DOS系統下進行燒寫動作,如果被燒寫的資料錯誤,執行燒寫動作後,經常會出現當機現象。 The above clearing or programming of the DMI MIFD data either needs to enter the BIOS interface, or requires additional installation of the DOS system, which is undoubtedly very troublesome. In addition, due to The DOS system is a single-threaded operating system. Therefore, in the DOS system, the programming operation is performed. If the data to be written is incorrect, the burning phenomenon often occurs after the burning operation is performed.
鑒於以上內容,有必要提出一種實現Linux系統下擦寫DMI資料的方法及裝置,其可以在Linux作業系統下調用PnP調用常式以實現DMI MIFD中資料的擦寫。 In view of the above, it is necessary to propose a method and device for implementing DMI data in a Linux system, which can call the PnP calling routine in the Linux operating system to implement data erasing in the DMI MIFD.
一種實現Linux系統下擦寫DMI資料的方法。該方法包括:創建一個新進程;映射BIOS的中斷向量表及BIOS資料到該進程底部的一段空間;在上述空間內選擇一段小於該空間的子空間,作為虛擬8086模式的系統堆疊空間,並將該系統堆疊空間的位址賦給該進程的上下文;從BIOS的物理位址中透過字串比對的方法尋找一個PnP標籤,以在緊挨著該PnP標籤的一個資料結構中找到PnP調用常式的入口點;設置IO操作的允許許可權,以使PnP調用常式能夠進行輸入/輸出操作;接收16位元參數,將該16位元參數轉換為32位元,並將該參數儲存到上述的系統堆疊空間;設置虛擬8086的運行環境,並將該運行環境賦給該進程的上下文;設置訊號阻塞,以防止其他進程的訊號打斷該進程向虛擬8086模式跳轉的操作;及利用Linux系統內核所提供的虛擬8086系統調用函數使該進程進入到虛擬8086模式,並執行PnP調用常式以從上述系統堆疊空間中讀出所述參數,並根據該參數對DMI資料進行擦寫操作。 A method for erasing DMI data under Linux system. The method includes: creating a new process; mapping a BIOS interrupt vector table and BIOS data to a space at the bottom of the process; selecting a subspace smaller than the space in the space as a system stack space of the virtual 8086 mode, and The address of the stack space of the system is assigned to the context of the process; a PnP tag is searched through the string alignment method from the physical address of the BIOS to find a PnP call in a data structure next to the PnP tag. Entry point; set the permission permission for IO operations so that the PnP call routine can perform input/output operations; receive 16-bit parameters, convert the 16-bit parameters to 32-bit, and store the parameters to The above system stacking space; setting the operating environment of the virtual 8086, and assigning the running environment to the context of the process; setting the signal blocking to prevent other processes from interrupting the process to jump to the virtual 8086 mode; and utilizing Linux The virtual 8086 system call function provided by the system kernel causes the process to enter the virtual 8086 mode and executes the PnP call routine to populate the above system. The parameter is read out in the stack space, and the DMI data is erased according to the parameter.
一種實現Linux系統下擦寫DMI資料的裝置。該裝置包括:進程創建模組,用於創建一個新進程;虛擬8086記憶體環境構造模組, 用於映射BIOS的中斷向量表及BIOS資料到上述進程底部的一段空間;堆疊空間構建模組,用於在該空間內選擇一段小於該空間的子空間作為虛擬8086模式的系統堆疊空間,並將該系統堆疊空間的位址賦給該進程的上下文;入口點尋找模組,用於從BIOS的物理位址中透過字串比對的方法尋找一個PnP標籤,以在緊挨著該PnP標籤的一個資料結構中找到PnP調用常式的入口點;許可權設置模組,用於設置IO操作的允許許可權,以使PnP調用常式能夠進行輸入/輸出操作;參數儲存模組,用於接收16位元參數,將該16位元參數轉換為32位元,並將該參數儲存到上述的系統堆疊空間;運行環境設置模組,用於設置虛擬8086的運行環境,並將該運行環境賦給該進程的上下文;訊號阻塞設置模組,用於設置訊號阻塞,以防止其他進程的訊號打斷該進程向虛擬8086模式跳轉的操作;及函數調用模組,用於利用Linux系統內核所提供的虛擬8086系統調用函數使該進程進入虛擬8086模式,並執行PnP調用常式以從上述系統堆疊空間中讀出所述參數,並根據該參數對DMI資料進行擦寫操作。 A device for erasing DMI data under a Linux system. The device includes: a process creation module for creating a new process; a virtual 8086 memory environment construction module, The interrupt vector table and the BIOS data for mapping the BIOS to a space at the bottom of the process; the stack space building module is configured to select a subspace smaller than the space in the space as the system stack space of the virtual 8086 mode, and The address of the stacking space of the system is assigned to the context of the process; the entry point finding module is configured to search for a PnP label from the physical address of the BIOS through a string alignment method, so as to be next to the PnP label. The entry point of the PnP calling routine is found in a data structure; the permission setting module is used to set the permission permission of the IO operation, so that the PnP calling routine can perform input/output operations; the parameter storage module is configured to receive 16-bit parameter, the 16-bit parameter is converted into 32-bit, and the parameter is stored in the above-mentioned system stacking space; the operating environment setting module is used to set the operating environment of the virtual 8086, and the operating environment is assigned The context of the process; the signal blocking setting module is used to set the signal blocking to prevent other processes from interrupting the process to jump to the virtual 8086 mode; and The calling module is used to make the process enter the virtual 8086 mode by using the virtual 8086 system calling function provided by the Linux system kernel, and execute the PnP calling routine to read the parameter from the above system stacking space, and according to the parameter Write and erase DMI data.
相較於習知技術,本發明所提供之實現Linux系統下擦寫DMI資料的方法及裝置可以在Linux作業系統下調用PnP調用常式以實現DMI MIFD中資料的擦寫,節省了時間與操作,並且即使資料燒寫錯誤也不會出現當機的現象。 Compared with the prior art, the method and device for implementing the DMI data in the Linux system can be called by the PnP calling routine in the Linux operating system to implement data erasing in the DMI MIFD, saving time and operation. And even if the data is programmed incorrectly, there will be no crash.
1‧‧‧電腦 1‧‧‧ computer
100‧‧‧進程創建模組 100‧‧‧Process Creation Module
101‧‧‧虛擬8086記憶體環境構造模組 101‧‧‧Virtual 8086 Memory Environment Construction Module
102‧‧‧堆疊空間構建模組 102‧‧‧Stacking space building module
103‧‧‧入口點尋找模組 103‧‧‧Entry Point Search Module
104‧‧‧許可權設置模組 104‧‧‧Permission Setting Module
105‧‧‧參數儲存模組 105‧‧‧Parameter storage module
106‧‧‧運行環境設置模組 106‧‧‧Running environment setting module
107‧‧‧訊號阻塞設置模組 107‧‧‧Signal blocking setting module
108‧‧‧函數調用模組 108‧‧‧ function call module
109‧‧‧判斷模組 109‧‧‧Judgement module
110‧‧‧提示模組 110‧‧‧ prompt module
20‧‧‧BIOS 20‧‧‧BIOS
200‧‧‧MIFD 200‧‧‧MIFD
圖1係本發明實現Linux系統下擦寫DMI資料的裝置較佳實施例的結構圖。 FIG. 1 is a structural diagram of a preferred embodiment of an apparatus for erasing DMI data in a Linux system according to the present invention.
圖2係本發明實現Linux系統下擦寫DMI資料的方法較佳實施例的 實施流程圖。 2 is a schematic diagram of a preferred embodiment of a method for erasing DMI data in a Linux system according to the present invention Implement the flow chart.
參閱圖1所示,係本發明實現Linux系統下擦寫DMI資料的裝置較佳實施例的結構圖。該裝置可能是一台電腦1,或者是手機、伺服器、PDA(Personal Digital Assistant,個人數位助理)等。本實施例中,該裝置以電腦1為例。該電腦1安裝有Linux作業系統。眾所周知,Linux是一種多工的作業系統,用戶可以同時運行多個應用程式,創建多個進程。該電腦1還包括BIOS(Basic Input Output System,基本輸入輸出系統)20。該BIOS 20中包括一個MIFD 200(Management Information Format Database,管理資訊格式資料庫)。 Referring to FIG. 1, a block diagram of a preferred embodiment of an apparatus for erasing DMI data in a Linux system is provided. The device may be a computer 1, or a mobile phone, a server, a PDA (Personal Digital Assistant), or the like. In this embodiment, the device takes the computer 1 as an example. The computer 1 is equipped with a Linux operating system. As we all know, Linux is a multiplexed operating system, users can run multiple applications at the same time, create multiple processes. The computer 1 also includes a BIOS (Basic Input Output System) 20. The BIOS 20 includes a MIFD 200 (Management Information Format Database).
該電腦1包括多個功能模組。所述功能模組是完成特定功能的各個程式段,比軟體程式本身更適合於描述軟體在電腦中的執行過程,因此本發明對軟體程式的描述都以模組描述。 The computer 1 includes a plurality of functional modules. The function module is a program segment for completing a specific function, and is more suitable for describing the execution process of the software in the computer than the software program itself. Therefore, the description of the software program in the present invention is described by a module.
所述多個功能模組主要包括:進程創建模組100、虛擬8086記憶體環境構造模組101、堆疊空間構建模組102、入口點尋找模組103、許可權設置模組104、參數儲存模組105、運行環境設置模組106、訊號阻塞設置模組107、函數調用模組108、判斷模組109及提示模組110。 The plurality of function modules mainly include: a process creation module 100, a virtual 8086 memory environment structure module 101, a stack space construction module 102, an entry point search module 103, a permission setting module 104, and a parameter storage module. The group 105, the operating environment setting module 106, the signal blocking setting module 107, the function calling module 108, the determining module 109, and the prompting module 110.
所述之進程創建模組100用於創建一個新進程。當該進程創建模組100透過偵測用戶的行為發現了要求創建新進程的事件後,便調用進程創建原語,按下述步驟創建一個新進程:(1)申請空白的進程控制塊(Process Control Block,簡稱PCB);(2)為新進程分配資源,為新進程的程式和資料以及用戶棧分配必要 的記憶體空間;(3)初始化進程控制塊;(4)將新進程插入就緒佇列。 The process creation module 100 is used to create a new process. When the process creation module 100 discovers an event requesting the creation of a new process by detecting the user's behavior, the process creation primitive is invoked, and a new process is created as follows: (1) Applying for a blank process control block (Process Control) Block, referred to as PCB); (2) allocate resources for new processes, allocate necessary programs and data for new processes, and user stacks Memory space; (3) initialize the process control block; (4) insert the new process into the ready queue.
所述之虛擬8086記憶體環境構造模組101用於映射BIOS 20的中斷向量表及BIOS 20的資料到上述進程底部的一段空間,如1MB,以構造適合虛擬8086模式運行的記憶體環境。 The virtual 8086 memory environment construction module 101 is configured to map the interrupt vector table of the BIOS 20 and the data of the BIOS 20 to a space at the bottom of the process, such as 1 MB, to construct a memory environment suitable for the virtual 8086 mode operation.
所述之堆疊空間構建模組102用於在上述進程底部的1MB空間內選擇一段小於1MB的子空間,例如7KB,作為虛擬8086模式的系統堆疊空間。所述系統堆疊空間是用於在函數調用時,暫存中斷點位址和保護(恢復)現場資料的空間。進一步地,該堆疊空間構建模組102將該系統堆疊空間的位址賦給該進程的上下文(下稱進程上下文)。所述進程上下文表示該進程的各種資訊,包括各種變數、寄存器以及進程的運行環境等。當進程被切換後,下次再切換回來繼續執行時,利用該進程上下文就能夠知道該進程原來執行的狀態。 The stack space building module 102 is configured to select a sub-space of less than 1 MB, for example, 7 KB, in a 1 MB space at the bottom of the process, as a system stack space of the virtual 8086 mode. The system stacking space is a space for temporarily storing the interrupt point address and protecting (restoring) the field data when the function is called. Further, the stack space building module 102 assigns the address of the system stack space to the context of the process (hereinafter referred to as a process context). The process context represents various information about the process, including various variables, registers, and the operating environment of the process. When the process is switched, the next time you switch back to continue execution, you can use the process context to know the state of the process.
所述之入口點尋找模組103用於從BIOS 20的物理位址f0000~fffff中透過字串比對的方法尋找一個PnP標籤“$PnP”。緊挨著該PnP標籤存放有一個資料結構,而該資料結構中標明了該PnP調用常式的16位元實模式的段位址和偏移位址,因此該入口點尋找模組103可以從該資料結構中找到PnP調用常式的入口點。 The entry point finding module 103 is configured to search for a PnP label "$PnP" from the physical address f0000~fffff of the BIOS 20 by means of string alignment. Next to the PnP tag, a data structure is stored, and the data structure indicates a segment address and an offset address of the 16-bit real mode of the PnP calling routine, so the entry point finding module 103 can The entry point of the PnP calling routine is found in the data structure.
所述之許可權設置模組104用於設置IO操作的允許許可權,以使PnP調用常式能夠進行輸入/輸出之操作。 The permission setting module 104 is configured to set an allow permission of the IO operation, so that the PnP calling routine can perform an input/output operation.
所述之參數儲存模組105用於接收16位元參數,將該16位元參數 轉換為32位元參數,並將該參數儲存到上述的系統堆疊空間。所述參數包括PnP子功能號,要向MIFD 200中寫入資料的資料類型及資料內容等。 The parameter storage module 105 is configured to receive a 16-bit parameter, and the 16-bit parameter Convert to a 32-bit parameter and store the parameter in the system stack space above. The parameters include a PnP sub-function number, a data type and a data content to be written into the MIFD 200.
所述之運行環境設置模組106用於設置虛擬8086的運行環境。該虛擬8086的運行環境包括系統級上下文、寄存器上下文的進程式控制塊、程式控制塊、各類控制寄存器等。進一步地,該運行環境設置模組106將該運行環境賦給進程上下文。 The running environment setting module 106 is configured to set an operating environment of the virtual 8086. The operating environment of the virtual 8086 includes a system level context, a process control block of a register context, a program control block, various control registers, and the like. Further, the runtime environment setting module 106 assigns the runtime environment to the process context.
所述之訊號阻塞設置模組107用於設置訊號阻塞,以防止其他進程的訊號打斷該進程向虛擬8086模式跳轉的操作。 The signal blocking setting module 107 is configured to set a signal blocking to prevent other processes' signals from interrupting the process to jump to the virtual 8086 mode.
所述之的函數調用模組108用於利用Linux系統的內核所提供的虛擬8086系統調用函數使該進程進入虛擬8086模式,並執行PnP調用常式。執行PnP調用常式後,該PnP調用常式就可以從上述的系統堆疊空間中將上述參數讀出,並根據該讀出的參數對MIFD 200中的資料執行對應的擦寫操作。 The function calling module 108 is configured to make the process enter the virtual 8086 mode by using the virtual 8086 system calling function provided by the kernel of the Linux system, and execute the PnP calling routine. After executing the PnP calling routine, the PnP calling routine can read the above parameters from the above-mentioned system stacking space, and perform corresponding erasing operations on the data in the MIFD 200 according to the read parameters.
所述之判斷模組109用於判斷CPU中的AX寄存器中的值是否為0。若成功執行了PnP調用常式,則該AX寄存器中的值為零,否則,若沒有成功執行PnP調用常式,則該AX寄存器中會被返回一個錯誤代碼。 The determining module 109 is configured to determine whether the value in the AX register in the CPU is 0. If the PnP call routine is successfully executed, the value in the AX register is zero. Otherwise, if the PnP call routine is not successfully executed, an error code will be returned in the AX register.
所述之提示模組110用於當判斷AX寄存器中的值不是0時,返回上述錯誤代碼,以提示用戶PnP調用常式沒有執行成功。 The prompting module 110 is configured to return the above error code when determining that the value in the AX register is not 0, to prompt the user that the PnP calling routine is not successfully executed.
參閱圖2所示,係本發明Linux系統下擦寫DMI資料的方法較佳實施例的實施流程圖。 Referring to FIG. 2, it is a flowchart of an implementation of a preferred embodiment of a method for erasing DMI data in a Linux system of the present invention.
步驟S10,進程創建模組100透過偵測用戶的行為發現要求創建新 進程的事件後,調用進程創建原語,按下述步驟創建一個新進程:(1)申請空白的進程控制塊(Process Control Block,簡稱PCB);(2)為新進程分配資源,為新進程的程式和資料以及用戶棧分配必要的記憶體空間。(3)初始化進程控制塊(4)將新進程插入就緒佇列。 In step S10, the process creation module 100 discovers that a new request is created by detecting the behavior of the user. After the event of the process, the calling process creates the primitive, and creates a new process by the following steps: (1) applying for a blank Process Control Block (PCB); (2) allocating resources for the new process, for the new process. The program and data and the user stack allocate the necessary memory space. (3) Initialize the process control block (4) Insert the new process into the ready queue.
步驟S11,虛擬8086記憶體環境構造模組101映射BIOS 20的中斷向量表及BIOS 20的資料到上述進程底部的一段空間,例如1MB,以構造適合虛擬8086模式運行的記憶體環境。 In step S11, the virtual 8086 memory environment structure module 101 maps the interrupt vector table of the BIOS 20 and the data of the BIOS 20 to a space at the bottom of the process, for example, 1 MB, to construct a memory environment suitable for the virtual 8086 mode operation.
步驟S12,堆疊空間構建模組102在上述進程底部的1MB空間內選擇一段小於1MB的子空間,例如7KB,作為虛擬8086模式的系統堆疊空間,並將該系統堆疊空間的位址賦給該進程的上下文(下稱進程上下文)。 In step S12, the stack space building module 102 selects a subspace smaller than 1 MB in the 1 MB space at the bottom of the process, for example, 7 KB, as a system stack space of the virtual 8086 mode, and assigns the address of the system stack space to the process. Context (hereinafter referred to as the process context).
步驟S13,入口點尋找模組103從BIOS的物理位址f0000~fffff中透過字串比對的方法尋找一個PnP標籤“$PnP”。 In step S13, the entry point finding module 103 searches for a PnP tag "$PnP" from the physical address f0000~fffff of the BIOS through a string alignment method.
步驟S14,入口點尋找模組103在緊挨著該PnP標籤存放的一個資料結構中找到PnP調用常式的16位元實模式的段位址和偏移位址,從而找到PnP調用常式的入口點。 Step S14, the entry point finding module 103 finds the segment address and the offset address of the 16-bit real mode of the PnP calling routine in a data structure stored next to the PnP tag, thereby finding the entry of the PnP calling routine. point.
步驟S15,許可權設置模組104設置IO操作的允許許可權,以使PnP調用常式能夠進行輸入/輸出操作。 In step S15, the permission setting module 104 sets the permission permission of the IO operation so that the PnP calling routine can perform an input/output operation.
步驟S16,參數儲存模組105接收16位元參數,將該16位元參數轉換為32位元參數。所述參數指PnP子功能號、要寫入到MIFD 200中的資料類型、資料內容等。 In step S16, the parameter storage module 105 receives the 16-bit parameter and converts the 16-bit parameter into a 32-bit parameter. The parameters refer to the PnP sub-function number, the type of data to be written into the MIFD 200, the data content, and the like.
步驟S17,該參數儲存模組105將該參數儲存到上述的系統堆疊空 間。 Step S17, the parameter storage module 105 stores the parameter to the above system stack. between.
步驟S18,運行環境設置模組106設置虛擬8086的運行環境,並將該運行環境賦給進程上下文。所述虛擬8086的運行環境包括系統級上下文、寄存器上下文的進程控制塊、程式控制塊、各類控制寄存器等。 In step S18, the running environment setting module 106 sets the running environment of the virtual 8086, and assigns the running environment to the process context. The operating environment of the virtual 8086 includes a system level context, a process control block of a register context, a program control block, various types of control registers, and the like.
步驟S19,訊號阻塞設置模組107設置訊號阻塞,以防止其他進程的訊號打斷該進程向虛擬8086模式跳轉的操作。 In step S19, the signal blocking setting module 107 sets the signal blocking to prevent other processes' signals from interrupting the process to jump to the virtual 8086 mode.
步驟S20,函數調用模組108利用Linux系統的內核所提供的虛擬8086系統調用函數使該進程進入虛擬8086模式,並執行PnP調用常式。執行PnP調用常式後,該PnP調用常式就可以從上述的系統堆疊空間中將上述參數讀出,並根據該參數對MIFD 200中的資料執行對應的擦寫操作。 In step S20, the function calling module 108 uses the virtual 8086 system calling function provided by the kernel of the Linux system to make the process enter the virtual 8086 mode and execute the PnP calling routine. After executing the PnP calling routine, the PnP calling routine can read the above parameters from the above-mentioned system stacking space, and perform corresponding erasing operations on the data in the MIFD 200 according to the parameters.
步驟S21,判斷模組109判斷AX寄存器中的值是否為0。若成功執行了PnP調用常式,則該AX寄存器中的值為0,否則,若沒有成功執行PnP調用常式,則該AX寄存器中會被返回一個錯誤代碼。 In step S21, the determination module 109 determines whether the value in the AX register is 0. If the PnP call routine is successfully executed, the value in the AX register is 0. Otherwise, if the PnP call routine is not successfully executed, an error code will be returned in the AX register.
若判斷模組109判斷AX寄存器中的值是0,則結束流程。 If the determination module 109 determines that the value in the AX register is 0, the flow is terminated.
否則,若判斷模組109判斷AX寄存器中的值不是0,則提示模組110返回上述錯誤代碼,以提示用戶PnP調用常式沒有執行成功,並結束流程。 Otherwise, if the determining module 109 determines that the value in the AX register is not 0, the prompting module 110 returns the above error code to prompt the user that the PnP calling routine has not been successfully executed, and ends the flow.
本發明所提供之Linux系統下擦寫DMI資料的方法及裝置,首先構建虛擬8086模式運行的記憶體環境,然後使CPU及記憶體運行環境等跳入該虛擬8086模式,執行PnP調用常式,執行完後返回Linux系統,這個過程並不需要安裝DOS系統,因而,節省了時間 與操作。此外,由於Linux系統是一種多工的作業系統,進程調度機制完備,系統更穩定。在Linux系統下進行燒寫動作,即使被燒寫的資料錯誤或者因為其他原因並沒有成功的執行PnP調用常式,系統仍能成功返回到Linux系統。系統並不會當機,因此,此種方法更安全。 The method and device for erasing DMI data in the Linux system provided by the present invention firstly construct a memory environment running in the virtual 8086 mode, and then jump the CPU and the memory operating environment into the virtual 8086 mode, and execute the PnP calling routine. After the execution, return to the Linux system, this process does not need to install the DOS system, thus saving time And operation. In addition, because the Linux system is a multiplexed operating system, the process scheduling mechanism is complete and the system is more stable. In the Linux system, the system can still successfully return to the Linux system even if the data being programmed is incorrect or the PnP calling routine is not successfully executed for other reasons. The system does not crash, so this method is more secure.
以上所述僅為本發明之較佳實施例而已,且已達廣泛之使用功效,凡其他未脫離本發明所揭示之精神下所完成之均等變化或修飾,均應該包含在下述之申請專利範圍內。 The above is only the preferred embodiment of the present invention, and has been used in a wide range of ways. Any other equivalent changes or modifications which are not departing from the spirit of the present invention should be included in the following claims. Inside.
1‧‧‧電腦 1‧‧‧ computer
100‧‧‧進程創建模組 100‧‧‧Process Creation Module
101‧‧‧虛擬8086記憶體環境構造模組 101‧‧‧Virtual 8086 Memory Environment Construction Module
102‧‧‧堆疊空間構建模組 102‧‧‧Stacking space building module
103‧‧‧入口點尋找模組 103‧‧‧Entry Point Search Module
104‧‧‧許可權設置模組 104‧‧‧Permission Setting Module
105‧‧‧參數儲存模組 105‧‧‧Parameter storage module
106‧‧‧運行環境設置模組 106‧‧‧Running environment setting module
107‧‧‧訊號阻塞設置模組 107‧‧‧Signal blocking setting module
108‧‧‧函數調用模組 108‧‧‧ function call module
109‧‧‧判斷模組 109‧‧‧Judgement module
110‧‧‧提示模組 110‧‧‧ prompt module
20‧‧‧BIOS 20‧‧‧BIOS
200‧‧‧MIFD 200‧‧‧MIFD
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW98102395A TWI427536B (en) | 2009-01-22 | 2009-01-22 | System and apparatus for deleting and writing data of dmi in the linux operation system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW98102395A TWI427536B (en) | 2009-01-22 | 2009-01-22 | System and apparatus for deleting and writing data of dmi in the linux operation system |
Publications (2)
Publication Number | Publication Date |
---|---|
TW201028924A TW201028924A (en) | 2010-08-01 |
TWI427536B true TWI427536B (en) | 2014-02-21 |
Family
ID=44853852
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW98102395A TWI427536B (en) | 2009-01-22 | 2009-01-22 | System and apparatus for deleting and writing data of dmi in the linux operation system |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI427536B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1455342A (en) * | 2003-05-23 | 2003-11-12 | 威盛电子股份有限公司 | Method of setting BIOS of CMOS for back-up computer system on DMI segment |
TWI221255B (en) * | 2003-05-09 | 2004-09-21 | Via Tech Inc | Device information management system of application device and method thereof |
TW200712867A (en) * | 2005-09-30 | 2007-04-01 | Hon Hai Prec Ind Co Ltd | System and method for keeping DMI dynamic information |
-
2009
- 2009-01-22 TW TW98102395A patent/TWI427536B/en not_active IP Right Cessation
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI221255B (en) * | 2003-05-09 | 2004-09-21 | Via Tech Inc | Device information management system of application device and method thereof |
CN1455342A (en) * | 2003-05-23 | 2003-11-12 | 威盛电子股份有限公司 | Method of setting BIOS of CMOS for back-up computer system on DMI segment |
TW200712867A (en) * | 2005-09-30 | 2007-04-01 | Hon Hai Prec Ind Co Ltd | System and method for keeping DMI dynamic information |
Also Published As
Publication number | Publication date |
---|---|
TW201028924A (en) | 2010-08-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102938039B (en) | For the selectivity file access of application | |
US7702894B2 (en) | System and method for loading programs from HDD independent of operating system | |
US8073673B2 (en) | Emulated memory management | |
EP2705422B1 (en) | Dynamically redirecting boot to another operating system | |
US7454547B1 (en) | Data exchange between a runtime environment and a computer firmware in a multi-processor computing system | |
US20080250165A1 (en) | USB port access management | |
US11586779B2 (en) | Embedded system and method | |
US8117432B2 (en) | Method for controlling boot sequence of server | |
CN114765051A (en) | Memory test method and device, readable storage medium and electronic equipment | |
US20120173842A1 (en) | Operating System Management of Address-Translation-Related Data Structures and Hardware Lookasides | |
KR102324950B1 (en) | A method and apparatus for efficiently detecting a vulnerability in a memory of a heap area | |
JP2009009232A (en) | Computer, kernel protection method, and computer software | |
US9727390B1 (en) | Invoking a firmware function | |
US8024362B2 (en) | System and method for erasing and writing desktop management interface data under a linux system | |
US10417121B1 (en) | Monitoring memory usage in computing devices | |
US8201175B2 (en) | Creating and associating a virtual pseudo TTY with a running process | |
TWI427536B (en) | System and apparatus for deleting and writing data of dmi in the linux operation system | |
CN113792299B (en) | Method for protecting Linux system based on ftrace technology | |
US7409691B2 (en) | Extending operating system subsystems | |
US7587722B2 (en) | Extending operating system subsystems | |
US20120124361A1 (en) | Plurality of interface files usable for access to bios | |
KR100901225B1 (en) | System for selectively enabling operating modes of a device | |
CN114296810A (en) | Operating system migration method, device, server and storage medium | |
CN112148450A (en) | Data processing method, device, equipment and storage medium | |
JPH11134204A (en) | Stack protecting device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | Annulment or lapse of patent due to non-payment of fees |