【正文】
parameters in registersb. Registers pass starting addresses of blocks of parametersc. Parameters can be placed, or pushed, onto the stack by the program, and popped off the stack by the operating system. Describe how you could obtain a statistical profile of the amount of time spent by a program executing different sections of its the importance of obtaining such a statistical profile.Answer: One could issue periodic timer interrupts and monitor what instructions or what sections of code are currently executing when the interrupts are delivered. A statistical profile of which pieces of code were active should be consistent with the time spent by the program in different sections of its code. Once such a statistical profile has been obtained, the programmer could optimize those sections of code that are consuming more of the CPU resources. What are the five major activities of an operating system in regard to file management?Answer:? The creation and deletion of files? The creation and deletion of directories? The support of primitives for manipulating files and directories? The mapping of files onto secondary storage? The backup of files on stable (nonvolatile) storage media What are the advantages and disadvantages of using the same systemcall interface for manipulating both files and devices?Answer: Each device can be accessed as though it was a file in the file system. Since most of the kernel deals with devices through this file interface,it is relatively easy to add a new device driver by implementing the hardwarespecific code to support this abstract file interface. Therefore,this benefits the development of both user program code, which can bewritten to access devices and files in the samemanner, and device driver code, which can be written to support a welldefined API. The disadvantage with using the same interface is that it might be difficult to capture the functionality of certain devices within the context of the file access API, thereby either resulting in a loss of functionality or a loss of performance. Some of this could be overe by the use of ioctl operation that provides a general purpose interface for processes to invoke operations on devices. What is the purpose of the mand interpreter? Why is it usually separate from the kernel? Would it be possible for the user to develop a new mand interpreter using the systemcall interface provided by the operating system?Answer: It reads mands from the user or from a file of mands and executes them, usually by turning them into one or more system calls. It is usually not part of the kernel since the mand interpreter is subject to changes. An user should be able to develop a new mand interpreter using the systemcall interface provided by the operating system. The mand interpreter allows an user to create and manage processes and also determine ways by which they municate (such as through pipes and files). As all of this functionality could be accessed by an userlevel program using the system calls, it should be possible for the user to develop a new mandline interpreter. What are the two models of interprocess munication? What are the strengths and weaknesses of the two approaches?Answer: The two models of interprocess munication are messagepassing model and the sharedmemory model. Why is the separation of mechanism and policy desirable?Answer: Mechanism and policymust be separate to ensure that systems are easy to modify. No two system installations are the same, so each installation may want to tune the operating system to suit its mechanism and policy separate, the policy may be changed at will while the mechanism stays unchanged. This arrangement provides a more flexible system. Why does Java provide the ability to call from a Java program native methods that are written in, say, C or C++? Provide an example of a situation in which a native method is useful.Answer: Java programs are intended to be platform I/O independent. Therefore, the language does not provide access to most specific system resources such as reading fromI/O devices or ports. To perform a system I/O specific operation, you must write it in a language that supports such features (such as C or C++.) Keep in mind that a Java program that calls a native method written in another language will no longer be architectureneutral. It is sometimes difficult to achieve a layered approach if two ponents of the operating system are dependent on each other. Identify a scenario in which it is unclear how to layer two system ponents that require tight coupling of their functionalities.Answer: The virtual memory subsystem and the storage subsystem are typically tightlycoupled and requires careful design in a layered system due to the following interactions. Many systems allow files to be mapped into the virtual memory space of an executing process. On the other hand, the virtualmemory subsystem typically uses the storage system to provide the backing store for pages that do not currently reside in memory. Also, updates to the filesystem are sometimes buffered in physical memory before it is flushed to disk, thereby requiring careful coordination of the usage of memory between the virtual memory subsystem and the filesystem. What is the main advantage of the microkernel approach to system design? How do user programs and system services interact in amicrokernel architecture? What are the disadvantages of using the microkernel approach?Answer: Benefits typically include the following (a) adding a new service does not require modifying the kernel, (b) it is more secure as more operations are done in user mode than in kernel mode, and (c) a simpler kernel design and functionality typically results in a more reliable operating system. User programs and system services interact in a microkernel architecture by using interprocess munication mechanisms such asmessaging. These