CN1787108A - Method and apparatus for partitioned memory - Google Patents

Method and apparatus for partitioned memory Download PDF

Info

Publication number
CN1787108A
CN1787108A CN 200410100326 CN200410100326A CN1787108A CN 1787108 A CN1787108 A CN 1787108A CN 200410100326 CN200410100326 CN 200410100326 CN 200410100326 A CN200410100326 A CN 200410100326A CN 1787108 A CN1787108 A CN 1787108A
Authority
CN
China
Prior art keywords
district
program code
storer
limit address
electronic installation
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
CN 200410100326
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.)
BenQ Corp
Original Assignee
BenQ Corp
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 BenQ Corp filed Critical BenQ Corp
Priority to CN 200410100326 priority Critical patent/CN1787108A/en
Publication of CN1787108A publication Critical patent/CN1787108A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The method and device of the invention is used to differentiate the memory of an electronic device, where the memory is divided by an old dividing address into two regions, and the first region is used to store user self-input data and the second region is used to store a first program code for the operation of the electronic device. The invention downloads a second program code to the electronic device to replace the first one, successively calculates a new dividing address according to the second program code and records the new dividing address into the memory.

Description

The method of partitioned memory and device
Technical field
The present invention relates to a kind of size, with the partitioned method and the device of decision storer according to program code.
Background technology
Electronic installation now is because the diversification of function trend needs to store simultaneously required program code of the sub-device running of power supply and the data that are available for users to import voluntarily usually.Some wireless communication apparatus (as mobile phone, PDA etc.) is because the restriction in space and the consideration of cost must utilize same storer to be divided into two parts, with difference store program code and data.
With the mobile phone is example, now mostly uses NAND flash memory (NAND flash) to come store program code and data.As shown in Figure 1, the NAND flash memory 1 that is applicable to mobile phone is formulated for two districts: first district 11 and second district 13.First district 11 comprises telephone directory, calendar, alarm clock and orders ringing sound of cell phone or the like regularly, certainly in order to store the data (being called archives economy again) that the user can import voluntarily.13 in second district carries out the required program code of the various functions of mobile phone in order to store.
Before mobile phone dispatches from the factory, can decide the capacity in first district 11 and second district 13 according to the program code size of reality usually.For example, the capacity of NAND flash memory 1 is 32MB, and required program code size is 19.8MB, and then second district may be planned to 20MB to hold program code, and first district 11 just is planned to 12MB.The historical facts or anecdotes border disposes as shown in Figure 1, and second district 13 starts from address 0X0000000, ends at address 0X1400000, altogether 20MB; And first district 11 starts from address 0X1400000, ends at address 0X2000000, altogether 12MB.In the example of Fig. 1, address 0X1400000 just becomes the branch limit address in first district 11 and second district 13.
After mobile phone dispatches from the factory, may cause the damage of some block in the NAND flash memory 1 because of certain factor, so that these blocks can't be used again.Fig. 2 is in order to illustrate that this situation is to influence that storage data caused.As shown in the figure, suppose to have data 21 to desire to deposit in first district 11.These data 21 comprise 5 block: block1, block2, block3, block4 and block5.And first district 11 has part block (being block 213,217,223) to suffer damage, therefore data 21 can't deposit in the block 211,213,215,217,219 in first district 11 continuously, and must skip the block 213,217,223 of infringement, block block1, block2, block3, b1ock4, the b1ock5 of data 21 is stored in respectively in the block 211,215,219,221,225.
In order to allow the user that maximum space storage data is arranged, the capacity in common second district 13 can plan very near the size (only planning second district 13 of 20MB as the program code of 19.8MB) of program code.Yet when the infringement block in second district 13 is too much (actual available space is less than 19.8MB), because off-capacity, the subprogram code may be forced to cross branch limit address 0X140000, is stored in first district 11.For mobile phone, the data that are stored in first district 11 have established form, the program code of crossing branch limit address 0X140000 and being stored in first district 11 can be because system can't identification, may cause data deleted or that stored subsequently to cover in the past, cause the problem in the mobile phone running.
In addition, mobile phone is when the refresh routine code, also may because the size of new program code greater than the capacity (for example the size of new procedures code is 20.1MB) in second district 13, even if all harmless block in second district 13 also can't be loaded on all new procedures codes in second district 13 smoothly.
Therefore, a kind of can be dynamically along with program code size, and memory partition method and the device of possessing the first maximum district possible capacity simultaneously are urgent necessity.
Summary of the invention
The invention provides a kind of method and device, can be according to the size of program code, the branch limit address of decision storer makes the zone of storage data have maximum space, and in order to also store program code intactly of the zone of store program code.
Method of the present invention is applicable to the electronic installation that comprises a storer, and its storer is divided into one first district and one second district with one old minute limit address.Wherein first district is in order to storing the data that the user can import voluntarily, required first program code when second district operates in order to the stored electrons device.The method comprises the following step: (a) download one second program code; (b) a new limit address of dividing is calculated in the space shared according to second program code; (c) newly the branch limit address is recorded in the storer, and cuts apart storer again; And (d) replace first program code with second program code.Electronic installation just can be told the scope in first district and second district exactly according to new minute limit address.
When execution in step (b), except according to the shared space of second program code, newly the branch limit address also can determine according to a headspace again.In addition, step (b) also can comprise the address of a plurality of infringement blocks in the swept memory, and its headspace comprises to the size of small part disturbed area piece.
Behind the new branch of decision limit address, the method can judge further whether new minute limit address be identical with old minute limit address.If with, then do not change the data that have first district.If not, then the method can be duplicated the data that all are stored in first district, and writes to again in first district.
This method can comprise the following step in execution in step (a) before: (d) provide one to download device, in order to deposit second program code; And (e) connect download apparatus to electronic installation.
Download apparatus of the present invention is used to upgrade a storer, and its memory bit and is divided into one first district and one second district with one old minute limit address in an electronic installation.Wherein, first district is in order to storing the data that the user can import voluntarily, required first program code when second district operates in order to the stored electrons device.Download apparatus comprises a storage area and a transmit port.Wherein, the storage area is in order to store second program code, and to replace first program code, transmit port is in order to be connected with electronic installation, to transmit second program code to electronic installation.Download apparatus calculates a new branch limit address according to the shared memory-aided space of second program code, and cuts apart storer again according to new minute limit address.
Electronic installation of the present invention is the interior storer of segmenting device again, and its storer is divided into one first district and one second district with one old minute limit address, and first district is in order to storage data, and second district is in order to store one first program code.Electronic installation comprises an evaluation unit, according to the shared space of one second program code, in order to calculate a new branch limit address.It is one the 3rd district and one the 4th district that storer is cut apart in new branch limit address, and second program code storage is in the 4th district.
The evaluation unit of electronic installation also can calculate the new limit address of dividing according to a headspace.Electronic installation of the present invention also can comprise the one scan unit, and in order to a plurality of infringement blocks in the swept memory, its headspace then comprises the size of the infringement block that scans out at least.
Description of drawings
Fig. 1 is the hardware configuration of known as memory device subregion;
Fig. 2 is stored to the hardware configuration in first district for given data;
Fig. 3 is an embodiment of method provided by the present invention;
Fig. 4 is an embodiment of hardware configuration of the present invention;
Synoptic diagram when Fig. 5 is the boundary address change; And
Fig. 6 is another embodiment of hardware configuration of the present invention.
The reference numeral explanation
1 NAND flash memory, 11 first districts
15 first districts, 13 second districts
17 second districts, 21 data
211,213,,, 225 blocks
41 download apparatus, 43 electronic installations
45 transmission lines, 401 storage areas
405 old minutes limit addresses of 403 transmit pories
501 new branch limit addresses, 601 evaluation units
603 scanner unit
Embodiment
One embodiment of method of the present invention as shown in Figure 3, be used for when upgrading the program code (first program code) of a mobile phone, according to the size of upgrading back program code (second program code), dynamically determine the branch limit address in first district and second district in the storer.For convenience of explanation, suppose that at this size of first program code is 19.8MB, storer is a NAND flash memory, it disposes as shown in Figure 1, and total volume is 32MB, and the capacity that upgrades preceding first district 11 is 12MB, the capacity in second district 13 is 20MB, and therefore old minute limit address is 0X1400000.
When execution in step 301, the invention provides one and download device, have a storage area, to deposit in order to upgrade second program code of first program code, its size is 20.2MB.When execution in step 303, download apparatus is connected to mobile phone, and its connected mode can be to utilize known wired mode, or utilizes known infrared line transmission manner to connect.When execution in step 305, second program code is downloaded to mobile phone by download apparatus, replaces first program code to upgrade.When execution in step 307, download apparatus calculates a new branch limit address according to the size of the infringement block in the space in actual shared second district 13 of second program code and second district 13.The infringement block of supposing second district 13 is total to 0.1MB, and then actual required space is 20.2MB+0.1MB=20.3MB, and promptly newly the branch limit address need allow second district 13 have the space of 20.3MB at least.When execution in step 309, download apparatus newly is recorded in the storer branch limit address, and cuts apart storer again according to the new minute limit address that step 307 is calculated.When execution in step 311, download apparatus with second program code storage in second district, so first program code is substituted.
When execution in step 307, for the sake of assurance, new branch limit address is except the infringement block of considering the space that second program code is shared and second district 13, also consider a suitable headspace, with prevention when the next update, there is new infringement block to produce again, and divides the limit address may need to adjust once again.If it is 0.2MB that download apparatus is set the space of reserving, then in fact newly the branch limit address should allow second district 13 have the space of 20.3MB+0.2MB=20.5MB.Therefore first district 11 has the space of 32MB-20.5MB=11.5MB.
By said method, the space that the present invention just can be shared according to the practical programs code, the branch limit address of decision storer makes first district of storage data have the possible space of maximum, and also store program code intactly of second district.
Method of the present invention can judge further also whether new minute limit address be identical with old minute limit address.If identical, the data in first district 11 just need not changed.If different, then the address of each block can the change thereupon because of the change that divides the limit address in first district 11.Therefore download apparatus can duplicate all data in first district 11, write to again in first district 11, and the correlation function of address after will upgrading and mobile phone links again, and can not make a mistake to guarantee to upgrade the access of data afterwards.
During execution in step 309, newly the branch limit address can be recorded in second district 13.More specifically, newly the branch limit address can be arranged to be stored in after the block of second program code in second district 13.
Fig. 4 is in order to show a hardware configuration embodiment who implements said method, and it comprises one and downloads a device 41 and an electronic installation 43.Download apparatus 41 is above-mentioned download apparatus, and electronic installation 43 is above-mentioned mobile phone.The storer of electronic installation 43 is separated out first district 11 and second district 13 according to one old minute limit address 405.Download apparatus 41 comprises a storage area 401 and a transmit port 403.Storage area 401 is in order to store second program code, and transmit port 403 is connected to electronic installation 43 by a transmission line 45.When needs upgrade first program code, download apparatus 41 is via transmit port 403 and transmission line 45, download second program code to the second district 13 to replace first program code by storage area 401, and according to the shared memory-aided space of second program code, coming new and old boundary address is a new branch limit address.
As shown in Figure 5, if download apparatus 41 judges that the boundary in first district 11 and second district 13 changes to new minute limit address 501 by old minute limit address 405, then download apparatus 41 returns in the 3rd district 15 (being new first district 11) through all data that transmit port 403 and transmission line 45 write in former first district 11 again, make block be rearranged, and make the address of block can correspond to second program code.And second program code also is stored in the 4th district 17 (being new second district 13).
After finishing aforesaid operations, electronic installation 43 just can be started shooting again, and start back electronic installation 43 can operate according to second program code, and the data that are stored in first district 11 simultaneously originally also can not make a mistake because of the change of address.
Except above-mentioned embodiment, the present invention also can comprise one and download a device 41 and an electronic installation 43 as shown in Figure 6.Different with the embodiment of Fig. 5 is, the electronic installation 43 of Fig. 6 comprises evaluation unit 601, can shared according to second a program code voluntarily space and a suitable headspace, calculate new boundary position.The embodiment of Fig. 6 also can comprise one and scan unit 603, in order to scan the infringement block in the storer, makes headspace can comprise the size of damaging block.
Above narration only is explanation spirit of the present invention, should be with this as restriction.Those skilled in the art can do suitable variation under the category that claim contained that does not surmount the application.

