Operating System-webpage storage management and operating system storage

Source: Internet
Author: User

Operating System-webpage storage management and operating system storage

When talking about page-based storage management, I would like to talk about the user's program first, because page-based storage management serves the user's program or processes. After a program is compiled, it will definitely occupy space, that is to say, it must have a size. Since the program has a size, it can be divided. Here, the logical space of the program is divided into several pages, also known as a logical page or page.

I. Page Division

What is the page size based on? This traces back to the memory division. The page size is based on the block size in the memory. What is a block in the memory? The following explains the block. The page-based storage space divides the memory into several extended areas. The size of each area is generally an integer power of 2. Each area is a block and the block number starts from 0, it is called a block number. What determines the block size? The address structure determines the block size of the primary memory.

The page in the program corresponds to the block in the memory. The address structure determines the block and the block determines the page. The page consists of the page number and the address in the page, for example.


It is assumed that the total address length is 15 characters, of which the page number occupies 5 places and the industry address occupies 10 places. In this way, the logical address can have 32 pages (the fifth power of 2 = 32), can be numbered 0-31, each page has 1024 bytes (the tenth power of 2 = 1024 ), the ID is 0-1023. From the perspective of address structure, the logical address is continuous, so you do not need to consider how to paging when programming, because when using a group of sequential addresses, if the address is 0-1023, obviously, if the page number is 0th-1024, the page number is 1.


II. Implementation Principle

During job execution, find the primary storage block number based on the page number in the address, and determine the absolute address of the primary storage to be accessed by the current command.

1. page table: the system creates a page table for each process to record the relationship between pages and blocks. The page table contains rows as to the address space, and arranged in the order on the logical page.

2. Address ing Process



3. Address Translation

Page-based storage management also uses dynamic relocation to load jobs. During job execution, there is a hardware address translation mechanism to complete the conversion from the logical address to the absolute address pair. During job execution, each time the processor executes a command, the address translation organization queries the page table according to the page number in the logical address to obtain the block number corresponding to the page number, that is, the block number of the primary storage, convert the block number to an absolute address, and then add the address on the page of the program. This shows the absolute address of the program in the memory.

Iii. Summary

The advantage of page-based storage management is to divide the continuous logical address space of a job into pages, which can be allocated to discontinuous blocks in the memory, that is, to the discontinuous primary storage areas in the memory, in addition, the job can be correctly executed, which further improves the utilization of the primary storage space. The disadvantage is that when the processor processes a job, it must access the primary memory twice. The first time it accesses the page table, it finds the block number corresponding to the page number, and then calculates the absolute address of the job, the second operation is performed by the processor based on the Jedi address of the program in the primary storage.

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.