CN1508695A - Physical internal memory mapping and reading-writing method - Google Patents

Physical internal memory mapping and reading-writing method Download PDF

Info

Publication number
CN1508695A
CN1508695A CNA021578141A CN02157814A CN1508695A CN 1508695 A CN1508695 A CN 1508695A CN A021578141 A CNA021578141 A CN A021578141A CN 02157814 A CN02157814 A CN 02157814A CN 1508695 A CN1508695 A CN 1508695A
Authority
CN
China
Prior art keywords
address
mapping
physical memory
reading
read
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.)
Granted
Application number
CNA021578141A
Other languages
Chinese (zh)
Other versions
CN1266613C (en
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.)
Inventec Corp
Original Assignee
Inventec 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 Inventec Corp filed Critical Inventec Corp
Priority to CN 02157814 priority Critical patent/CN1266613C/en
Publication of CN1508695A publication Critical patent/CN1508695A/en
Application granted granted Critical
Publication of CN1266613C publication Critical patent/CN1266613C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Storage Device Security (AREA)

Abstract

The invention is a mapping and read/write method of a kind of physical memory, it realizes the direct access to the physical memory through the mapping of the physical memory, it includes following steps: initializes the driving program; calling the read/write function, and transmits a structure body from the application program; according to the structure parameter, the driving program maps the address, and returns the mapped address to the application program; carries on memory read/write according to the returned address; aborts the address mapping, and releases virtual address.

Description

