CN114115888A - BootRom function expansion-based embedded system starting method - Google Patents
BootRom function expansion-based embedded system starting method Download PDFInfo
- Publication number
- CN114115888A CN114115888A CN202111214553.3A CN202111214553A CN114115888A CN 114115888 A CN114115888 A CN 114115888A CN 202111214553 A CN202111214553 A CN 202111214553A CN 114115888 A CN114115888 A CN 114115888A
- Authority
- CN
- China
- Prior art keywords
- expansion
- bootrom
- program
- module
- external memory
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
- G06F9/4403—Processor initialisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/47—Retargetable compilers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses an embedded system starting method based on BootRom function expansion, which relates to the technical field of chips and is characterized in that an expansion module is read from an external memory and loaded into a memory through BootRom, and the expansion module internally comprises an operation instruction of an expansion program; analyzing the extension module, running an operation instruction and executing an extension program contained in the extension module; and after the expansion program contained in the expansion module is executed, returning to continue executing the BootRom program. According to the method, the extension program is compiled into the module to be stored in the external storage device through the compiling technology of the software relocatable code, BootRom realizes function extension in a mode of loading and running the program module, more complex logic can be realized by replacing configuration information, dynamic adjustment of BootRom execution flow can be realized, and function extension can be realized more flexibly in a mode of compiling the program.
Description
Technical Field
The invention relates to the technical field of chips, in particular to a BootRom function expansion-based embedded system starting method.
Background
BootRom is a small block of read-only memory inside an embedded processor chip, contains codes executed by a processor firstly when the processor is powered on or reset, and is used for performing basic initialization on the chip and then jumping to a next-level code. In modern embedded processors, BootRom typically implements more complex functions, mainly including the following:
1. chip configuration, wherein BootRom can read configuration information on a hardware fuse or a storage device, and different configurations are performed on a chip during starting;
2. the BootRom reads a next-level program, usually a chip firmware, on the large-capacity storage device, directly runs or loads the next-level program into an RAM (random access memory) to run, and the BootRom also performs security check work such as encryption, signature verification and the like before running the firmware;
3. when the program is not programmed on the storage device, BootRom can receive and program the program to the storage device through a communication interface of the embedded processor, such as a serial port, a USB interface and the like.
With the development of embedded chip technology and application requirements, BootRom needs to implement more and more complex software functions, but limited by the manufacturing technology and cost of embedded chips, BootRom usually has no large code capacity, which limits the software function implementation of BootRom, and because of the physical characteristics of BootRom, the chip cannot be modified after being manufactured, and the functions implemented by codes in BootRom cannot be modified.
Disclosure of Invention
The invention provides an embedded system starting method based on BootRom function expansion aiming at the problems and technical requirements, and the technical scheme of the invention is as follows:
a BootRom function extension-based embedded system starting method comprises the following steps:
BootRom program starts and executes initialization operation;
after the initialization operation is completed, reading the expansion module from the external memory and loading the expansion module into the memory, wherein the expansion module internally comprises an operation instruction of the expansion program;
analyzing the extension module, running an operation instruction and executing an extension program contained in the extension module;
and after the expansion program contained in the expansion module is executed, returning to continue executing the BootRom program.
Furthermore, the external memory stores at least two expansion modules corresponding to the expansion programs with different functions.
Further, the method further comprises: after modifying the expansion module stored in the external memory, the BootRom program reads the modified expansion module from the external memory, and the modification includes addition, deletion or content adjustment.
Further, the operation instruction inside each extension module is formed by compiling the corresponding extension program through the relocatable technology.
Further, reading the expansion module from the external memory includes:
after the initialization operation is finished, reading data of a preset address of an external memory;
and reads the expansion module from the external memory according to address information in the data of the predetermined address.
Further, reading the expansion module from the external memory according to address information in the data of the predetermined address, comprising:
judging whether the read data of the preset address is configuration header data or not through a MagicCode field;
if the read data of the preset address is not the configuration header data, directly returning to execute the BootRom program;
and if the read data of the preset address is the configuration information head data, reading the expansion module from the external memory according to the address information in the configuration information head data.
Further, the method further comprises:
if the read data of the preset address is the configuration information head data, calculating a check value of the configuration information head data and judging whether the check value is correct or not according to a prestored check code;
if the check value is wrong, directly returning to execute the BootRom program;
if the check value is correct, judging whether an expansion module exists in the external memory according to the set flag bit of the expansion module;
if the expansion module does not exist, directly returning to execute the BootRom program;
if the expansion module exists, the step of reading the expansion module from the external memory according to the address information in the configuration information header data is executed.
Further, the storage address and length of the expansion module in the external memory are determined by the configuration information header.
Further, the address and length of the expansion module loaded into the memory are determined by the configuration information header.
The beneficial technical effects of the invention are as follows:
the invention discloses an embedded system starting method based on BootRom function expansion, which compiles an expansion program into a module to be stored in an external storage device through a compiling technology of software relocatable codes, BootRom realizes function expansion in a mode of loading and running program modules, can replace configuration information to realize more complex logic, can realize dynamic adjustment of BootRom execution flow, and can realize function expansion more flexibly in a mode of compiling programs.
Drawings
Fig. 1 is a flowchart of the BootRom load and run expansion module of the present application.
Fig. 2 is a schematic diagram of a memory structure of an embedded processor including a BootRom extension module according to the present application.
Detailed Description
The following further describes the embodiments of the present invention with reference to the drawings.
The embodiment of the invention discloses an embedded system starting method based on BootRom function expansion, please refer to a flow chart of BootRom loading and expansion module operation shown in figure 1, and the method comprises the following steps:
BootRom program starts and executes initialization operation;
after the initialization operation is completed, reading the expansion module from the external memory and loading the expansion module into the memory, wherein the expansion module internally comprises an operation instruction of the expansion program; preferably, the operation instruction is formed by compiling a corresponding extension program through a relocatable technology;
analyzing the extension module, running an operation instruction and executing an extension program contained in the extension module;
and after the expansion program contained in the expansion module is executed, returning to continue executing the BootRom program.
In one embodiment, the method further comprises: after modifying the expansion module stored in the external memory, the BootRom program reads the modified expansion module from the external memory, and the modification includes addition, deletion or content adjustment.
In one embodiment, reading the expansion module from the external memory includes:
after the initialization operation is finished, reading data of a preset address of an external memory;
and reads the expansion module from the external memory according to address information in the data of the predetermined address.
In one embodiment, reading the expansion module from the external memory according to address information in data of a predetermined address includes:
judging whether the read data of the preset address is configuration header data or not through a MagicCode field;
if the read data of the preset address is not the configuration header data, directly returning to execute the BootRom program;
and if the read data of the preset address is the configuration information head data, reading the expansion module from the external memory according to the address information in the configuration information head data.
In one embodiment, if the read data of the predetermined address is configuration information head data, calculating a check value of the configuration information head data and judging whether the check value is correct according to a pre-stored check code;
if the check value is wrong, directly returning to execute the BootRom program;
if the check value is correct, judging whether an expansion module exists in the external memory according to the set flag bit of the expansion module;
if the expansion module does not exist, directly returning to execute the BootRom program;
if the expansion module exists, the step of reading the expansion module from the external memory according to the address information in the configuration information header data is executed.
In one embodiment, the external memory stores at least two expansion modules corresponding to different functions of the expansion program.
Fig. 2 shows an embedded processor memory structure including a BootRom expansion module, in which configuration header data used by BootRom is stored at a predetermined address in an external memory, and a storage address and a length of the expansion module in the external memory, and an address and a length of the expansion module loaded into a memory are determined by the configuration header data.
By the method, when BootRom runs, whether an expansion module exists in an external nonvolatile memory is checked, and if the expansion module exists, the expansion module is dynamically loaded into the memory to run, so that the capacity of BootRom is enlarged, more complex logics and functions can be realized, and the function expansion of BootRom is realized. The expansion mode utilizes a program running mechanism of dynamic loading, and generates a binary instruction irrelevant to an address during compiling through a relocatable technology of a compiler, so that expansion modules with different functions can be compiled and stored in an external nonvolatile memory; the function expansion is realized by writing new program modules, the realization of functions and logic is not limited except by the capacity of an external nonvolatile memory and a memory, and the capacity of modern embedded processors, memories and memory resources is enough, so that the expansion of any functions can be realized basically.
What has been described above is only a preferred embodiment of the present invention, and the present invention is not limited to the above examples. It is to be understood that other modifications and variations directly derivable or suggested by those skilled in the art without departing from the spirit and concept of the present invention are to be considered as included within the scope of the present invention.
Claims (9)
1. A BootRom function expansion-based embedded system starting method is characterized by comprising the following steps:
BootRom program starts and executes initialization operation;
after the initialization operation is completed, reading an extension module from an external memory and loading the extension module into a memory, wherein the extension module internally comprises an operation instruction of an extension program;
analyzing the extension module, running the operation instruction, and executing an extension program contained in the extension module;
and after the expansion program contained in the expansion module is executed, returning to continue executing the BootRom program.
2. The method according to claim 1, wherein the external memory stores therein at least two expansion modules corresponding to the expansion programs of different functions.
3. The method of claim 1, further comprising: and after modifying the expansion modules stored in the external memory, reading the modified expansion modules from the external memory by a BootRom program, wherein the modification comprises addition, deletion or content adjustment.
4. The method according to claim 1, wherein the operation instructions inside each expansion module are formed by compiling the corresponding expansion program through a relocatable technology.
5. The method according to any one of claims 1-4, wherein reading the expansion module from the external memory comprises:
after the initialization operation is finished, reading data of a preset address of the external memory;
and reading the expansion module from the external memory according to address information in the data of the predetermined address.
6. The method according to claim 5, wherein the reading the expansion module from the external memory according to address information in the data of the predetermined address comprises:
judging whether the read data of the preset address is configuration header data or not through a MagicCode field;
if the read data of the preset address is not the configuration header data, directly returning to execute a BootRom program;
and if the read data of the preset address is configuration information header data, reading the expansion module from the external memory according to address information in the configuration information header data.
7. The method of claim 6, further comprising:
if the read data of the preset address is configuration information head data, calculating a check value of the configuration information head data and judging whether the check value is correct or not according to a prestored check code;
if the check value is wrong, directly returning to execute a BootRom program;
if the check value is correct, judging whether the expansion module exists in the external memory according to a set expansion module flag bit;
if the expansion module does not exist, directly returning to execute the BootRom program;
and if the expansion module exists, reading the expansion module from the external memory according to the address information in the configuration information header data.
8. The method of claim 6, wherein the storage address and length of the extension module in the external memory are determined by the configuration information header data.
9. The method of claim 6, wherein the address and length of the extension module loaded into the memory is determined by the configuration information header data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111214553.3A CN114115888A (en) | 2021-10-19 | 2021-10-19 | BootRom function expansion-based embedded system starting method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111214553.3A CN114115888A (en) | 2021-10-19 | 2021-10-19 | BootRom function expansion-based embedded system starting method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114115888A true CN114115888A (en) | 2022-03-01 |
Family
ID=80375979
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111214553.3A Pending CN114115888A (en) | 2021-10-19 | 2021-10-19 | BootRom function expansion-based embedded system starting method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114115888A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116243957A (en) * | 2023-05-10 | 2023-06-09 | 北京得瑞领新科技有限公司 | Function extension control method, device and system of SSD |
-
2021
- 2021-10-19 CN CN202111214553.3A patent/CN114115888A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116243957A (en) * | 2023-05-10 | 2023-06-09 | 北京得瑞领新科技有限公司 | Function extension control method, device and system of SSD |
CN116243957B (en) * | 2023-05-10 | 2023-10-31 | 北京得瑞领新科技有限公司 | Function extension control method, device and system of SSD |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8176387B2 (en) | Error detection control system | |
CN106293832B (en) | SOC chip boot starting method and system | |
CN102200916B (en) | Electronic equipment, configurable member and method for storing configuration information of configurable member | |
JP5457496B2 (en) | Memory management of portable data storage media | |
CN114115888A (en) | BootRom function expansion-based embedded system starting method | |
CN104679547A (en) | Method and system for reading system configuration information in MCU | |
CN113741944A (en) | Machine program system with upgrading function, upgrading method and application | |
CN111666102A (en) | File format conversion method, chip verification method, related device and network chip | |
CN107657153B (en) | Code protection method and device for flash area in chip | |
US20080005799A1 (en) | Program execution control circuit, computer system, and IC card | |
CN117524278A (en) | Dynamic random access memory compatible method, device and equipment | |
US8635397B2 (en) | Data writing method and system | |
US20120317406A1 (en) | Flash storage system and method for accessing a boot program | |
CN115827347A (en) | Control method of embedded equipment and embedded equipment | |
US6883078B2 (en) | Microcomputer with reduced memory usage and associated method | |
CN112230941B (en) | Java Card package and application program installation method and tool | |
US7490232B2 (en) | Disk device using disk to rewrite firmware and firmware determination method | |
US20010052114A1 (en) | Data processing apparatus | |
KR100580071B1 (en) | Detcting method for memory error | |
CN117573155B (en) | Product information processing method and chip | |
CN104166633A (en) | Method and system for memory access protection | |
CN118092989B (en) | Firmware upgrading method, system, equipment and medium of memory | |
CN117170753B (en) | Program processing method, program processing device, vehicle, and storage medium | |
CN112286464B (en) | Method, device, storage medium and terminal for checking data integrity by on-chip CRC | |
JP4324149B2 (en) | Emulator and development support system using it |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |