"Operating System"-page storage Management

Source: Internet
Author: User

When it comes to page-based storage management, I think we should first say the user's program, because page-based storage management is for the user's program or process services, a program has been prepared after it certainly occupies space, that is, it certainly has the size of the program since there is a size can be divided, here, the program's logical space into several pages, Called a logical page is also called a page.

First, the Division of the page

What is the size of the page divided by what? This goes back to the partition of memory. The size of the page is divided by the size of the block in memory. What is an in-memory block that? Explain the block below. The page storage space divides the memory into several equal-length regions, each of which is usually a power of 2, and each area is a block, and the block number is numbered from 0, called the block number. What is the size of the chunking determined by? There is an address structure that determines the block size of the main memory, which is not explained here.

Now the page in the program corresponds to the block in memory, the address structure determines the block, the block determines the page, and the page has a page number and a page address, as in.


The total address length is assumed to be 15 bits, where the page number is 5 bits and the industry address occupies 10 bits. In this way, the logical address can have 32 pages (2 of five square =32), can be numbered 0-31, each page has 1024 bytes (2 10 =1024), and the number is 0-1023. From the address structure, the logical address is continuous, in the programming without considering how to paging, because when using a set of sequential address, if the address is 0-1023, this is obviously the No. 0 page, if it is 1024-2047, this is the 1th page, that is, the page number is 1.


Second, the realization principle

When the job executes, the main memory block number is found based on the page number in the address, in determining the absolute address of the main memory that the current instruction should access.

1. Page table: The system creates a page table for each process that records the correspondence between the page and the block, how many pages the address space has, how many rows are in the page table, and in the order in which the logical pages are arranged.

2. Address mapping process



3. Address Translation

Page Storage Management is also a dynamic relocation of the job, the job execution has a hardware address translation mechanism to complete from the logical address to the absolute address of the conversion work. During the execution of the job, the processor every command, let the address translation agencies in the logical address of the page number to look up the page table, the page number corresponding to the block number, that is, the block number of main memory, the found block number converted to an absolute address, and then add the program's page address, which read the program in memory of the absolute address.

Third, summary

The advantage of page storage management is that the continuous logical address space of a job is divided into pages, which can be allocated into discontinuous blocks in memory, that is, in the discontinuous main memory area allocated to the RAM, and can make the job execute correctly, thus further improving the utilization of main memory space. The disadvantage is that when processing a job, the processor must access two main memory, the first time is to access the page table to find the page number corresponding to the block number, and then the absolute address of the job, and the second time the processor in main memory according to the conversion process of the Jedi address and then operation.

"Operating System"-page storage Management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.