The mapping of physical memory and reading/writing method
Technical field
The present invention relates to a kind of reading/writing method of physical memory, particularly a kind of method that application program is directly visited physical memory.
Background technology
In computer system, physical memory (Physical Memory) is very important, and all application programs and most device driver all will be used it.Just because of its importance, so operating system just protects it, it often is under the protected mode, to avoid the user that it is had a mind to or to destroy unintentionally.
But, do so also and can bring some inconvenience, in this case, the memory address of user applies is not physical address but the address of virtual memory, and virtual memory is made up of a part of space on physical memory and the hard disk.For example, be the internal storage location of 0xFEC71 for physical memory, when we visit it, can not be in program direct visit 0xFEC71 because address at this time is counted as virtual address, we really will visit is address after it is shone upon.
According to the conventional method, internal storage access is realized by the application chunk address, do like this that not only efficient is low, and can not control the position of applied address, because we are when memory headroom of system's application, system returns the start address of this part corresponding virtual memory in space come, finish our demand, it includes only application layer.In some applications, for example test memory the time, just there is bigger defective in this method.
See also table 1, be physical memory addresses block synoptic diagram.
Address block 1 ?0X10000000
Address block 1 ?0X10100000
Address block 1 ?0X10200000
Address block 1 ?0X10300000
Address block 1 ?0X10400000
Table 1
Suppose that certain physics memory address is made up of address block 1-5, if adopt the method for existing application memory headroom to be used for some application, as be used for test memory, then there are the following problems: at first, we do not know that we apply in have residing position in the physical memory, can't determine that promptly the physical memory that takies is address block 1 or address block 2, this has just caused the uncertainty of application memory headroom; Secondly, see it is continuous on the virtual memory surface by system assignment, be dispersed in the physical memory that promptly might take address block 1 and 3 rather than address block 1 and 2, this just causes the incoherence of memory test and in fact may be divided into several fritters; At last, when we repeatedly applied for memory headroom, the physical memory zone that system distributes each time might be repeated, and promptly took for the first time address block 1 and 2, and having taken for the second time address block 1 and 3 rather than our address block 3 and 4 of wishing, this just causes the repetition of test and not comprehensive.
Summary of the invention
Technical matters to be solved by this invention provides a kind of mapping and reading/writing method of physical memory, can pass through the mapping to physical memory, and realizes address location as required directly being visited by physical memory accurately.
For achieving the above object, the invention provides a kind of mapping and reading/writing method of physical memory, comprise the steps: at least
The initialization driver;
Call read, from application program, pass a structure;
According to the structure parameter, driver shines upon the address, and application program is returned in the address after will shining upon;
Carry out memory read-write according to the address of returning; And
The cancellation map addresses discharges virtual address.
The present invention is a kind of mapping and reading/writing method of physical memory, the method of this visit physical memory is simple and very safe, has avoided many unforeseen mistakes, can visit the address and the length of the memory headroom of appointment accurately, efficient is very high, uses also very flexible.The present invention for example is applied in the test of internal memory applicable to any module that needs read/write memory, can realize accurately, continuously, not repeat and comprehensively test effect.
For making purpose of the present invention, feature and function thereof that further understanding be arranged, conjunction with figs. is described in detail as follows:
Description of drawings
Fig. 1 is the mapping of physical memory of the present invention and the applied environment synoptic diagram of reading/writing method; And
Fig. 2 is the mapping and the reading/writing method process flow diagram of physical memory of the present invention.
Wherein, description of reference numerals is as follows:
10--user, 20--read/write memory module, 21--application layer, the 22--driver layer, step 301--initialization driver, step 302--calls read, passes a structure from application program, step 303--is according to the structure parameter, driver shines upon the address, and the address after will shining upon returns application program, and step 304--carries out memory read-write according to the address of returning, step 305--cancels map addresses, discharges virtual address.
Embodiment
The present invention is applicable to any module that needs read/write memory.See also Fig. 1, applied environment synoptic diagram of the present invention.User 10 can specify by interface function and comprise start address, length and data buffer read parameters such as (Buffer).In read/write memory module 20, comprise application layer 21 and driver layer 22.Application layer 21 is responsible for initialization, unloading driver, propagation function code and parameter, and the work of read/write memory.Driver layer mainly is responsible for the memory block of mapping ad-hoc location and size, returns the linear address of current process.
See also Fig. 2, the mapping of physical memory of the present invention and reading/writing method process flow diagram.At first, initialization driver (step 301); Then, call read, from application program, pass a structure (step 302); According to the structure parameter, driver shines upon the address, and application program (step 303) is returned in the address after will shining upon; Carry out memory read-write (step 304) according to the address of returning; At last, the cancellation map addresses discharges virtual address (step 305).
After above-mentioned steps, preferably carry out the step of a unloading driver again.Though it is optional, can discharge the shared internal memory of driver behind the unloading driver, saved resource.
Above-mentioned driver is a driving that is in kernel mode (Kernel Mode) that creates in advance, and its function is to realize the mapping of address.The user can manage driving by the class of encapsulation, and data write to be the public member function that calls class finish.
The step of above-mentioned initialization driver, its effect is the load driver program, comprises that the deletion legacy version drives, installs actions such as driving and activate driving, successfully just carries out next step if load.
The above-mentioned step of calling read, alternative read has multiple, and the key distinction is the length difference read and write.The parameter of read comprises start address, length and data buffer, and these parameters can be specified by user oneself.
In the above-mentioned structure that biography is advanced from application program, comprise the physical memory start address of needs mapping, the length of address and three master datas in address after the mapping.
Read passes to driver with start address and the length that the user provides, and the address after in driver the address being shone upon and will shine upon returns to application program.The common virtual address of this address and application access is the same, uses common memory pool access method just can read and write data.
After the read-write end, need the cancellation mapping, purpose is to discharge the virtual address that we take, and it is returned to system's continuation use.
Though embodiments of the invention openly as mentioned above; right its is not in order to limit the present invention; anyly have the knack of related art techniques person; without departing from the spirit and scope of the present invention; can do further to change and retouching, so the claimed interest field of the present invention should be as the criterion with claims scope required for protection.

Claims (7)

1. the mapping of a physical memory and reading/writing method is characterized in that comprising the steps:
The initialization driver;
Call read, from application program, pass a structure;
According to the structure parameter, driver shines upon the address, and application program is returned in the address after will shining upon;
Carry out memory read-write according to the address of returning; And
The cancellation map addresses discharges virtual address.
2. the mapping of physical memory and reading/writing method according to claim 1 is characterized in that discharging after the virtual address step in the cancellation map addresses, can comprise the step of a unloading driver.
3. the mapping of physical memory and reading/writing method according to claim 1 is characterized in that described driver is to be in kernel mode, is used to realize the mapping of address.
4. the mapping of physical memory and reading/writing method according to claim 1 is characterized in that the step of described initialization driver, comprise that the deletion legacy version drives, installs and drive and start actions such as driving.
5. the mapping of physical memory and reading/writing method according to claim 1 is characterized in that the described step of calling read, and the parameter of read comprises start address, length and data field.
6. as the mapping and the reading/writing method of physical memory as described in the claim 5, it is characterized in that the parameter of described read can be specified by the user.
7. the mapping of physical memory and reading/writing method according to claim 1 is characterized in that the described structure of advancing that passes from application program, comprise needs mapping physical memory start address, address length and shine upon after three master datas in address.
CN 02157814 2002-12-19 2002-12-19 Physical internal memory mapping and reading-writing method Expired - Fee Related CN1266613C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 02157814 CN1266613C (en) 2002-12-19 2002-12-19 Physical internal memory mapping and reading-writing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 02157814 CN1266613C (en) 2002-12-19 2002-12-19 Physical internal memory mapping and reading-writing method

Publications (2)

Publication Number Publication Date
CN1508695A true CN1508695A (en) 2004-06-30
CN1266613C CN1266613C (en) 2006-07-26

Family

ID=34236718

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 02157814 Expired - Fee Related CN1266613C (en) 2002-12-19 2002-12-19 Physical internal memory mapping and reading-writing method

Country Status (1)

Country Link
CN (1) CN1266613C (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309819A (en) * 2013-05-30 2013-09-18 苏州亮智科技有限公司 Embedded system and safety managing method for internal storage thereof
CN104346275A (en) * 2013-08-07 2015-02-11 鸿富锦精密工业(深圳)有限公司 Memory test system and method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309819A (en) * 2013-05-30 2013-09-18 苏州亮智科技有限公司 Embedded system and safety managing method for internal storage thereof
CN103309819B (en) * 2013-05-30 2016-06-22 苏州亮智科技有限公司 Embedded system and internal memory method for managing security therein
CN104346275A (en) * 2013-08-07 2015-02-11 鸿富锦精密工业(深圳)有限公司 Memory test system and method

Also Published As

Publication number Publication date
CN1266613C (en) 2006-07-26

Similar Documents

Publication Publication Date Title
US9785370B2 (en) Method and system for automatically preserving persistent storage
EP0882264B1 (en) Flash memory mass storage system and associated method
US6516397B2 (en) Virtual memory system utilizing data compression implemented through a device
Park et al. A high performance controller for NAND flash-based solid state disk (NSSD)
US6275857B1 (en) System and method for freeing shared resources in a computer system
AU2007239066B2 (en) Describing and querying discrete regions of flash storage
JPH06309224A (en) Method for data page control and data processing system
US20070094445A1 (en) Method to enable fast disk caching and efficient operations on solid state disks
CN103150256B (en) Improve method and the device of USB flash memory write performance
CN1584848A (en) Systems and methods for storing data on computer systems
JP2005505818A (en) Flash management system using only sequential writing
KR20010039936A (en) A method and system for managing a cache memory
CN1722109A (en) The storage system of increment merging method and this method of use
WO2003107221B1 (en) Layered computing systems and methods
CN1991796A (en) Demand paging apparatus and method for embedded system
TW201015328A (en) Solid state storage system and method of controlling solid state storage system using a multi-plane method and an interleaving method
JP4222917B2 (en) Virtual storage system and operation method thereof
KR20200123850A (en) Hybrid memory system
US7861074B2 (en) Electronic systems using flash memory modules as main storage and related system booting methods
EP0939359A2 (en) Dynamic ram disk
JP4480479B2 (en) Storage system
Park et al. Anti-aging lfs: Self-defragmentation with fragmentation-aware cleaning
CN1740981A (en) A computer hardware data multi-timepoint fast storing and recovery method
CN1266613C (en) Physical internal memory mapping and reading-writing method
US6948009B2 (en) Method, system, and article of manufacture for increasing processor utilization

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20060726

Termination date: 20101219