Tangzi Computer Operating System (West Power) Answer - Chapter 5 (http:bbs.edw.com.cndispbbs.asp?boardid=3&id=22479)

xiaoxiao2021-03-06  49

- Author: ltply-- Published: 2004-1-908: 16: 00-- Tang Ziying computer operating system (XD) answer - Chapter 1. What are the different ways the program can be loaded into memory? They apply to what kind of occasion is applied. A. First, compile the user source code into a number of target modules, and then link the link to the target module and the desired --library function to form one Load the module, then load the load module into the memory; b. Make the module: absolute loading method, relocation mode, and dynamic running mode; c. Absolute loading mode is applicable In a single-channel program environment; d. Can be used in a multi-program environment; e. Dynamic runtime load mode also applies to multi-program environments. 2. What is static link and load-bearing dynamic links and runtime Dynamic link? A. Static link refers to the link to form a complete load module in the first link, and will not be disassembled later ---; b. Dynamic link when loading is merged to load memory The link method of the next link link; c. Dynamic links at runtime are delayed when the links of some target modules are delayed to execution .3. What work should be done when the program link? A. Change; b. Transform external call symbols .4. In dynamic partition allocation, which partition allocation algorithm can be used? A. First adaptation algorithm; b. Cycle first adaptation algorithm; c. Best adaptive algorithm .5. In dynamics In partition allocation, how should you link each space partition to an idle partition chain? You should set some information for control partition allocation, and the forward pointer for linking each partition; The partition tail is set to a rear pointer, pass the pointer to a two-way chain. 6. Why should you introduce a dynamic reset? How to implement? A. In order to execute, each access instruction When or data, the logical address of the program or data to be accessed is converted into a physical - address, introduced a dynamic reprogram .b. A relocation register can be added to the system, and it is loaded (store) the program The start address in the memory, the program is executed, the memory address of the true - is added to the relative address is added to the address in the relocation register, thereby achieving the dynamic weight positioning. 7. Trial class Pascal language Describe the process of the first adaptation algorithm for memory allocation. (Omitted) 8. Which case may occur when using the first adaptation algorithm to recover memory? How should these situations? A. Recycling area and the previous partition of the insertion point adjacent Connection, the recovery area can be merged with the previous partition of the insertion point, no longer a recycled partition --- allocated a new entry, and only modify the size of the front adjacent partition; b. Recycling partition and insertion points Adjacent, at this time, the two districts are combined, and then the first site of the recovery area is used as the first site of the new idle area, large - small is both The sum; C. The recovery zone is adjacent to the front and rear part of the insertion point. At this time, three partitions are merged, the first address of the front neighboring partition is used, the size is the sum of the three districts, and the table of the neighboring partition is canceled. Item; D. The recovery area is not adjacent to the empty partition, and a new entry should be created separately for the recovery zone, fill in the first site and size of the recovery zone, and insert it into the appropriate position in the idle chain according to the first place. 9. What benefits have been introduced after the system? Can you temporarily not run the process or temporarily unused programs and data, change to the deposit, to make enough memory space, put the operating conditions The procedures or processes needed by the process or the process in exchange for memory, which greatly improves the utilization rate of memory. 10 In order to implement the interchange, what kind of function should be implemented? A. Management of the interchange space; b. Process Replacement; c. In exchange in the process. 11 When performing the process as a process, do you exchange the entire process each time? Why? A. When the process is changed, it is interchanged.

Each time, the entire process will be replaced; b. Purpose To solve the problem of memory tension, improve the utilization rate of memory. 12 to implement paging storage management, which hardware support does it require Intel 8086, MC68000, Intel 80286 as a chip Whether the microcomputer is suitable for page management? (To be discussed) 13 Please explain more detail, introduce paging storage management (estimated imprinting, is the segment storage management) Is it necessary to meet the needs of users? A. Convenient Programming; b. A segment sharing; c. Dynamic links are implemented; d. Implement dynamic links; E. Implement Dynamic Growth. 14 In segment-type storage management mode with fast tables, how to implement address transformation First, a table register must be configured to store the segment table address and the segment length TL. When performing address transformation, first use the segment number S, compare the segment length TL, if S = TL, indicating that the segment number is too large, access the offline, generates a cross-boundary interrupt signal), and the segment table item in the segment table is obtained from the segment table item, and the segment is obtained from the segment table. The page table address, and use the page number P in the logical address to obtain the page table item of the corresponding page, read the physical block number B where the page is read, and then use the block number B and the page. Address .15 Why is the segmentation system compared with the paging system more easy to implement information sharing and protection? A. For paging systems, each page is dispersed, in order to achieve information sharing and protection, you need one or one more To this end, you need a large number of page table items; b. For segmentation systems, each segment starts to address, and uses a continuous address space so that you only need to share and protect --- Set a segment entry for the program you want to share and protected, the base address and the memory address can be found. 16 pages and segments What are the differences? A. Distribution distribution The way, and must achieve address transformation through the address mapping mechanism, which is the common point; b. For them, there are three, first, from functional view, page is the physical unit of information, page patch is implemented Discrete distribution method, to reduce the outer zero head of memory, improve the utilization of memory, that is, to meet the needs of system management, not the needs of the user; and the paragraph is the logical unit of information, - it contains a set of meaning Relatively complete information, the purpose is to better meet the needs of the user; c. The size of the page is fixed and is determined by the system, and the length of the segment is not fixed, determined by the program written by the user; d. Paging job address The space is one-dimensional, and the segmented job address space is two-dimensional. 17 trial comparison continuous distribution and discrete distribution method. A. Continuous distribution refers to a user program allocated a continuous address space, including single continuous assignment Ways and partition allocation methods, the former --- divides memory into system area and user areas, system districts for use, user districts for users, It is the simplest storage method, but can only be used in the operating system of single-user order tasks; partition allocation is divided into fixed partitions and dynamic partitions, fixed partitions are the easiest-multi-channel program Since the storage management method, since the size of each partition is fixed, it will inevitably cause waste of storage space; dynamic partition is based on the process --- actual needs, dynamically allocate continuous memory space, and three allocation algorithms: first time Adaptation algorithm FF, this method is easy to leave many - unused small space partitions, increase finding overhead; cycle first adaptation algorithm, the algorithm can make the idle partition in memory, but --- will cause lack of large Free partition;

Best adaptation algorithm, the algorithm is also easy to leave many unused small hollow districts; b. Discrete distribution is based on the idea of ​​dispersing a process into many non-adjacent partitions, divided into paging storage management, Segmentation --- Storage Management and Segment Page Storage Management. Paging Storage Management aims to improve memory utilization, meet the needs of system management, segmented storage tubes - the reason to meet users (programmers) Need, in achieving sharing and protection is better than paging storage management, while paragraph storage management is --- combining both, take a long-term supply, that is, the segmentation system is easy to implement, can share, easy to protect, dynamic The advantages such as links, can also solve the problem of external fragmentation like --- paging system, as well as issues such as discrete distribution of memory, is clearly a more effective --- store management method; c. In summary, continuous distribution methods and discrete distribution methods have their own characteristics, and should be improved and utilized according to the actual situation. ※ Source: postgraduate forum bbs.kaoyan.