Claims (16)

1. the method for a partitioned memory, this method is applicable to an electronic installation, this electronic installation comprises a storer, this storer is divided into one first district and one second district with one old minute limit address, this first district is in order to store data, this second district is in order to store one first required program code of this electronic installation running, and this method comprises the following step:
Download one second program code;
A new limit address of dividing is calculated in the space shared according to this second program code;
Newly the branch limit address is recorded in this storer, and cuts apart this storer again; And
Replace this first program code with this second program code.
2. the method for claim 1, when wherein carrying out this calculation procedure, this new minute limit address is to get according to this second program code shared a space and a headspace.
3. method as claimed in claim 2, this calculation procedure also comprise the address of a plurality of infringement blocks in this storer of scanning, and wherein this headspace comprises to the size of these a plurality of infringement blocks of small part.
4. the method for claim 1 wherein also comprises the following step:
Judge and newly to divide the limit address whether identical, if not, then write these data again to this first district with this old minute limit address.
5. the method for claim 1 wherein also comprises the following step:
Provide one to download device, this download apparatus has been deposited this second program code; And
Connect this download apparatus to this electronic installation.
6. the method for claim 1, when wherein carrying out this recording step, this new minute limit address is recorded in this second district.
7. the method for claim 1 also comprises:
Cutting apart this storer with this new minute limit address is one the 3rd district and one the 4th district;
Store these data in the 3rd district; And
Store this second program code in the 4th district.
8. the method for claim 1, wherein this storer is a NAND flash memory.
9. the method for claim 1, wherein this electronic installation is a mobile phone.
10. download apparatus, in order to upgrade a storer, this memory bit is in an electronic installation, and to cut apart this storer with one old minute limit address be one first district and one second district, this first district is in order to store data, this second district is in order to store one first required program code of this electronic installation running, and this download apparatus comprises:
One storage area, in order to store one second program code, this second program code is in order to replace this first program code; And
One transmit port is given this electronic installation in order to transmit this second program code;
Wherein, this download apparatus takes up space according to this second program code, calculates a new limit address of dividing, and this download apparatus is according to cutting apart this storer again in new branch limit address.
11. download apparatus as claimed in claim 10, wherein this download apparatus calculates and should newly divide the limit address also according to a headspace.
12. download apparatus as claimed in claim 11, this headspace comprises the size of a plurality of infringement blocks, and the block size of these a plurality of infringements is to determine after scanning this storer by this electronic installation.
13. download apparatus as claimed in claim 11, wherein this download apparatus is one the 3rd district and one the 4th district according to should new branch limit address cutting apart this storer, and this download apparatus is downloaded this second program code storage in the 4th district.
14. the electronic installation that can cut apart a storer again, this storer is divided into one first district and one second district with one old minute limit address, this first district is in order to store data, this second district is in order to store one first program code, this electronic installation comprises an evaluation unit, according to the shared space of one second program code, in order to calculate a new branch limit address, it is one the 3rd district and the 4th district that this storer is cut apart in this new branch limit address, and this second program code storage is in the 4th district.
15. electronic installation as claimed in claim 14, wherein this evaluation unit calculates and should newly divide the limit address also according to a headspace.
16. electronic installation as claimed in claim 15 also comprises:
The one scan unit, in order to scan a plurality of infringement blocks in this storer, this headspace comprises the size of these a plurality of infringement blocks.
CN 200410100326 2004-12-06 2004-12-06 Method and apparatus for partitioned memory Pending CN1787108A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200410100326 CN1787108A (en) 2004-12-06 2004-12-06 Method and apparatus for partitioned memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200410100326 CN1787108A (en) 2004-12-06 2004-12-06 Method and apparatus for partitioned memory

