EP2047364A1 - A method to use global variables for pre-efi initialization modules in efi-based firmware - Google Patents
A method to use global variables for pre-efi initialization modules in efi-based firmwareInfo
- Publication number
- EP2047364A1 EP2047364A1 EP06761481A EP06761481A EP2047364A1 EP 2047364 A1 EP2047364 A1 EP 2047364A1 EP 06761481 A EP06761481 A EP 06761481A EP 06761481 A EP06761481 A EP 06761481A EP 2047364 A1 EP2047364 A1 EP 2047364A1
- Authority
- EP
- European Patent Office
- Prior art keywords
- driver image
- data
- code
- section
- round fixing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
Definitions
- the present invention is generally related to Firmware. More particularly, the present invention is related to a method to use global variables during a pre-EFI (pre-Extensible Firmware Interface) initialization phase of a Platform Innovation Framework for EFI.
- pre-EFI pre-Extensible Firmware Interface
- the Platform Innovation Framework for EFI (also referred to as "the Framework") is divided into two major phases: Pre-EFI initialization (PEI) phase and Driver Execution Environment (DXE) phase.
- PEI Pre-EFI initialization
- DXE Driver Execution Environment
- the PEI phase performs minimal processor, chipset and platform configuration to support memory discovery.
- the DXE phase furthers the PEI phase by completing the initialization of platform, processor and chipset devices.
- processor cache can be temporally initialized to act as RAM (Random Access Memory), thus, enabling the stack and heap to be stored in the cache. This provides the possibility for running high-level programming language compiled modules in the PEI phase.
- a known limitation in the framework is that modules in the PEI phase use global variables as read-only variables, i.e., the global variables cannot be modified. Since memory is not available in the PEI phase, all data and code segments are placed in Flash without relocation.
- PEI Pre-EFI Initialization
- FIG. 1 is a diagram illustrating an exemplary PE32 (Portable Executable
- FIG. 2 is a flow diagram describing an exemplary method for modifying a
- FIG. 3 is a block diagram illustrating an exemplary modification of a PE32 image to enable read/write access of global variables during a pre-EFI Initialization phase according to an embodiment of the present invention.
- FIG. 4 is a flow diagram describing an exemplary first round fixing method according to an embodiment of the present invention.
- FIG. 5 is a flow diagram describing an exemplary second round fixing method according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION
- Embodiments of the present invention are directed to a method for enabling global variable modifications (i.e., read/write access) in a Pre-EFI Initialization phase. This is accomplished using a portion of the processor cache as a usage model known as "Cache As RAM” (CAR). By relocating the data section of a driver image from a flash device into a region of CAR, the global variables may be modified freely as if they were in RAM.
- CAR Cache As RAM
- Embodiments of the present invention are described as being implemented in a Flash device during the Pre-EFI Initialization (PEI) phase for EFI based firmware.
- PEI Pre-EFI Initialization
- the PEI phase for EFI based firmware utilizes a PE32 (Portable Executable 32) image format.
- PE32 Portable Executable 32
- One skilled in the relevant art(s) would know that the invention is not limited to a Flash device, EFI based firmware, or PE32 image formats.
- the invention may also be implemented in other non-volatile storage devices using other software/firmware environments requiring other image formats in which global variables are restricted to read-only access.
- EFI based firmware supports the standard PE32 (Portable Executable 32) image format.
- the PE32 image format organizes code, data and other information, such as, for example, relocation information, by sections. Sections are placed closely together, one after another. Once the image is loaded by a loader, the image layout in memory is almost the same as its file image. An exception is that there could be some bubbles in the memory image layout due to the alignment requirement between sections. Usually, the loader will fix up the memory image if the sections are not loaded at a preferred linking base.
- FIG. 1 is a diagram illustrating an exemplary PE32 (Portable Executable
- PE32 image 100 also referred to herein as an executable driver module 100, comprises a .text section 102, a .data section 104, and a .relocation (.reloc) section 106.
- .text section 102 may also be referred to as a .code section 102.
- executable driver module 100 is not limited to .text section 102, .data section 104, and .reloc section 106.
- executable driver module 100 may also include more sections, such as, for example, a .rdata section, a .rsrc section, etc.
- the .text section 102 comprises executable code for executable driver module 100.
- the .data section 104 comprises data to be used during execution of the .text section 102.
- the .reloc section 106 provides information for all address data items to be updated with an absolute Flash address.
- sections 102, 104, and 106 In order for a PE32 image to launch correctly, sections 102, 104, and 106 have to be placed at a continuous virtual or physical memory space. If paging is enabled, sections 102, 104, and 106 need to be in a continuous virtual memory space. If paging is not required, then sections 102, 104, and 106 need to be in a continuous physical memory. With the EFI firmware, paging is always disabled. Therefore, sections 102, 104, and 106 are placed in a continuous physical memory space. This prevents sections 102, 104, and 106 of executable driver module 100 from being separated at discontinuous memory ranges.
- executable driver module 100 If an executable module is to be loaded at a different base, all sections (102, 104, and 106) in executable driver module 100 have to be relocated at the new base together. It is not acceptable to just relocate the code section (also referred to as the "text section") to a base and relocate the data section to another discontinuous new base.
- the PE32 sections (102, 104, and 106) of executable driver module 100 have to be separated at different memory ranges.
- .text section 102 has to be kept in Flash space while .data section 104, in which static and/or global variables are stored, has to be relocated into CAR.
- the space range for Flash and CAR are different and discontinuous.
- FIG. 2 is a flow diagram 200 describing an exemplary method for modifying a PE32 image to enable read/write access of global variables during a pre- EFI initialization (PEI) phase according to an embodiment of the present invention.
- PEI pre- EFI initialization
- the process begins with block 202, where the process immediately proceeds to block 204.
- an executable driver module 100 is generated.
- the executable driver module 100 includes global variables that when executed in a Flash device only enable read access of the global variables. The process then proceeds to block 206.
- a first round fixing of executable driver module 100 is performed.
- the first round fixing which is further described with reference to FIG. 4 below, fixes all address data items with absolute Flash addresses. The process then proceeds to block 208.
- a second round fixing of executable driver module 100 is performed.
- the second round fixing which is further described with reference to FIG. 5 below, performs a second fix-up for all address data items fixed in the first round fixing that point to .data section 104 of executable driver module 100.
- the second round fix- up updates these data addresses with an absolute CAR address.
- .text section 102 and .data section 104 may be updated to reflect data addresses with absolute CAR addresses.
- the completion of the second round fixing provides a final EFI firmware image (final executable driver module) that is now ready to be burned into the Flash.
- the final EFI firmware image includes the necessary absolute CAR addresses to enable global variables to have read/write access from the CAR.
- the process then proceeds to block 210.
- the final EFI firmware image (final executable driver module) is burnt into the Flash.
- the process then proceeds to block 212.
- a firmware loader will copy .data section 104 from the Flash to the CAR and then transfer control to an image entry point for execution. This enables executable driver module 100 to be executed normally in Flash while .data section 104 is stored and operated in the CAR.
- static and global variables are now available to be accessed freely. In other words, global variables now have read/write access in the CAR.
- FIG. 3 is a block diagram illustrating an exemplary modification of PE32 image (executable driver module) 100 to enable read/write access of global variables during a pre-EFI Initialization (PEI) phase according to an embodiment of the present invention. Shown in FIG. 3 are Flash 302, Flash 302', and CAR 304 (which is part of a processor cache as indicated above).
- PEI pre-EFI Initialization
- Flash 302 comprises executable driver module 100 which includes .text section 102, .data section 104, and .reloc section 106.
- a first round fixing is shown in .text section 102 and .data section 104 of Flash 302. Based on .reloc section 106, all address data items are fixed with absolute Flash addresses in the first round fixing.
- a second round fixing is shown in Flash 302'. In the second round fixing, all the related data that points to the fields in .data section 104 will be fixed with absolute CAR addresses.
- FIG. 4 is a flow diagram 400 describing an exemplary first round fixing method according to an embodiment of the present invention.
- the invention is not limited to the embodiment described herein with respect to flow diagram 400. Rather, it will be apparent to persons skilled in the relevant art(s) after reading the teachings provided herein that other functional flow diagrams are within the scope of the invention.
- .reloc section 106 records all the points in executable driver module 100 that should be fixed after loading. Generally, .reloc section 106 provides the relative virtual address (RVA) information.
- RVA relative virtual address
- a RVA is an offset from the base address at which an image is loaded into memory. According to the RVA, all addresses to be patched during the first round fixing are identified in executable driver module 100. Each address-to-be-patched will be updated by adding the specified Flash base for loading.
- decision block 408 it is determined whether there are more points in .reloc section 106 that need to be fixed. If there are more points in .reloc section 106 that need to be fixed, then the process proceeds back to block 404 to parse the next point.
- Ma is the absolute Flash address for code location A.
- Mb is the absolute Flash address for data location B.
- Mc is the absolute Flash address for code location C.
- Exemplary points Ra, Rb, and Rc are shown highlighted in .reloc section
- Ra includes relocation information that points to code location A (located in .text section 102).
- the address data at location A is updated with an absolute Flash address Ma, which resides in .data section 104.
- Rb includes relocation information that points to data location B (located in .data section 104).
- the address data at location B is updated with an absolute Flash address Mb, which resides in .data section 104.
- Rc includes relocation information that points to code location C (located in .text section 102).
- the address data at location C is updated with an absolute Flash address Mc, which resides in .text section 102.
- Flash 302' illustrates the second round fixing method.
- Flash 302' shows .reloc section 106 highlighting example points Ra, Rb, and Rc, .data section 104', and .text section 102'.
- the .data section 104' includes data location B and absolute CAR addresses Mb' and Ma'.
- the .text section 102' includes locations A and C and absolute Flash address Mc. Note that .text section 102 of Flash 302 is modified in Flash 302' (.data section 102') to accommodate the address change of Ma'.
- an address such as, for example Mb and Ma of Flash 302
- executable driver module 100 may have read and write access to global variables in the PEI phase.
- CAR 304 is a portion of processor cache in which .data section 104' is copied. As indicated above, after the firmware is burned into the Flash space, the firmware loader will copy .data section 104' from the Flash to the CAR. The transfer of .data section 104' to CAR 304 enables PEI static and global variables to have read/write access through CAR 304.
- FIG. 5 is a flow diagram 500 describing an exemplary second round fixing method according to an embodiment of the present invention.
- the invention is not limited to the embodiment described herein with respect to flow diagram 500. Rather, it will be apparent to persons skilled in the relevant art(s) after reading the teachings provided herein that other functional flow diagrams are within the scope of the invention.
- the process begins with block 502, where the process immediately proceeds to decision block 504.
- decision block 504 it is determined whether an address data item that was fixed in the first round fixing points to .data section 104. If there is an address data item that was fixed in the first round fixing that points to .data section 104, the address data item is selected in block 506, and the process proceeds to block 508. If there is no address data item that was fixed in the first round fixing that points to .data section 104, then the process proceeds to block 512, where the process ends. [0046] In block 508, the address data item selected in block 506 is updated with an absolute CAR address. The process then proceeds to decision block 510. [0047] In decision block 510, it is determined whether there are more address data items that were fixed in the first round fixing that point to .data section 104.
- Embodiments of the present invention may be implemented using hardware, software, or a combination thereof and may be implemented in one or more computer systems, or other processing systems. The techniques described herein may find applicability in any computing, consumer electronics, or processing environment.
- the techniques may be implemented in programs executing on programmable machines such as mobile or stationary computers, personal digital assistants, set top boxes, cellular telephones and pagers, consumer electronics devices (including DVD (Digital Video Disc) players, personal video recorders, personal video players, satellite receivers, stereo receivers, cable TV receivers), and other electronic devices that may include a processor, a storage medium (including volatile and non-volatile memory and/or storage elements), at least one input device, and one or more output devices.
- Program code is applied to the data entered using the input device to perform the functions described and to generate output information.
- the output information may be applied to one or more output devices.
- Each program may be implemented in a high level procedural or object oriented programming language to communicate with a processing system. However, programs may be implemented in assembly or machine language, if desired. In any case, the language may be compiled or interpreted.
- Program instructions may be used to cause a general-purpose or special- purpose processing system that is programmed with the instructions to perform the operations described herein. Alternatively, the operations may be performed by specific hardware components that contain hardwired logic for performing the operations, or by any combination of programmed computer components and custom hardware components.
- the methods described herein may be provided as a computer program product that may include a machine accessible medium having stored thereon instructions that may be used to program a processing system or other electronic device to perform the methods.
- the term "machine accessible medium” used herein shall include any medium that is capable of storing or encoding a sequence of instructions for execution by the machine and that cause the machine to perform any one of the methods described herein.
- machine accessible medium shall accordingly include, but not be limited to, solid-state memories, optical and magnetic disks, and a carrier wave that encodes a data signal.
- machine accessible medium shall accordingly include, but not be limited to, solid-state memories, optical and magnetic disks, and a carrier wave that encodes a data signal.
- software in one form or another ⁇ e.g., program, procedure, process, application, module, logic, and so on) as taking an action or causing a result.
- Such expressions are merely a shorthand way of stating the execution of the software by a processing system to cause the processor to perform an action or produce a result.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
- Read Only Memory (AREA)
Abstract
Description
Claims
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2006/001746 WO2008014635A1 (en) | 2006-07-18 | 2006-07-18 | A method to use global variables for pre-efi initialization modules in efi-based firmware |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| EP2047364A1 true EP2047364A1 (en) | 2009-04-15 |
| EP2047364A4 EP2047364A4 (en) | 2009-08-05 |
Family
ID=38996845
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| EP06761481A Withdrawn EP2047364A4 (en) | 2006-07-18 | 2006-07-18 | A method to use global variables for pre-efi initialization modules in efi-based firmware |
Country Status (5)
| Country | Link |
|---|---|
| EP (1) | EP2047364A4 (en) |
| JP (1) | JP4961019B2 (en) |
| KR (1) | KR101036675B1 (en) |
| CN (1) | CN101484878B (en) |
| WO (1) | WO2008014635A1 (en) |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8463998B1 (en) * | 2002-12-13 | 2013-06-11 | Open Text S.A. | System and method for managing page variations in a page delivery cache |
| CN101599043B (en) * | 2008-06-02 | 2013-07-17 | 松下电器产业株式会社 | Method and system for tracking correlation information of document |
| CN105446842B (en) * | 2015-12-03 | 2019-01-04 | 南京南瑞继保电气有限公司 | A kind of ADI DSP code in-service monitoring method |
| CN105630559B (en) * | 2015-12-25 | 2018-12-28 | 广州视源电子科技股份有限公司 | Method and system for burning board firmware |
| CN105426223B (en) * | 2015-12-25 | 2019-01-04 | 百度在线网络技术(北京)有限公司 | Using loading method and device |
| CN107450953B (en) * | 2017-08-01 | 2020-08-04 | 合肥联宝信息技术有限公司 | Method and device for updating BIOS |
| CN110990072A (en) * | 2019-11-08 | 2020-04-10 | 杭州智控网络有限公司 | Price tag screen multi-drive dynamic loading method |
Family Cites Families (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS59125421A (en) * | 1983-01-04 | 1984-07-19 | Nec Corp | Initialization system of computer applied equipment |
| EP0429252B1 (en) * | 1989-11-17 | 1998-01-14 | Digital Equipment Corporation | System and method for storing firmware in relocatable format |
| US6298440B1 (en) * | 1994-04-22 | 2001-10-02 | Microsoft Corporation | Method and system for providing multiple entry point code resources |
| JPH1153249A (en) * | 1997-08-07 | 1999-02-26 | Sharp Corp | Memory management method |
| JP2001195258A (en) * | 2000-01-12 | 2001-07-19 | Mitsutoyo Corp | Computer built-in system |
| US20040103272A1 (en) * | 2002-11-27 | 2004-05-27 | Zimmer Vincent J. | Using a processor cache as RAM during platform initialization |
| JP2004348677A (en) * | 2003-05-26 | 2004-12-09 | Sony Corp | Program and information processing method |
| KR100658918B1 (en) * | 2004-03-29 | 2006-12-15 | 주식회사 팬택앤큐리텔 | System global variable initialization device using block unit I / O instruction and its method |
| US7730472B2 (en) * | 2004-09-24 | 2010-06-01 | Hewlett-Packard Development Company, L.P. | Dynamic linking of modules in a pre-operating system environment |
-
2006
- 2006-07-18 CN CN2006800553499A patent/CN101484878B/en not_active Expired - Fee Related
- 2006-07-18 JP JP2009519776A patent/JP4961019B2/en not_active Expired - Fee Related
- 2006-07-18 EP EP06761481A patent/EP2047364A4/en not_active Withdrawn
- 2006-07-18 WO PCT/CN2006/001746 patent/WO2008014635A1/en not_active Ceased
- 2006-07-18 KR KR1020097000765A patent/KR101036675B1/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2009544085A (en) | 2009-12-10 |
| JP4961019B2 (en) | 2012-06-27 |
| CN101484878B (en) | 2012-11-28 |
| KR20090035521A (en) | 2009-04-09 |
| CN101484878A (en) | 2009-07-15 |
| KR101036675B1 (en) | 2011-05-24 |
| EP2047364A4 (en) | 2009-08-05 |
| WO2008014635A1 (en) | 2008-02-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP3267308B1 (en) | Application loading method and device | |
| US7657886B1 (en) | Mobile device with a MMU for faster firmware updates in a wireless network | |
| US7181610B2 (en) | Method and system to encapsulate a driver written for an operating system (OS) runtime environment in an OS independent environment firmware extension | |
| US6317870B1 (en) | System and method for optimization of inter-module procedure calls | |
| US20020129078A1 (en) | Method and device for creating and using pre-internalized program files | |
| US10296353B2 (en) | Protecting basic input/output (BIOS) code | |
| CN1334936A (en) | Method for communication between firmware written for different instruction set architectures | |
| US20110107070A1 (en) | Patching of a read-only memory | |
| CN102364433A (en) | Method for realizing Wine construction tool transplanting on ARM (Advanced RISC Machines) processor | |
| CN113254089B (en) | System boot method correction method, device, equipment and storage medium | |
| US20120222023A1 (en) | Automatic runtime dependency lookup | |
| US20080022265A1 (en) | Methods, systems, and computer program products for generating and using object modules | |
| WO2008014635A1 (en) | A method to use global variables for pre-efi initialization modules in efi-based firmware | |
| JP2008516324A (en) | Runtime dynamic linking | |
| KR101059633B1 (en) | Heap configuration for multitasking virtual machines | |
| CN101782860B (en) | Method and device for linking program | |
| JP2019523480A (en) | Preemptive decompression scheduling for NAND storage devices | |
| KR100478463B1 (en) | Dynamic Linking Method for Application Program | |
| KR20080039080A (en) | Terminal equipment with interface function of heterogeneous language editing library, API call method and compilation function generation method | |
| KR20250178102A (en) | Source code deployment method and electronic device therefor | |
| US7194612B2 (en) | System and method to export pre-boot system access data to be used during operating system runtime | |
| WO2006104407A1 (en) | A platform independent binary instrumentation method | |
| EP4476613A1 (en) | Dynamically overriding a function based on a capability set during load time | |
| US20060230190A1 (en) | Method and apparatus for executing application in system having NAND flash memory | |
| CN106897588B (en) | Processing method and device of label function |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PUAI | Public reference made under article 153(3) epc to a published international application that has entered the european phase |
Free format text: ORIGINAL CODE: 0009012 |
|
| 17P | Request for examination filed |
Effective date: 20090218 |
|
| AK | Designated contracting states |
Kind code of ref document: A1 Designated state(s): AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IS IT LI LT LU LV MC NL PL PT RO SE SI SK TR |
|
| AX | Request for extension of the european patent |
Extension state: AL BA HR MK RS |
|
| A4 | Supplementary search report drawn up and despatched |
Effective date: 20090702 |
|
| 17Q | First examination report despatched |
Effective date: 20090916 |
|
| 17Q | First examination report despatched |
Effective date: 20120403 |
|
| DAX | Request for extension of the european patent (deleted) | ||
| STAA | Information on the status of an ep patent application or granted ep patent |
Free format text: STATUS: THE APPLICATION IS DEEMED TO BE WITHDRAWN |
|
| 18D | Application deemed to be withdrawn |
Effective date: 20140201 |