- Author: ltply-- Published: 2004-1-908: 18: 00-- Tang Ziying computer operating system (XD) answer - Chapter VI 1. In demand paging system, the page table entry contains Those data items? What is their role? A. In the request paging system, the data items contained in the page entry include page number, physical block number, status bit P, access field A, modify the bit M and --- Onding address; b. Where is the status bit P indicates whether the page is transferred to memory, the reference is available for program access; c. Access field A is used to record this page to be accessed within a period of time, or how long is it recently? Not accessed, provide a replacement algorithm --- Select the reference to the replacement page reference; d. Modify bit m indicates that the page is modified after the memory is modified; e. Outfolio address is used to point out the page Address, usually the physical block number is used to transfer this page. 2. What is the virtual memory of a computer system, what is the maximum capacity and the actual capacity? A. Maximum capacity by memory and exemption; B The actual capacity is determined by memory .3. Virtual memory has those characteristics? What is the most essential characteristics? A. Virtual memory has the characteristics of dispersion, multi-order, interchangeability and virtuality; B. The essential characteristics are dispersion, and the most important features of the exhibited are in this basis, and the most important features of the exhibited are - virtual storage .4. Realize those hardware support for virtual storage? A. In order to realize the system of the request page storage management, in addition to the computer that requires a capacity of memory and exemption, it is also - need to have a page table mechanism, a wage interrupt mechanism, and an address transform mechanism; B. For implementation The system requesting the segmentation storage management method, in addition to the computer with a certain capacity of memory and external memory, also --- requires a table meter mechanism, a shorter interrupt mechanism, and an address transform mechanism; 5. In implementing virtual storage What is the key technologies when it is? (To be discussed) 6. In the request paging system, the page table should include those data items? What is the role of each item? (With the first question) 7. In the request paging system, Where should the desired page be transferred to memory? A. First, first retrieve the quick table, try to find the page to be accessed, if you find it, modify the access in the page entry ---, For write instructions, you must also modify the location 1, then utilize the physical block number and the internal address given in the page table, form a physical address; b. If you do not find the page table item of the page in the quick table, Go to the memory to find the page table, then from the status bit in the list item item - understand if the page has been transferred to the memory, if the page has been transferred to memory, you should write this page. Entering the quick table, when the quick table is full, you should first --- call the page table item determined by the page determined by a certain algorithm, and then write to the page table item of the page; c. If the page is not transferred Memory, at this time, the shortage interrupt should be generated, requesting the OS to transfer the page from the outside; D The deposit is divided into file area and the interconnected area. If the system has sufficient interconnect space, the file related to the process can be copied to the interconnected area before the process is running, and when necessary Turn; e. If the system lacks enough interconnected area space, any file that will not be modified can be transferred directly from the file area. You can do not need to switch out, but for possible The modified portion, when you turn out, you must be transferred to the interconnected area, and then you will be again from the interconnection area --- Turn .8. Which page placement algorithm is often used in the request paging system? a. Best translation algorithm; b. Advanced first out algorithm; C. Recently, the LRU replacement algorithm is not used for the last time; d. clock replacement algorithm; E. In addition,

