Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Plead paging management method to complete virtual memory

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Pleading bits and pieces are built on the foundation of fundamental pagination bits and pieces. In order to support the function of virtual memory, pleading function and page replacement function are added. Pleading for paging is the most commonly used way to complete virtual memory.

In pleading for paging bits and pieces, you only need to load a part of the pages you need in the future into memory, that is, you can start the operation of the industry. In the process of homework performance, when the page to be visited is not in memory, it can be called in by the paging function, and at the same time, the temporarily unnecessary pages can be swapped out to external memory through the replacement function, so as to free up memory space.

In order to complete the request paging, piecemeal must provide a certain amount of hardware support. In addition to the need for a certain capacity of memory and external memory computer bits and pieces, there is also a need for page table mechanism, missing page suffix mechanism and address conversion mechanism.

Page table mechanism

The mechanism of pleading for paging bits and pieces differs from the fundamental paging bits and pieces, pleading that paging bits and pieces do not require all to be called into memory at once before a homework is run, so in the course of homework operation, it is bound to show that the page to be visited is not in memory. How to find and deal with this situation are the two fundamental achievements that must be dealt with in pleading for pagination fragments. To do this, four fields are added to the table entry of the request page, as shown in figure 3-24.

Figure 3-24 pleads for page table items in paging bits and pieces

The four added fields are clarified as follows:

Morphological bit P: it is used to guide whether the page has been called into memory for reference when the program visits.

Visit field A: used to record the number of times this page has been visited in a period of time, or to record how long this page has not been visited, for reference when the replacement algorithm replaces the page.

Correction bit M: identifies whether the page can be corrected after it is called into memory.

Out-of-memory address: used to indicate the address of the page on the out-of-memory, usually the physical block number, for reference when calling into the page.

Missing page infix mechanism

In pleading for pagination bits and pieces, whenever the page to be visited is not in memory, a page fault suffix occurs, pleading for the operation to call the missing page into memory. At this time, the process of missing pages should be blocked (paging completes the wake-up call). If there is a leisure block in memory, a block is assigned, the page to be loaded into the block is loaded, and the page table item in response to the page table is modified. If there is no leisure block in memory at this time, a page should be engraved (if the page is corrected in the memory period, it should be written back to external memory).

The missing page suffix needs to be experienced as an infix, such as maintaining the CPU situation, analyzing the cause of the suffix, turning to the missing page suffix disposal program, restoring the CPU situation, and so on. However, compared with the ordinary infix, it has the following two distinct differences:

A signal is used in the occurrence and disposal of an instruction during the execution of an instruction, rather than an external infix after the execution of an instruction.

During the execution of an instruction, multiple page-missing suffixes can occur.

Address conversion mechanism

The address transformation mechanism in pleading for paging bits and pieces is formed on the basis of the paging piecemeal address transformation mechanism to complete the virtual memory and add some functions.

Figure 3-25 pleads for the address translation process in paging

As shown in figure 3-25, when stopping address translation, retrieve the quick table first:

If you find the page to visit, modify the visit bit in the page table item (and reset the correction bit if you write the instruction), and then use the physical block number and margin address given in the page table entry to form the physical address.

If the page table item of the page is not found, you should go to memory to find the page table, and then compare the form bit P in the page table item to see whether the page has been called into memory. If it is not called in, the missing page suffix occurs, pleading to call the page into memory from external memory.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report