Publications (1)

Publication Number Publication Date
CN1787108A true CN1787108A (en) 2006-06-14

Family

ID=36784525

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200410100326 Pending CN1787108A (en) 2004-12-06 2004-12-06 Method and apparatus for partitioned memory

Country Status (1)

Country Link
CN (1) CN1787108A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100403280C (en) * 2006-09-20 2008-07-16 华为技术有限公司 Method and apparatus for updating data
CN101426099B (en) * 2007-10-31 2010-08-25 晨星半导体股份有限公司 Digital television system and method for processing data signal in digital television
CN105677457A (en) * 2016-01-05 2016-06-15 飞天诚信科技股份有限公司 Method and device for protecting program memory space through precise partitioning

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100403280C (en) * 2006-09-20 2008-07-16 华为技术有限公司 Method and apparatus for updating data
CN101426099B (en) * 2007-10-31 2010-08-25 晨星半导体股份有限公司 Digital television system and method for processing data signal in digital television
CN105677457A (en) * 2016-01-05 2016-06-15 飞天诚信科技股份有限公司 Method and device for protecting program memory space through precise partitioning
CN105677457B (en) * 2016-01-05 2019-04-12 飞天诚信科技股份有限公司 A kind of method and device by accurate partition protecting program's memory space

Similar Documents