There is also a minimum use of plans and page buffer algorithms. 9. A virtual memory user space has 32 pages, 1KB per page, 16KB. Assume a moment --- page 0, 1, 2, 3 pages for users The physical block number assigned separately is 5, 10, 4, 7, and the virtual address --- 0A5c and 093c are changed to the physical address. A. Transform 0A5C to 2 into 2 supplies: 0000, 1010, 0101, 1100, due to The page size is 10 times of approximately 2, so the page number of 0A5c --- is 2, the corresponding physical block number is: 4, so the physical address of the virtual address 0A5c is 125c; b. Transform 093C to 2 System is: 0000, 1001, 0011, 1100, page number is also 2, the corresponding physical block number is also 4, at this time, the physical address of the virtual address --- 093c is 113C.10 in the request paging system, usually What is the page allocation method? Why? A. In the request paging system, there are two allocation methods for fixed and variable allocation; b. Using a fixed allocation method based on the process-based type (interactive) or according to programmer, system administrator It is recommended to assign each process --- a fixed page number of memory space, no longer change during the entire run; c. There are two types of global replacement and local replacement, the former is easy to implement, the latter is easy to implement, the latter is high efficiency .11 In a request paging system, when using the LRU page to replace the algorithm, if a job is going to - is 4, 3, 2, 1, 4, 3, 5, 4, 3, 2, 1, 5, When the physical block number m assigned to the job --- is 3 and 4, the number of pages and the shortage of pages occurred during the access process? Compare the resulting result? A. When assigned to the job When the number m is 3, the lack rate taken is 7, the loop rate is: 7/12 = 0.583; b. When the number of physical blocks mounted to the job is 4, the shortage rate of 4 is 4. The lack rate is: 4/12 = 0.333.12 In the replacement algorithm, which is more commonly used? Why? A. LRU is exactly the same as the page of the Page of the LFU replacement algorithm, that is, the hardware is the same; b. But the LFU does not really access the usage of the page. 13 Implement the hardware support required to implement the LRU algorithm? a. Register, to record the usage of a process in memory; b. Stack, use The page number of the currently used page is saved. 14 Test the basic principle of the improved Clock replacement algorithm .a. Because the overhead payded by the modified page is replaced by the unvitrened page overhead So in the improved CLOCK - algorithm, it is necessary to consider the usual use of the page, it is necessary to add a factor for replacement costs; b. When selecting the page as the elimination page, it is not used at the same time. And unmodified as the preferred phase-out page .15 What is jitter? What is the cause of the shake? A. Thating is that when the no shake space in memory is interrupted, it is necessary to call up a page from memory or - Data to send disks. In the case where the algorithm is inappropriate, the page that is changed quickly is accessed. You need to re-transfer, so you need to choose one page --- call out, and this page is changed soon, it is going to be accessed. Therefore, it is also necessary to transfer it, so frequently replaced the page, which takes a lot of - time, we call this phenomenon "jitter"; b. The reason for generating jitter is due to the utilization of the CPU and multi-channel programs In order to improve the CPU utilization, in order to improve the CPU utilization, it can improve the multi-channel priority.

However, simply improved multi-channel programs will result in a sharp rise in the short position, resulting in a decline in the utilization rate of the CPU, and the system's scheduler will continue to improve the multi-channel priority to improve the CPU utilization, form a vicious circle We call the process of this time --- is a "jitter" state. 16 Test Description Request Segmentation System Maximum Page Interrupt Processing Process? (See P185 Figure 6-12) 17 How to achieve segmentation sharing? A. In the segment table of each process, use the corresponding entry to point to the start address in the memory; b. Configure the appropriate data structure as a shared segment table, you can set the shared process count in the segment table item, each Call once this sharing section, --- count Independ 1, whenever a process releases a shared section, count executes a minimal 1 operation, if it is reduced to 0, the physical memory of the shared - segment, and Cancel the entry corresponding to this segment in the shared segment table; c. For a shared section, you should give different processes at different access rights; d. Different processes can be used to share this segment. 18 What kind of storage management can INTEL 80386 chip support? A. Insect storage management mode; b. Sub-page missed storage management method; c. Segmentation missed storage management method; d. Sub-paging storage management mode. 19 Test Description 80386's segmentation address conversion mechanism work principle .a. Segment register and virtual address structure; b. In segmentation components, address transform is transformed into linear addresses, Then send paging components. (Specifically, see P191) 20 Tests the principle of the two-stage paging address transform mechanism of 80386. (see p193) 21 How can ways to increase the memory utilization? (To be discussed, the question can be seen as A comprehensive summary and summary of the essential content of this chapter) ※ Source: Postgraduate Forum BBS.KAOYAN.COM

- Author: ltply-- Published: 2004-1-908: 20: 00-- Tang Ziying computer operating system (XD) answer - Chapter XIII 1. UNIX systems What are the basic features? A. Openness; B. Multi-user, multi-task environment; c. Powerful, high efficiency; D. DAC provides a rich network function. 2. Which part of the core of UNIX system? What functions are included? a. UNIX system core is divided into process control subsystem parts and file subsystem parts; b. Process control subsystem contains process control, process communication, memory management and process scheduling function; --- File subsystem contains file management, The function of the high-speed buffer mechanism and device driver .3. What are the PCBs in the UNIX system? The relationship between them is used in the figure. A. PCB in the UNIX system contains four parts: process entry, U. District, process area table and system area entry; b. Figure P396.4. Process image Several part? What is the role of the dynamic part of the system-level context? a. Process image contains three parts: user-level context, register context, and system-level context; b. System-level context dynamic part contains core stacks and several layers of register contexts, which uses interrupts or systems When calling ---, the core is pressed into the core stack in the core, and when the system is quit, the core will pop up up and down --- text, when performing context switching, the core will be pressed into the old process The upper and lower layers are popped up. 5. What are the system calls for process control in a UNIX system (primary)? What is their main function? a. for creating a new process; b. EXEC, changing the original code of the process; c. EXIT, implementation of the self-ending of the process; D. Wait, will hang the calling process, waiting for the sub-process to terminate; e. get pid Get process markers; f. Nice, change the priority of the process. 6. What work needs to do to create a new process? a. Assign a process entry and process marker for the new process; b. Check the number of processes running simultaneously; c. Data in the copy process group; d. child process inherits all the files of the Parent process; E. for a child process Create a process context; f. Child process execution .7. Why do you take a process self-ending method? How to implement EXIT? a. In order to reclaim the resources occupied by the process, and reduce the intervention of the parent process, UNIX systems use exit to implement the self-term termination of the process; B. Implementing EXIT, the core should do is: --- Close soft interrupt; - Recycling resources; How is the priority calculated? a. UNIX system is a multi-level feedback queue roller transfer adjustment algorithm; b. Each 1 second, the core recalculates user priority by following the following formula: --- Priority = (Time to use CPU / 2) Basic users The number of priorities. 9. Test the difference between the signal and the interrupt mechanism? a. Similarity: --- Signal and interrupts use the same asynchronous communication method; --- When the signal or interrupt request is detected, it is paused to perform the corresponding processing program; - Both are returned to the original breakpoint after processing; --- Made of signal or interrupts;

b. Differences: --- Interrupts have priority, and signals are not priority, that is, all signals are equal; --- Signal handler is running in user state, while interrupt processing programs are at core states Under the operation; --- Interrupt response is timely, while signal responses usually have a large time delay. 10 扼 要 1 说明 说明 说明 说明 说明 说明 说明 说明 说明 说明 说明 说明 说明 说明 说明 说明 说明 说明..... 说明.. 说明. 说明. 说明. 说明. 说明? 说明? 说明. 说明? a. Signal transmission refers to a bit of a signal that is sent to the signal domain of the specified process by the transmission process; b. For processing function of the signal: First, --- Using the system call Signal (SIG, FUNC) preset When the signal is handled, func = 1, when the class signal is shielded; --- func = 0, the process is terminated after receiving the signal; --- func is not 0, non-1 integer, FUNC value That is, a pointer to the signal handler. Then, if the soft interrupt received by the process is a signal that has decided to ignore (func = 1), the process does not make any processing back; --- After receiving the soft interrupt Exit (FUNC = 0); --- Execute a soft interrupt handler for settings. 11 What is pipe? What is the main difference between unknown pipeline and a famous pipe? a. Pipe refers to a way to connect a write process and a read process, and allow them to communicate with the producer-consumer mode, also known as the PIPE file; b. No nameless pipeline is a temporary file It is the use of the system to call the PIPE () unnamed file, there is no path name, only - call the PIPE process and its descriptive process to identify this file descriptor and use the file (pipeline) to communicate; --- The pipeline is built using the MKNOD system call. It is the file that can exist in the file system, existing pathnames, --- Other processes can know their existence, and use the path name to access the file. 12 read, write What rules should I follow when pipeline? a. Limit of the size of the PIPE file; b. Process mutual exclusion; c. When proxirement is written, check if there is enough space to write to write data. If there is, write, if there is no, the core is indexed by the core --- Node make a sign, then let the write process sleep, until the process reads the data, then wait for the process to wake up; d. When the process read the pipe, check if there is enough data to read, if there is The process reads the data from the initial value of the read pointer, and after reading - one, add the size of the address item. After reading the end, modify the read pointer in the index point in the core, and awake all waiting written Process, --- If there is no, after reading, the process temporarily enters sleep waiting until the write process writes the data into the pipeline, then the read process wakes up. 13 In the message mechanism, what system calls? And explain their use. In UNIX, the message mechanism provides four system calls to the user: a. Msgget (), used to establish a message queue, or get a descriptor of a message queue; b. Msgsnd (), used Send a message to the specified message queue and link the message to the tail of the message queue; c. Msgrcv () for receiving a message of the specified type from the specified message queue; d. Msgctl (), used Read the status information of the message queue and modify it. 14 What system calls are there in the shared storage area mechanism? It is also necessary to explain their use. A. Shmget (), establish a share of the storage area; b. Shmat (), attach the shared storage area to the virtual site space of the process;

