CN101593116A - A kind of loading method, portable terminal that is applied to embedded real-time operating system - Google Patents

A kind of loading method, portable terminal that is applied to embedded real-time operating system Download PDF

Info

Publication number
CN101593116A
CN101593116A CNA2008101125988A CN200810112598A CN101593116A CN 101593116 A CN101593116 A CN 101593116A CN A2008101125988 A CNA2008101125988 A CN A2008101125988A CN 200810112598 A CN200810112598 A CN 200810112598A CN 101593116 A CN101593116 A CN 101593116A
Authority
CN
China
Prior art keywords
occupied area
new thread
data
run time
thread
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
Application number
CNA2008101125988A
Other languages
Chinese (zh)
Inventor
王昌正
赵庆安
王旸
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BEIJING MOVELL SOFTWARE Inc
Original Assignee
BEIJING MOVELL SOFTWARE Inc
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by BEIJING MOVELL SOFTWARE Inc filed Critical BEIJING MOVELL SOFTWARE Inc
Priority to CNA2008101125988A priority Critical patent/CN101593116A/en
Publication of CN101593116A publication Critical patent/CN101593116A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention provides a kind of loading method, portable terminal that is applied to embedded real-time operating system, wherein method comprises: after the real time operating system operation, in internal memory, occupy the pre-occupied area of predetermined length, generate new thread if described real time operating system is judged, then described new thread has been loaded into described pre-occupied area.Use the technology that the preferred embodiment of the present invention provides, in the internal memory of embedded real-time operating system, occupy the space of pre-sizing of the internal memory of embedded real-time operating system, when being loaded with the application program of usefulness, the space that occupies is in advance replaced, revise the code area symbolic address simultaneously, to reach purpose to the internal memory loading of embedded real-time operating system.

Description

