ROM code patch running method and system

An operating method and operating system technology, which is applied in the computer field and can solve problems such as seldom use and inability to use jump instructions.

Inactive Publication Date: 2017-11-24
SHENZHEN CHIPSBANK TECH
View PDF6 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This approach is more convenient to implement in the development environment using assembly language, just use the jump instruction directly, but it cannot be used in the C language environment, so it is rarely used

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • ROM code patch running method and system
  • ROM code patch running method and system
  • ROM code patch running method and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 2

[0027] Based on the embodiment 2 of the invention, the burning method of the patch code and the original code.

[0028] When writing ROM codes, first reserve interfaces for various C language functions that may need to be changed, and these interfaces are in the form of function pointers.

[0029] The C language source code is as follows:

[0030]

[0031]

[0032] By setting up the compiler, the Rom.c file is compiled to the physical address where the ROM is located, and the Ram.c file is compiled to the physical address where the RAM is located, thus obtaining two pieces of machine code.

[0033] When there is no need to modify the original function, we set the function pointer ExtPtrVoidFunc[1] to NULL (empty) in the initialization code, and the Rom_Func1 function will execute the code in the ROM to do the addition operation. If the function pointer ExtPtrVoidFunc[1] is set to Ram_Func1, then this module will execute the code in RAM for subtraction. Thus realizing t...

Embodiment 3

[0035] Embodiment 3 based on the invention, a kind of ROM code patch operating system, is used to realize above-mentioned method, comprises: compiler, is used for setting the interface based on the function pointer for the function in the original code; The volatile memory reads the patch code and stores it in RAM, and selects to read the original code or the patch code and run it according to the function pointer of the interface; ROM is used to store the original code; RAM is used to store the obtained code from the non-volatile memory patch code.

[0036] The microprocessor is also used to detect whether there is a non-volatile memory, and read patch data from it if ACK feedback occurs, the patch data includes configuration information and patch code, and the patch code is stored in RAM.

[0037] The configuration information includes a list of function pointers, the number and number of interfaces to be modified.

[0038] The microprocessor is also used to modify the func...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses an ROM code patch running method and system, which is suitable for a C language environment. The method comprises the steps of setting a function pointer-based interface for a function in an original code, wherein the original code is stored in an ROM; reading a patch code from a nonvolatile memory and storing the patch code in an RAM; and selecting and reading the original code or the patch code according to the function pointer of the interface, and running the original code or the patch code. The system is used for executing the corresponding method. The function pointer type interface is preset for the function of the original code stored in the ROM, so that when the function runs, the original code or the patch code in the corresponding position is selected to run according to a variable of the function pointer; and the patch code can be effectively imported in an ROM environment and used.

Description

technical field [0001] The invention relates to a method and a system for running a ROM code patch, belonging to the field of computers. Background technique [0002] Assembly language, a low-level language used for software development, the program code written in it has high operating efficiency, but has disadvantages such as poor readability, and is not suitable for developing large-scale software projects; C language, a high-level language used for software development, The program code written with it has high operating efficiency and good readability, and is suitable for developing large-scale software projects. [0003] The replacement of consumer electronic products is fast, and consumers require the cost to be as low as possible and the products to be launched quickly. However, the development cycle of dedicated intelligent control chips used in consumer electronic products is long, and the tape-out cost is expensive. The microcontroller inside the intelligent con...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F9/26
CPCG06F9/268
Inventor 余恒昌
Owner SHENZHEN CHIPSBANK TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products