Operating System - Chapter 4 Problem resolved

Chapter 4 Problem resolved

1. Why do you want to configure hierarchical memory?
A: This is because:
  . A plurality of memory enables the hardware at both ends of the memory can work in parallel.
  b. The use multilevel storage system, in particular Cache technology, this is the preferred construction scheme to mitigate the effects on the performance of the system memory bandwidth.
  c. Set various buffer memory inside the microprocessor, to reduce pressure on memory access. Increasing the number of registers in the CPU, but also can greatly alleviate pressure on the memory.
2. What are the different ways the program can be loaded into memory? They are suitable for what occasion?
A: the program into memory mode may be employed are: absolute load mode, load mode relocation, dynamic fashion into the operating mode; absolute load mode for single channel program environment, relocation and dynamic run mode load fashion the way for multi-channel programming environment.
3. What is statically linked? Need to solve two static linking problem?
A: static linking means before the program is run, the first goal of each module and their required library functions, links into a complete load module will no longer open link the way.
  When the target link several assembled into a load module, the need to address the following two issues:
    the relative address to be modified. Coming relative address except for the first module relative to the corresponding modified address loaded modules.
    Transform external call symbol. Each symbol external calls coming module used, are converted to a relative address.
4. What is the dynamic link load? What are the advantages of dynamic linking way when loading?
A: When loading a dynamic link refers to the user group of the target block obtained by compiling a source program, when loaded into memory, it uses a charged side edge link

Linking, i.e. when a certain load modules, if module calls an external event occurs, the load program will cause the object module corresponding external look, loads it into memory, and modifying a relative address of the target module.

When loading a dynamic link embodiment has the following advantages:
  1) easy to modify and update 2) to facilitate the sharing of object modules

5. What is the run-time dynamic linking? What are the advantages of dynamic linking run time?
A: The run-time dynamic linking is a link to defer some of the modules are linked only to program execution, that is, in the implementation process, when the module is called has not yet found a loaded into memory immediately to find the module by the 0S and it is loaded into memory, it is linked to the caller module.
  Pros: Those who are not used during execution of the target module will not be loaded into memory and is linked to the load module, so not only can speed up the process of loading the program, but also save a lot of memory space.
6. In the dynamic partition allocation method, how each partition is linked to the idle partition idle chain?
A: At the start address of each partition portion is provided for controlling the number information assigned to partitions, and each partition for linking forward pointer; the latter is provided in the partition to the tail pointer, through the front, back pointers to all partitions into a bidirectional link chain P128 4-7 of FIG. The main use of a doubly linked list.

7. Why introduce dynamic relocations? How to achieve?
A:. A procedure often moved position during operation in the memory, in order to ensure that these programs can be moved normally performed, and the address of the program must be modified data, i.e. relocation. Introducing relocation purpose is to meet the needs of this program.
  b. To achieve without affecting the execution speed of the instruction address translation, must be supported by the hardware address translation mechanism, i.e., the addition of a relocation required register in the system and use it to store the program starting address in memory. Program is executed, the real memory address is a relative address to access the relocation register is added to the address formed.
8. What is the dynamic partition allocation algorithm based on sequential search? It can be divided into several?
A: In order to achieve dynamic partitioning of dispensing, the amount of free partitions organized into an idle or idle partition table partition chain. The so-called sequential search, the order refers to the organization of tables or chain,

  Retrieving a table or recorded on a chain free partition, to find a best match algorithm to meet the requirements of the size of the partition. Allocation policy storage management often used are: first fit algorithm, first fit algorithm cycle, the best adaptation algorithm, the worst adaptation algorithm.
9. When used first to adapt the algorithm to reclaim memory, which has several possible scenarios? How to deal with these situations?
A:. A recovery zone and before the insertion point of an adjacent partition, this time can be combined partition recovery zone preceding the insertion point, no new table entry for partition allocation recovery, but only modify the size of the partition adjacent to the front ;

  . b After recovering a partition partitioning adjacent to the insertion point, where the combined two regions, followed by recovery zone as the first site to the first site a new free area, the size of the sum of both:
  . C and simultaneously inserted recovery zone two adjacent points before and after the partition, then the combined three partitions, the first site using the partition adjacent to the front, and the size of the three areas, the entry canceled adjacent partitions;

  D. no adjoining free partition recovery zone, the recovery zone should be provided for establishing a single new entry, the first site and fill size recovery zone, and according to its first site, inserted into the appropriate location in the free chain.