A kind of loading method, portable terminal that is applied to embedded real-time operating system
Technical field
The present invention relates to the portable terminal application technology, be meant a kind of loading method, portable terminal that is applied to embedded real-time operating system especially.
Background technology
In recent years along with the development of portable terminal technology, function that portable terminal provided and professional kind constantly increase, the speed of upgrading and upgrading is constantly accelerated, and the user is more and more higher to mobile terminal function and service quality requirements, therefore the application program that loads in the portable terminal is more and more, the memory source that these application programs take is more and more, and this causes, and real-time loading application programs also becomes more difficult in portable terminal.
In the prior art, the real time operating system of portable terminal can realize the true-time operation of application programs, ensures the real-time of high-priority task with this, improves the reliability and stability of system.
But the inventor finds by analyzing, and this application program being loaded in the process of internal memory, but can't realize real-time loading, has influenced the functions expanding of service quality and portable terminal.
Summary of the invention
The purpose of the embodiment of the invention provides a kind of loading method, portable terminal that is applied to embedded real-time operating system, is used to solve the real-time loading that prior art can't realize application program, influences the defective that service quality and mobile terminal function are expanded.
A kind of loading method that is applied to embedded real-time operating system after the real time operating system operation, occupies the pre-occupied area of predetermined length in internal memory, generated new thread if described real time operating system is judged, then described new thread is loaded into described pre-occupied area.
A kind of portable terminal comprises at least: internal memory is used to predetermined new thread that pre-occupied area is provided; Call unit is used for invokes application and generates corresponding new thread, and described new thread leaves in the described pre-occupied area.
Use the technology that the preferred embodiment of the present invention provides, in the internal memory of embedded real-time operating system, occupy the space of pre-sizing of the internal memory of embedded real-time operating system, when being loaded with the application program of usefulness, the space that occupies is in advance replaced, revise the code area symbolic address simultaneously, to reach purpose to the internal memory loading of embedded real-time operating system.
Description of drawings
Fig. 1 is a logical organization synoptic diagram in the embodiment of the invention internal memory;
Fig. 2 is the logical organization synoptic diagram of a thread of the embodiment of the invention;
Fig. 3 loads the logical organization synoptic diagram of new thread behind the internal memory in real time for the embodiment of the invention;
Fig. 4 loads the schematic flow sheet of new thread in real time for the embodiment of the invention;
Fig. 5 is an embodiment of the invention portable terminal inner structure synoptic diagram.
Embodiment
For making purpose of the present invention, technical characterictic and implementation result clearer, below in conjunction with the accompanying drawings and the specific embodiments the preferred embodiments of the present invention are described in detail.
At different application programs, in internal memory, occupy the memory headroom of corresponding size in advance, when real-time loading application programs, occupied memory headroom is replaced, simultaneously can revise the code area symbolic address, load in order in embedded real-time operating system, to realize real-time internal memory.
As shown in Figure 1, embedded real-time operating system is current is managing a plurality of threads, is without loss of generality, and described a plurality of threads are divided into: thread A, thread B and thread C, the corresponding application program of each thread; Wherein, the run time version district among Fig. 1 is used to deposit the run time version of a plurality of described threads, and the data field then is used to deposit the data of a plurality of threads, is divided into: data A, data B and data C.Among described thread A, thread B and the thread C, thread C is useless program, has guaranteed that promptly this portable terminal can execution thread C.
By the position of run time version in the run time version district of real time operating system record thread C, determine by the length of record start address, run time version; The data that record thread C uses are determined by the length of record start address, data in the position of data field.Wherein, the zone that the run time version of thread C occupies can be called the pre-occupied area of run time version, and the zone that data occupy can be called the pre-occupied area of data.
In order to indicate that in real time operating system this thread C corresponding application program C is useless program, can show it itself is useless program among the application program C by the setting of macro definition or other zone bits, described real time operating system invokes application C, generate thread C, and the pre-occupied area of run time version and the pre-occupied area of data of opening up enough sizes in the run time version district and the data field of internal memory.
When needs loaded new application program D to internal memory, real time operating system was called this application program D and is generated thread D, and this thread D comprises as shown in Figure 2: file header D, run time version D and data D; Wherein, file header D comprises the essential information of this application program D, file size for example, and relevant macro definition or the like, run time version D has write down run time version, and data D has then write down the data message that this application program D uses.
Be loaded in the process of internal memory at thread D, as shown in Figure 3, the start address of run time version C is sought in the run time version district of real time operating system in internal memory, and calculate end address, run time version D is loaded into the pre-occupied area of the occupied run time version of run time version C, and data D is loaded into the pre-occupied area of the occupied data of data C in the data field.
More than described and utilized useless program committed memory and when loading new application program, by new application program being replaced run time version and the data of useless program in internal memory, selected embodiment is the situation when only loading the corresponding thread of a new application program; When the present invention also provides a kind of preferred embodiment to be used for needing at the same time to load a plurality of new thread, with a plurality of length that are about to the new thread of loading, mate with the length of useless thread, determine that according to predefined standard a new thread that is fit to the most loads, more rationally must use internal memory.
For example, useless thread C has taken the length of about 1KB in the pre-occupied area of run time version, taken the length of about 3KB in the pre-occupied area of data, current have new thread E simultaneously, F, G is at the application memory headroom, then at first judge new thread E, F, the G run time version separately and the length of data compare with the length of the code of useless thread C in pre-occupied area of described run time version and the pre-occupied area of data, select one can effectively utilize the new thread of internal memory to load, a comparatively simple method is exactly: with new thread E, F, the length of the run time version of each thread and data compares with useless thread C respectively among the G, has only when run time version length and satisfies smaller or equal to 1KB, when data length satisfies smaller or equal to 3KB simultaneously, just further consider and replace the memory headroom that useless thread C is occupied.
If have only thread E to satisfy above-mentioned two conditions simultaneously, then have only thread E can replace the memory headroom that useless thread C is occupied; If new thread E is arranged, F all can satisfy above-mentioned two conditions simultaneously, then further to new thread E, F selects, and the standard of selection can preestablish, and the present invention selects a preferred embodiment to be described: with described new thread E, the length addition of the run time version of F and data, obtain total length, described total length and the run time version of useless thread C and the most approaching new thread of corresponding length of data will be replaced the shared memory headroom of useless thread C.
In order further to disclose the principle of work of technical solution of the present invention, as shown in Figure 4, specifically describe as follows to loading procedure:
Portable terminal is after beginning to enter running status;
Step 401. real time operating system invokes application C generates corresponding thread C, and begins to carry out this thread C.
Step 402. invokes application D, and generate corresponding thread D.
The run time version of step 403. thread D is loaded into the run time version of thread C in the pre-occupied area of shared run time version, run time version district.
The data load of step 404. thread D is to the data data pre-occupied area shared in the data field of thread C.
Step 405. writes down or revises the symbolic address of the run time version of thread D in the run time version district in real time operating system.
Step 406. thread D jumps to the assigned address of the run time version in the pre-occupied area of run time version, and begins to carry out.
More than described and used a useless application program to occupy space in the internal memory in advance, when in internal memory, being loaded with the new application program of usefulness, in the new thread that new application program generates, run time version and data occupy the space of useless application program in internal memory respectively; Further, if not only one of new thread then needs all new thread are calculated in advance, select a most suitable new thread to replace useless thread occupation space then.
Corresponding with above method, the present invention also provide a kind of in embedded real-time operating system the portable terminal of loading application programs.
As shown in Figure 5, portable terminal comprises: internal memory 501, record cell 502, call unit 503; Wherein internal memory is divided into: run time version district 5011 and data field 5012.In the process of running of mobile terminal:
Call unit 503 is used to call different application programs, and generates corresponding thread, and the content of described thread leaves in the internal memory 501.
Internal memory 501 is used to deposit the content of each thread, and wherein, run time version district 5011 is used to deposit the run time version of thread; Data field 5012 is used to deposit the data of thread.
Record cell 502 is used for the reference position of record thread at described internal memory 501, parameters such as length.Specifically comprise reference position, length or the final position of the run time version of thread in the record run time version district 5011, the reference position of the data of thread, length or final position in the recorded data zone 5012.
When running of mobile terminal, call unit 503 at first calls a useless application program unavailable_App, and generate corresponding thread unavailable_Thread, the content of thread unavailable_Thread leaves in the internal memory 501, wherein, thread unavailable_Thread comprises run time version and data, and run time version leaves in the run time version district 5011, and deposit data is in data field 5012.
If portable terminal as required at this moment, call an application program by call unit 503, then this call unit 503 generates new thread according to application program, obtaining thread unavailable_Thread from described record cell 502 puts and second reference position in data field 5012 in the first start bit in run time version district 5011, leave the run time version of described new thread in described first start bit and put in the run time version district 5011 of beginning, with described new thread deposit data in the data field 5012 that second reference position begins.
Use the technical scheme that the above preferred embodiment of the present invention provides, in the internal memory of embedded real-time operating system, occupy the space of pre-sizing of the internal memory of embedded real-time operating system, when being loaded with the application program of usefulness, the space that occupies is in advance replaced, revise the code area symbolic address simultaneously, to reach purpose to the internal memory loading of embedded real-time operating system.
Should be noted that above preferred embodiment is only unrestricted in order to technical scheme of the present invention to be described, all parameter values can be according to the actual conditions adjustment, and in this rights protection scope.Those of ordinary skill in the art should be appreciated that and can make amendment or be equal to replacement technical scheme of the present invention, and do not break away from the spiritual scope of technical solution of the present invention, and it all should be encompassed in the middle of the claim scope of the present invention.