Publication Publication Date Title
US8019932B2 (en) Block management for mass storage
USRE46404E1 (en) Flash memory management method
US20050216687A1 (en) Data managing method and data access system for storing all management data in management bank of non-volatile memory
US7210010B2 (en) Efficient system and method for updating a memory device
KR100324028B1 (en) Method for performing a continuous over-write of a file in a nonvolatile memory
KR100645540B1 (en) Apparatus and method for managing data on flash memory
EP1988474A1 (en) System and method of managing indexation of flash memory
EP1895418A1 (en) Nonvolatile memory device, method of writing data, and method of reading out data
WO1999054824A1 (en) Dynamic allocation for efficient management of variable sized data within a nonvolatile memory
CN1098526A (en) Flash file system
KR20080012778A (en) Memory management method and portable terminal device
EP1331643B1 (en) Differential flash memory programming technique
EP3834082A1 (en) Memory optimized block-based differential update algorithm
CN1339127A (en) Data allocation for multiple applications on a microprocessor or DSP
CN1787108A (en) Method and apparatus for partitioned memory
CN100364013C (en) Method for storing check code in memory and its device
US20070162707A1 (en) Information recording medium data processing apparatus and data recording method
US20030200232A1 (en) Information processor and program
KR100638638B1 (en) Method for controling flash memory device
CN115373608A (en) Data storage method and device
US20060095648A1 (en) Method and apparatus for partitioning a memory
CN1869931A (en) Update system and method for operation system of mobile terminal apparatus
CN111831231B (en) Partition merging and partition splitting method and device
KR100586031B1 (en) Method for the real-time database management using non-volatile memory
US20040098534A1 (en) Memory data managing method and allocation thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication