Nothing Special   »   [go: up one dir, main page]

CN1828557A - Process mapping realization method in embedded type operation system - Google Patents

Process mapping realization method in embedded type operation system Download PDF

Info

Publication number
CN1828557A
CN1828557A CNA2006100502588A CN200610050258A CN1828557A CN 1828557 A CN1828557 A CN 1828557A CN A2006100502588 A CNA2006100502588 A CN A2006100502588A CN 200610050258 A CN200610050258 A CN 200610050258A CN 1828557 A CN1828557 A CN 1828557A
Authority
CN
China
Prior art keywords
page
address
virtual space
space
register
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
CNA2006100502588A
Other languages
Chinese (zh)
Other versions
CN100342353C (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.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
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 Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CNB2006100502588A priority Critical patent/CN100342353C/en
Publication of CN1828557A publication Critical patent/CN1828557A/en
Application granted granted Critical
Publication of CN100342353C publication Critical patent/CN100342353C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

As the importance of process management in embedded OS, this invention realizes conversion from user address to physical address by virtual address mapping, and divides the virtual address into the kernel state and user state for right address conversion and saving space. This invention has important meaning to embed OS.

Description

Process mapping implementation method in the embedded OS
Technical field
The present invention relates to the real-time task treatment technology, particularly relate to process mapping implementation method in a kind of embedded OS.
Background technology
Storage administration is the important component part of operating system, and it is in charge of the storer of computer system.Storer can be divided into primary memory (abbreviation main memory) and supplementary storage (being called for short auxilliary depositing) two classes.
Two parts in the general branch of the storage space of primary memory: a part is a system region, deposit operation system and some standard subroutines, routine etc.; Another part is the user area, deposits user's program and data etc.Storage administration mainly is that the user area in the primary memory is managed.
After computer system adopts the multiprogramming designing technique, often will in primary memory, deposit the program of a plurality of processes simultaneously, and the position of these programs in primary memory can not be known in advance, so the user can not use specific address when coding.Address normally, the indicated address of address portion in the instruction of modern computer, logical address can be from 0 open numbering.The user is by the logical address coding.In the time will packing program into computing machine, at first, operating system will be distributed a suitable primary memory space for it.Because logical address is often inconsistent with the specific address of the primary memory space that is assigned to, and the processor execution command is undertaken by specific address, so must convert logical address to true storeroom that specific address just can obtain information.The work that logical address is converted to specific address claims address translation.
During a plurality of process shared main storage, must protect program in the primary memory and data, and transfer rationally and effectively, to reach the efficient of giving full play to primary memory.
Program for the convenience of the user, be not subjected to the restriction of primary memory actual capacity when making user written program, can adopt certain technology " expansion " main memory capacity, can use to obtain the primary memory space bigger than actual capacity.
Summary of the invention
The object of the present invention is to provide process mapping implementation method in a kind of embedded OS.
The technical scheme that the present invention solves its technical matters employing is as follows:
Deposit for each process provides two void, one is that void under the kernel mode is deposited, and uses that group active page register under this attitude to realize the mapping of its void, physical address; One is that void under user's attitude is deposited, and uses that group active page register under this attitude to realize the mapping of its void, physical address.Void under these two states is deposited, and the most mostly is the 64K byte.
1) address, Virtual Space
Under the support of memory management unit, 16 byte address no longer is directly interpreted as physical address, and is counted as address, a Virtual Space;
The Virtual Space address space of 64K byte is divided into 8 pages, and every page is divided into 128, and every is 64 bytes, then every page can reach the 8K byte at most, in order to make full use of memory headroom, system comes the storage allocation space by the actual page length of empty page or leaf;
2) active page register
Void is deposited the physical location of page or leaf in internal memory, needs a map list and is reflected, this map list is what be made up of two groups of active page registers, and one group is used for kernel mode, and one group is used for user's attitude.Every group has 8 32 long registers, and each is divided into two: one is page address register, and one is a page explanation register;
Page address register is used for writing down corresponding each page of Virtual Space address space at the starting block of internal memory number;
Page or leaf explanation register is writing down the length of access right, propagation direction and this page or leaf of corresponding each page of Virtual Space address space.The bright access right of the 1st, 2 bit tables of register to corresponding page or leaf, the propagation direction of bright this page or leaf of the 3rd bit table, the 8th~14 of register is the physical length of this void page or leaf, represents with containing how many pieces;
The conversion of 3) void---physical address
Obtaining after void deposits space address, realizing conversion from the address, Virtual Space to physical address according to following process:
The first step according to the 14th, 15 of processor status word, is determined the present residing running status of processor, selects corresponding active page register group thus;
In second step, obtain corresponding page address register homepage explanation register in this group by the page number in the address, Virtual Space;
In the 3rd step,, and illustrate that by page or leaf register checks the legitimacy of this piece number by the physical block number in " in the page or leaf piece number " the formation internal memory in " this page or leaf internal memory starting block number " in the page address register and the address, Virtual Space;
In the 4th step, constitute this pairing physical address in address, Virtual Space by " displacement " in physical block number and the address, Virtual Space.
4) the Virtual Space address space of process under kernel mode
Under kernel mode, what process was moved is operating system program, use core stack district, use the user structure of this process, and the composition of the Virtual Space address space under this attitude comprises:
Under user's attitude, relate to shared text segment, data field, and user stack district during the process operation
5) actual distribution of process image in internal memory
1. 0~5 page kernel mode Virtual Space address space is contained in the low address place that internal memory 0 address begins, memory-resident;
2. the 7th page of input and output page or leaf of kernel mode Virtual Space address space is contained in the internal memory 8K space that superlatively location is located memory-resident;
3. according to current storage allocation situation, be that unit is placed on shared text segment in the continuum with the memory block;
4. according to current storage allocation situation, with the memory block is that unit is placed on data field in the content of 1024 bytes in the address space of kernel mode Virtual Space, the user's attitude Virtual Space address space and user stack district in the continuum, constitutes the data segment of process image;
5. process image all number being sent into the corresponding shared text segment of internal memory at the starting block of the shared text segment of the process of internal memory preserves.
The beneficial effect that the present invention has is: the present invention adopts the way of virtual address map to realize the conversion of station address to physical address; and virtual address is divided into kernel state and user's attitude; divide protection level; both guaranteed the correct address conversion of each process; extract the shared data of each process again, saved storage space, no matter be memory management operating system; still be the operation of writing of user program, maximum convenience, safety and efficient all is provided.
Description of drawings
Address, Fig. 1 Virtual Space;
Fig. 2 processor status word;
Fig. 3 page address register;
Fig. 4 also illustrates register;
Fig. 5 virtual object reason address translation;
The actual distribution of Fig. 6 process image in internal memory.
Embodiment
When implementing real-time task scheduling, adopt the c language compilation, concrete mode is as follows:
Deposit for each process provides two void, one is that void under the kernel mode is deposited, and uses that group active page register under this attitude to realize the mapping of its void, physical address; One is that void under user's attitude is deposited, and uses that group active page register under this attitude to realize the mapping of its void, physical address.Void under these two states is deposited, and the most mostly is the 64K byte.
1) address, Virtual Space
Under the support of memory management unit, 16 byte address no longer is directly interpreted as physical address, and is counted as address, a Virtual Space, as shown in Figure 1:
The Virtual Space address space of 64K byte is divided into 8 pages, and every page is divided into 128, and every is 64 bytes, then every page can reach the 8K byte at most, in order to make full use of memory headroom, system comes the storage allocation space by the actual page length of empty page or leaf.
2) active page register
Void is deposited the physical location of page or leaf in internal memory, needs a map list and is reflected, this map list is what be made up of two groups of active page registers, and one group is used for kernel mode, and one group is used for user's attitude.Every group has 8 32 long registers, and each is divided into two: one is page address register, and as Fig. 3, one is a page explanation register, as Fig. 4:
Page address register is used for writing down corresponding each page of Virtual Space address space at the starting block of internal memory number.Is internal memory that unit is divided into piece by 64 bytes, total 4096=2 12Piece is numbered 0~(2 12-1), Memory Allocation is unit with the piece.Each page address register only uses it low 12, is used for writing down corresponding each page of Virtual Space address space at the starting block of internal memory number.
Page or leaf explanation register is writing down the length of access right, propagation direction and this page or leaf of corresponding each page of Virtual Space address space.The bright access right of the 1st, 2 bit tables of register to corresponding page or leaf, the propagation direction of bright this page or leaf of the 3rd bit table, the 8th~14 of register is the physical length of this void page or leaf, represents with containing how many pieces.
The conversion of 3) void---physical address
Obtaining after void deposits space address, realizing conversion from the address, Virtual Space to physical address according to following process, as shown in Figure 5:
The first step according to the 14th, 15 of processor status word (as shown in Figure 2), is determined the present residing running status of processor, selects corresponding active page register group thus;
In second step, obtain corresponding page address register homepage explanation register in this group by the page number in the address, Virtual Space;
In the 3rd step,, and illustrate that by page or leaf register checks the legitimacy of this piece number by the physical block number in " in the page or leaf piece number " the formation internal memory in " this page or leaf internal memory starting block number " in the page address register and the address, Virtual Space;
In the 4th step, constitute this pairing physical address in address, Virtual Space by " displacement " in physical block number and the address, Virtual Space.
4) the Virtual Space address space of process under kernel mode
Under kernel mode, what process was moved is operating system program, use core stack district, use the user structure of this process, and wherein, 0~5 page of deposit operation system code comprises the core resident process structure here; Deposit and the content that system imports, output is relevant, claim input, output page for the 7th page; The 6th page of partial code district of putting existing operation process, promptly user structure and core stack are actual only with 1024 bytes.Concerning all processes, the 0th~5 page with the 7th page totally seven pages content all be identical.
Under user's attitude, relate to shared text segment, data field, and user stack district during the process operation:
The arrangement principle of the Virtual Space address space under this attitude is:
1. share text segment, data field again by low toward the high elder generation that arranges; Place the stack district from high to lower;
2. be allocation unit with the page or leaf, discontented one page is made uniform by page or leaf.Shown in Figure 14 (a), be 2.5 pages if share text segment length, then in the address space of Virtual Space, occupy 0~2 page; The data field is 2.25 pages, then is right after shared text segment and occupies 3~5 pages in the address space of Virtual Space; The stack district is 0.5 page, then occupies the 7th page of Virtual Space address space, and extends to the low address direction.At this moment the 6th of the imaginary space the page is blank, unoccupied.
5) actual distribution of process image in internal memory
Though each process all has the Virtual Space address space of a kernel mode, the content of the 0th~5 in them and the 7th page is duplicate.In addition, even user's attitude Virtual Space of each process can not intactly be indiscriminately imitated in the internal memory by its distribution condition, otherwise can cause the huge waste of memory headroom.Therefore, each process image is in the true distribution situation of internal memory, as shown in Figure 6:
1. 0~5 page kernel mode Virtual Space address space is contained in the low address place that internal memory 0 address begins, memory-resident;
2. the 7th page of input and output page or leaf of kernel mode Virtual Space address space is contained in the internal memory 8K space that superlatively location is located memory-resident;
3. according to current storage allocation situation, be that unit is placed on shared text segment in the continuum with the memory block;
4. according to current storage allocation situation, with the memory block is that unit is placed on data field in the content of 1024 bytes in the address space of kernel mode Virtual Space, the user's attitude Virtual Space address space and user stack district in the continuum, constitutes the data segment of process image;
5. process image all number being sent into the corresponding shared text segment of internal memory at the starting block of the shared text segment of the process of internal memory preserves.

Claims (1)

1. process mapping implementation method in the embedded OS is characterized in that:
Deposit for each process provides two void, one is that void under the kernel mode is deposited, and uses that group active page register under this attitude to realize the mapping of its void, physical address; One is that void under user's attitude is deposited, and uses that group active page register under this attitude to realize the mapping of its void, physical address, and the void under these two states is deposited, and the most mostly is the 64K byte;
1) address, Virtual Space
Under the support of memory management unit, 16 byte address no longer is directly interpreted as physical address, and is counted as address, a Virtual Space;
The Virtual Space address space of 64K byte is divided into 8 pages, and every page is divided into 128, and every is 64 bytes, then every page can reach the 8K byte at most, in order to make full use of memory headroom, system comes the storage allocation space by the actual page length of empty page or leaf;
2) active page register
Void is deposited the physical location of page or leaf in internal memory, needing a map list is reflected, this map list is being made up of two groups of active page registers, one group is used for kernel mode, one group is used for user's attitude, every group has 8 32 long registers, and each is divided into two: one is page address register, and one is a page explanation register;
Page address register is used for writing down corresponding each page of Virtual Space address space at the starting block of internal memory number;
Page or leaf explanation register, writing down the length of access right, propagation direction and this page or leaf of corresponding each page of Virtual Space address space, the bright access right of the 1st, 2 bit tables of register to corresponding page or leaf, the propagation direction of bright this page or leaf of the 3rd bit table, the 8th~14 of register is the physical length of this void page or leaf, represents with containing how many pieces;
The conversion of 3) void---physical address
Obtaining after void deposits space address, realizing conversion from the address, Virtual Space to physical address according to following process:
The first step according to the 14th, 15 of processor status word, is determined the present residing running status of processor, selects corresponding active page register group thus;
In second step, obtain corresponding page address register page or leaf explanation register in this group by the page number in the address, Virtual Space;
In the 3rd step,, and illustrate that by page or leaf register checks the legitimacy of this piece number by the physical block number in " in the page or leaf piece number " the formation internal memory in " this page or leaf internal memory starting block number " in the page address register and the address, Virtual Space;
In the 4th step, constitute this pairing physical address in address, Virtual Space by " displacement " in physical block number and the address, Virtual Space;
4) the Virtual Space address space of process under kernel mode;
Under kernel mode, what process was moved is operating system program, use core stack district, use the user structure of this process, and the composition of the Virtual Space address space under this attitude comprises:
Under user's attitude, relate to shared text segment, data field, and user stack district during the process operation;
5) actual distribution of process image in internal memory
1. 0~5 page kernel mode Virtual Space address space is contained in the low address place that internal memory 0 address begins, memory-resident;
2. the 7th page of input and output page or leaf of kernel mode Virtual Space address space is contained in the internal memory 8K space that superlatively location is located memory-resident;
3. according to current storage allocation situation, be that unit is placed on shared text segment in the continuum with the memory block;
4. according to current storage allocation situation, with the memory block is that unit is placed on data field in the content of 1024 bytes in the address space of kernel mode Virtual Space, the user's attitude Virtual Space address space and user stack district in the continuum, constitutes the data segment of process image;
5. process image all number being sent into the corresponding shared text segment of internal memory at the starting block of the shared text segment of the process of internal memory preserves.
CNB2006100502588A 2006-04-07 2006-04-07 Process mapping realization method in embedded type operation system Expired - Fee Related CN100342353C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100502588A CN100342353C (en) 2006-04-07 2006-04-07 Process mapping realization method in embedded type operation system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100502588A CN100342353C (en) 2006-04-07 2006-04-07 Process mapping realization method in embedded type operation system

Publications (2)

Publication Number Publication Date
CN1828557A true CN1828557A (en) 2006-09-06
CN100342353C CN100342353C (en) 2007-10-10

Family

ID=36946967

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100502588A Expired - Fee Related CN100342353C (en) 2006-04-07 2006-04-07 Process mapping realization method in embedded type operation system

Country Status (1)

Country Link
CN (1) CN100342353C (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101201794B (en) * 2006-12-15 2010-08-18 中兴通讯股份有限公司 Method and system for determining EMS memory occupation of software
CN101950274A (en) * 2010-07-14 2011-01-19 北京北大众志微系统科技有限责任公司 Data access device based on supervisor mode maintenance and problem mode share as well as method thereof
CN101252527B (en) * 2008-04-09 2011-01-26 腾讯科技(深圳)有限公司 Method for transferring network, network transfer server and inner core managing module
CN101478549B (en) * 2009-01-20 2011-10-05 电子科技大学 Operation method for memory sharing media server and functional module construction
CN102446136A (en) * 2010-10-14 2012-05-09 无锡江南计算技术研究所 Self-adaptive large page allocation method and device
CN101398759B (en) * 2007-06-29 2012-06-13 北京中星微电子有限公司 Method for avoiding self-updating of startup code when data block moving
CN106502924A (en) * 2016-10-27 2017-03-15 深圳创维数字技术有限公司 A kind of Memory Optimize Method and system
CN107273213A (en) * 2017-06-27 2017-10-20 联想(北京)有限公司 A kind of calculation control method, network interface card and electronic equipment
CN108090347A (en) * 2016-11-23 2018-05-29 阿里巴巴集团控股有限公司 A kind of data processing method and system
CN109683983A (en) * 2018-12-11 2019-04-26 青岛海信电器股份有限公司 A kind of generation of image file and loading method, equipment
CN110554973A (en) * 2018-06-03 2019-12-10 苹果公司 memory page reclamation in user idle mode

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6598144B1 (en) * 2001-12-12 2003-07-22 Advanced Micro Devices, Inc. Arrangement for limiting access to addresses by a consumer process instigating work in a channel adapter based on virtual address mapping
JP4128468B2 (en) * 2002-02-25 2008-07-30 株式会社リコー Information processing apparatus and memory map method

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101201794B (en) * 2006-12-15 2010-08-18 中兴通讯股份有限公司 Method and system for determining EMS memory occupation of software
CN101398759B (en) * 2007-06-29 2012-06-13 北京中星微电子有限公司 Method for avoiding self-updating of startup code when data block moving
CN101252527B (en) * 2008-04-09 2011-01-26 腾讯科技(深圳)有限公司 Method for transferring network, network transfer server and inner core managing module
CN101478549B (en) * 2009-01-20 2011-10-05 电子科技大学 Operation method for memory sharing media server and functional module construction
CN101950274B (en) * 2010-07-14 2012-06-20 北京北大众志微系统科技有限责任公司 Data access device based on supervisor mode maintenance and problem mode share as well as method thereof
CN101950274A (en) * 2010-07-14 2011-01-19 北京北大众志微系统科技有限责任公司 Data access device based on supervisor mode maintenance and problem mode share as well as method thereof
CN102446136A (en) * 2010-10-14 2012-05-09 无锡江南计算技术研究所 Self-adaptive large page allocation method and device
CN102446136B (en) * 2010-10-14 2014-09-03 无锡江南计算技术研究所 Self-adaptive large-page allocation method and device
CN106502924A (en) * 2016-10-27 2017-03-15 深圳创维数字技术有限公司 A kind of Memory Optimize Method and system
CN106502924B (en) * 2016-10-27 2020-02-07 深圳创维数字技术有限公司 Memory optimization method and system
CN108090347A (en) * 2016-11-23 2018-05-29 阿里巴巴集团控股有限公司 A kind of data processing method and system
CN107273213A (en) * 2017-06-27 2017-10-20 联想(北京)有限公司 A kind of calculation control method, network interface card and electronic equipment
CN107273213B (en) * 2017-06-27 2024-04-19 联想(北京)有限公司 Calculation control method, network card and electronic equipment
CN110554973A (en) * 2018-06-03 2019-12-10 苹果公司 memory page reclamation in user idle mode
CN109683983A (en) * 2018-12-11 2019-04-26 青岛海信电器股份有限公司 A kind of generation of image file and loading method, equipment

Also Published As

Publication number Publication date
CN100342353C (en) 2007-10-10

Similar Documents

Publication Publication Date Title
CN100342353C (en) Process mapping realization method in embedded type operation system
US5560003A (en) System and hardware module for incremental real time garbage collection and memory management
CN102792285B (en) For the treatment of the apparatus and method of data
CN101075214A (en) Method and system for managing memory
US9189446B2 (en) Immutable sharable zero-copy data and streaming
CN1389790A (en) Flash storage management method
CN1271524C (en) Static internal storage management method
CN1343332A (en) Linear address extension and mapping to physical memory using 4 and 8 byte page table entries in 32-bit microprocessor
CA2896518C (en) Shared and managed memory unified access
CN85106711A (en) The storage administration of microprocessor system
CN1851677A (en) Embedded processor system and its data operating method
CN1499379A (en) Method and appts. aiming at isomeric system structure for covering management in integrated executable program
EP2941704B1 (en) Zero-copy caching
CN1650266A (en) Time-multiplexed speculative multi-threading to support single-threaded applications
Yu et al. Redesign the memory allocator for non-volatile main memory
CN101030148A (en) Method and device for realizing double mapping
CN1851676A (en) Embedded system buffer internal memory distribution method
Chen et al. A unified framework for designing high performance in-memory and hybrid memory file systems
CN1851675A (en) Processor high-speed data buffer memory reconfiguration method
CN1269043C (en) Remapping method of internallystored address
CN1731371A (en) Method of storage unit access in digital signal processing system and processing system therefor
CN1892603A (en) Offset distribution optimizing method based on combination parallel algorithm
Hu et al. Run-time support for distributed sharing in typed languages
CN1622056A (en) Method for accessing files
CN1746863A (en) Object reuse test of operation system based on absolute coordinate system

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: 20071010

Termination date: 20120407