Claims (11)

1. a loading method that is applied to embedded real-time operating system is characterized in that,
After the real time operating system operation, in internal memory, occupy the pre-occupied area of predetermined length,
Generate new thread if described real time operating system is judged, then described new thread has been loaded into described pre-occupied area.
2. method according to claim 1 is characterized in that, the described pre-occupied area that occupies predetermined length in internal memory further comprises: described real time operating system is called useless application program, and generates corresponding useless thread;
The run time version of described useless thread is loaded into the pre-occupied area of described run time version, and the data load of described useless thread is to the pre-occupied area of described data.
3. method according to claim 1 is characterized in that, described new thread is loaded into described pre-occupied area and further comprises: the run time version of described new thread is loaded into the pre-occupied area of described run time version, and the data load of described new thread is to the pre-occupied area of described data.
4. method according to claim 3 is characterized in that, described described new thread is loaded into also comprises before the described pre-occupied area:
Current described new thread is more than one, then judge the length of run time version length smaller or equal to the pre-occupied area of described run time version, and data length is carried in pre-occupied area of described run time version and the pre-occupied area of described data smaller or equal to the described new thread of the length of the pre-occupied area of described data.
5. method according to claim 2 is characterized in that, after the described pre-occupied area of data that occupies predetermined length,
Write down the reference position and the length of the pre-occupied area of described run time version; And write down the reference position and the length of the pre-occupied area of described data.
6. method according to claim 2 is characterized in that, the data load of described new thread arrives after the pre-occupied area of described data,
Jump to the assigned address of described new thread in the pre-occupied area of described run time version, and begin to carry out this new thread.
7. method according to claim 2 is characterized in that, the data load of described new thread arrives after the pre-occupied area of described data,
If the length of the run time version of described new thread less than the length of the pre-occupied area of described run time version, then discharges the remainder of the pre-occupied area of described run time version;
If the length of the data of described new thread less than the length of the pre-occupied area of described data, then discharges the remainder of the pre-occupied area of described data.
8. a portable terminal is characterized in that, comprises at least:
Internal memory is used to predetermined new thread that pre-occupied area is provided;
Call unit is used for invokes application and generates corresponding new thread, and described new thread leaves in the described pre-occupied area.
9. portable terminal according to claim 8 is characterized in that, described pre-occupied area comprises: pre-occupied area of run time version and the pre-occupied area of data;
The run time version of described new thread is carried in the pre-occupied area of described run time version, and the data load of described new thread is in the pre-occupied area of described data.
10. portable terminal according to claim 8 is characterized in that, also comprises:
Record cell is used for writing down the information parameter of described new thread in described pre-occupied area.
11. portable terminal according to claim 10 is characterized in that, described information parameter comprises at least:
Reference position, length and/or the final position of described new thread in described run time version district;
Reference position, length and/or the final position of described new thread in described data field.
CNA2008101125988A 2008-05-26 2008-05-26 A kind of loading method, portable terminal that is applied to embedded real-time operating system Pending CN101593116A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2008101125988A CN101593116A (en) 2008-05-26 2008-05-26 A kind of loading method, portable terminal that is applied to embedded real-time operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2008101125988A CN101593116A (en) 2008-05-26 2008-05-26 A kind of loading method, portable terminal that is applied to embedded real-time operating system