10. What is based dynamic partitioning the search index assignment algorithm? It can be divided into several?
A:. P131 fast adaptation algorithm, buddy system, hashing

11. Order buddyK (x) indicates the size of the k th power of 2, the address for the address block of the buddy system of x, the test write buddyK (x) general expressions?
Answer: P126. Postgraduate students can look at. Buddy System is a classic memory management algorithms are used in Unix and Linux operating systems, its role is to reduce the storage space in empty, reduce fragmentation and increase utilization. There are some algorithms described in "data structure" textbooks.
  This question which I do not understand the meaning of problems, presumably looking for the allocation of the free block of memory is x:
  POW (2,. 1-K) <= buddyK (x) <= POW (2, K) is // POW Buddy System power function is a continuous memory management, paging may incorporate discrete allocation method is conducive to allocate contiguous physical blocks to process, and to improve the efficiency of the program locality paging method.

What distribution strategies compare their advantages and disadvantages 12. The storage management often used?.
A: The allocation policy storage management often used are: first fit algorithm, first fit algorithm cycle, the best adaptation algorithm, the worst adaptation algorithm.
  . a first fit algorithm advantages and disadvantages: Keep a large part of the site free area high allocation in favor of large-scale operations after the arrival of; low address part continue to be divided, leaving many difficult to use, small free zone, and each subdivisional site are from the low part began when allocating find will increase overhead when looking.
  . b cycle for the first time to adapt to the advantages and disadvantages algorithm: free partition the memory is distributed more uniformly, reducing system overhead when looking; the lack of large empty partition, resulting in large-scale operations can not be loaded.
  . c advantages and disadvantages of best-fit algorithm: Each file is assigned to the most appropriate file size of the partition; memory left little difficult to use many of the free zone.
  . d worst adaptation algorithm disadvantages: the partition assigned to the file after the remaining free area will not be too small, the probability of the minimum fragmentation, file allocation partitioning of small and medium advantageously; lack of large memory so that a free area, unfavorable allocation of the partition large files.
13. Why introduce swap? Swapping can be divided into several types?
A: In a multi-channel environment, on the one hand, some processes in memory due to the occurrence of an event has not been blocked, but it takes up a lot of memory space, and sometimes may appear all processes are blocked in memory and forcing the CPU stopped waiting for the situation;

  On the other hand, but there are many jobs waiting on the external memory, the memory can not enter because there was no case of memory to run. Obviously, this system is a serious waste of resources, and the system throughput. To solve this problem, the introduction of exchange (also known as switching) technology in the operating system.
  The entire process can be swapped, swapped out, it can also be part of the process (page segment) surrendered in out. The former is mainly used to relieve the current shortage of memory in the system, which is mainly used for virtual storage.
14. The target file management area of and on what the target for space management different?
A: The main objective of the document management area is to improve the utilization of storage space for files, and then only to improve the speed of access to the file, so the file management area to take a discrete space allocation.
  The main objective of the change is to improve space management processes swapped in and out of speed, and then is to improve the utilization of storage space for files, therefore, for the management of the exchange zone to take continuous space allocation, fewer consider external memory fragmentation problems.
15. In order to achieve the change, what aspects of the system should function with?
A: The system should have three features: swap space management, process swapped out process are swapped.
16. In order to progress as a unit of exchange, each time whether to swap out the entire process? why?
A: In exchange for time, does not change every time the whole process with the process as a unit. This is because:
  . A Structurally, the process control block is made up of sections, and processes the data segment thereof, wherein the process control block some or all of the total permanent memory, will not be swapped out.
  b. Procedure and data segments being shared by several processes may, at which time they can not be swapped out.
17. The basic unit based on different discrete distribution used, can be divided into several discrete distribution?
A: paging storage management, storage management and sub-segment paged memory management.

18. What is a page? What is a physical block? How should determine the size of the page?
A: Page: paging storage management logical address space of a process into several pages, and each page is numbered. Physical block: the physical memory address space is divided into a plurality of blocks, and each block is numbered. Moderate page size should be selected, and the page size be a power of two, usually 1KB ~ 8KB.
19. What is the page table? What is the role of the page table?
A: The page table is paged memory management data structure used. A process is divided into how many pages, there are that many of its page table rows. Each row of the recording process and a physical page number stored in its block, the block number corresponding relationship. Page table used for address translation.
? 20. In order to implement paging storage management, which requires hardware support
A: The need to have a page table mechanism, hardware support for address translation mechanism.
21. In the paging system is how to achieve address translation?
A: using an address conversion mechanism to achieve the transition from a logical address to the physical address exchange, to achieve transformation from the page number to a physical block number by the page table, the page number in the translated logical address into a physical block number memory.
22. How fast has the address conversion table is realized?
23. A more detailed explanation is introduced into the segment storage management to meet the needs of users which aspects.
A: 1) easy programming. Users usually work according to their own logic is divided into several segments, each from 0 addressing, and has its own name and length. Thus, the logical address desired to be accessed is determined by the segment name and the offset within the segment.
  2) information sharing. In implementing the program and sharing data, based on information logic unit basis.
  Page tab system is the physical unit of information storage, no complete sense, not easy to share; segment is a logical unit of information. In order to achieve the shared segment, the segment can be desirable storage management user program organized manner with appropriate 3) information protection. Logical unit of information protection, segmented easily achieve more effective protection information.
  4) dynamic growth. In practice, some segment data segment in particular, in the course will continue to grow, we can not know in advance how much growth. Segmented memory management can better solve this problem

  5) Dynamic Link. When first run the main program corresponding to the target program into memory and starts running, during operation and need to call a certain period, only the segment into memory link. It also requires a dynamic link to the segment as a management unit.
24. In paragraph of page with fast memory management table, the address conversion how?
A: When effective address given by the CPU, the address conversion mechanism by the automatic page number P into the cache register and the page number compared with all the page number in the cache, if found to match the page number, represents the page table entry to be accessed quickly in the table.

It can be read directly from the page table corresponding to the fast physical block number to a physical address register. As soon table does not correspond to the page table entry, the page table and then access the memory, after finding, the read physical block address register number sent from the page table entry;

Meanwhile modify fast table, this page table entry to the table fast. However, if the register is full, you must find the right 0S page table entries swapped out.

25. Why is segmented paging system than the system easier to share information and protection?
Answer: a system for paging, each page is dispersed storage, in order to share information and protection, we need to up-one correspondence between the pages, which requires the establishment of a large number of page table entries;.

  b. For systems segments, each segment addressing starts from 0, and using a contiguous address space, and so that when the shared protection, just a segment table entry is set to be shared and the protected program, the in which the base address and memory address up to one correspondence.
26. paging and segmentation What's the difference?
A:. A way paging and segmentation are used discrete distribution, and must be achieved through address translation address mapping agency, it is they have in common;

  b. There are differences with respect to their three, first, from the functional point of view, the physical page is the unit of information, paging is for discrete distribution, reduction in outer fraction memory, improve memory utilization, i.e., meet system management needs, not the needs of users;

  The segment is a logical unit of information, which contains a set of relatively complete information on the significance of, the purpose is to be able to better meet the needs of users;

  The second page size is fixed and is determined by the system, and the length of the segment is not fixed, the user determines a program written; collated third address space is one-dimensional, while the segmented address space is two-dimensional work .
27. A comprehensive test comparing successive discrete distribution and distribution.
A:. A contiguous allocation is the allocation of a contiguous address space to a user program, comprising a single continuous zonal distribution and distribution, the former region and the system memory is divided into a user area, a system area for the operating system, the user available to the user, is the simplest kind of storage, but only for a single-user operating system, a single task;

Dispensing partition is divided into fixed and dynamic partitioning partition, the partition is fixed to the simplest multi-channel program storage management, since the size of each partition is fixed, inevitably result in waste of storage space;

Dynamic partitioning is based on the actual needs of the process, whom dynamically allocate contiguous memory space allocation algorithm commonly used three kinds: first fit algorithm, this method is easy to leave a lot of difficult to use a small free partition, increase lookup overhead; circulation for the first time to adapt algorithm, which enables the memory free partition distribution, but will cause a lack of large empty partition;

Best fit algorithm, which is also easy to leave a lot of difficult to use a small free zone;. B discrete distribution will be based on a decentralized process directly distributed to many of the ideas of partition are not adjacent, divided into tabbed storage management, segmented storage management and storage management segment page. page memory management designed to improve memory utilization, to meet the needs of system administration,

Segmented memory management is designed to meet the user (programmer) is needed, than in the page memory management and protection of shared, both of the page segment storage management sucked combine each other, i.e., a segmented the system is easy to realize, can be shared, easy protection, dynamic links, etc., but also like a good solution as paging system

External fragmentation problems, and for each discrete segments may allocate memory problems, is clearly a more efficient storage management;. C seen, continuous and discrete distribution have their own distribution characteristics summary, it should be based on the actual situation be improved and utilized.

 

 

Guess you like

Origin www.cnblogs.com/dpSolitude/p/11863640.html