c. shmdt (), disconnect the shared storage area and the new process; d. shmct (), read and modify the status information of the shared storage area, or disconnect the process and the shared storage area. 15 core What do you need to do when performing a SHMGET system call? a. First check the shared storage area table. If you find the specified key's entry, the shared area has been established, and the descriptor of this entry is returned --- shmid; b. If you do not find the specified KEY entry, The FLAG flag is also IPC_CREAT, and the parameter size value is assigned a system - idle area as a page table area of ​​the shared area, allocating the memory block, and then fill the page table; c. The core is assigned an empty entry for the newly established shared area in the shared storage area and system area table, and fills in the shared storage area - keyword and its size, the beginning of the shared area page table Address, pointing to the pointer of the system area entry, etc., and finally returns the descriptor of the shared storage --- shmid.16 in the signal quantity set mechanism, which system calls? And explain their use. A. Semget (), establish a selection set; b. Semop (), performs the semaphore. 17 How does the core manipulate the amount of semaphore? a. Core according to SEM_OP to change the value of the signal, can be divided into three cases; b. SEM_OP value is positive, then the value is added to the value of the signal, which is equivalent to the usual V operation; c. SEM_OP The value is negative, equivalent to the P operation, if the value of the signal is larger than the absolute value of the operation value, the core adds a negative integer to the signal - value value, otherwise, the core will have been operated, recovery When the system call is started; D. If (SEM_FLG & IPC_NOWAIT) is true, it will return immediately. Otherwise, let the process sleep wait .18 Configure what data structure is configured in the UNIX system in the UNIX system? a. Page table; b. disk block description table; c. Page box data table; d. Conversion Table. 19 In UNIX systems, how to change the age of the valid page? And use the example. A. A maximum age of a page, depending on its hardware facilities; b. The age of its valid page can only be valued for only two-digit domain, and the age is only 0, 1, 2, 3. When the age of this page is 0, 1, 2, the page is in a non-convertible state, and when the age is 3, it can be replaced, whenever the number of idle pages in the memory is low. When the low limit of the specified low limit, the core wakes up the page process, and the page process takes the process to check each of the events in memory, the non-locked area, the age field of all effective zones, plus 1, For those pages that have increased to 3, they don't add them, but they have changed them. If this page has been --- is accessed, the age of age is reduced to 0.20 is required to access the lack of access. The page is how to transfer it to memory on an executable or on the controller? The core is first assigned a memory page for the shortage, modify the page table, make it point to the memory page, and put the page data table item into the corresponding hash queue, then transfer the page from the replacement device to the memory, When the I / O operation is completed, the core is waken into the process of the request to transfer the request. 21 When you change the page, can you divide? How should these circumstances? a. If there is a copy of the page that has been changed on the conversion device,

转载请注明原文地址:https://www.9cbs.com/read-80790.html

New Post(0)