Publications (1)

Publication Number Publication Date
CN101593116A true CN101593116A (en) 2009-12-02

Family

ID=41407786

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2008101125988A Pending CN101593116A (en) 2008-05-26 2008-05-26 A kind of loading method, portable terminal that is applied to embedded real-time operating system

Country Status (1)

Country Link
CN (1) CN101593116A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102819439A (en) * 2011-06-10 2012-12-12 中兴通讯股份有限公司 Method and device of dynamically loading multi-system application programs based on relocation
WO2016131313A1 (en) * 2015-07-17 2016-08-25 中兴通讯股份有限公司 Code loading method and apparatus for embedded operating system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102819439A (en) * 2011-06-10 2012-12-12 中兴通讯股份有限公司 Method and device of dynamically loading multi-system application programs based on relocation
WO2016131313A1 (en) * 2015-07-17 2016-08-25 中兴通讯股份有限公司 Code loading method and apparatus for embedded operating system

Similar Documents

Publication Publication Date Title
JP5053552B2 (en) Data storage device having heterogeneous non-volatile memory and driving method thereof
CN103902333A (en) Method for automatically unloading application of mobile terminal and mobile terminal
CN100432931C (en) Method for implementing long jumping dynamic patch in embedded system
CN104008061A (en) Internal memory recovery method and device
CN102890656A (en) Method for improving service life of FLASH
CN102902566A (en) Method and device for installing and starting application software
CN104965708B (en) A kind of EMS memory management process and device of application program operational process
JP4641443B2 (en) Log information management apparatus, log information management method, and log information management program
CN102298543A (en) Memory management method and memory management device
CN101170435B (en) A method for solving non-symmetric digital user line Modem software loss
CN107911741A (en) Free memory method for improving, smart television and computer-readable recording medium
CN104317739A (en) Hybrid memory paging method and device
CN102043689A (en) Fault tolerance design method for solid-state memory device
CN106649654A (en) Data updating method and device
CN101593116A (en) A kind of loading method, portable terminal that is applied to embedded real-time operating system
JP2010092107A (en) Failure information monitoring device and failure information monitoring method
CN102469357B (en) Method and system for storing user operation data and receiving terminal of digital television
CN105100505A (en) Method and system for assigning battery level to terminal applications
CN105760112A (en) Data storage method, reading method and systems for prolonging service life of memory
CN103152627B (en) Set Top Box lapse data storage method, device and Set Top Box
JP2009037403A (en) Valid activation method for core memory in multi-core processor
CN101739273A (en) Memory sharing method
JP2012174106A (en) Control device for reading and writing data from and to flash memory
CN113688343B (en) Page authority control method, device, equipment and readable storage medium
CN104881258A (en) Buffer concurrent access method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Open date: 20091202