#Chapter 2# Q 2.1: What is the purpose of system calls? Purpose of system calls are given as follows: Basic Purpose: Calls provide basic functionality to users to operate the operating system. Process Control: Systems call loads, execute and create processes and terminate when the user's task is finished with the process. File
Management: It provides file management such as creating a file, deleting it, open, close, and save it. It also provides read, write and reposition functionalities Device Management: All hard disk are managed by system calls such as requesting for a device, releasing the device, reading and writing the device Information Maintenance: System calls help in making information maintenance such as get/set time or date, get/set data of system, processes, files or attributes of device. Communication between processes: Systems calls are use for Communication purpose as they help in creating and deleting communications, sending or receiving messages. They help in attaching or detaching remote devices and in transfer or status information. Q 2.2: What are the five major activities of an operating system with regard to process management? Answer: Five activities of operating system with regard to the process management are given as follows:
Q 2.3: What are the three major activities of an operating system with regard to memory management?
Q 2.4: What are the three major activities of an operating system with regard to secondary-storage management?
Q 2.5: What is the purpose of the command interpreter? Why is it usually separate from the kernel?
Q 2.6: What system calls have to be executed by a command interpreter or shell in order to start a new process?
**Q 2.7: ** What is the purpose of system programs?
**Q 2.8: ** What is the main advantage of the layered approach to system design? What are the disadvantages of the layered approach?
**Q 2.9: ** List five services provided by an operating system, and explain how each creates convenience for users. In which cases would it be impossible for user-level programs to provide these services? Explain your answer.
Q 2.15: What are the five major activities of an operating system with regard to file management? * **Answer:** * `Creation and deletion of files.` * `Creation and deletion of directories.` * `Supporting primitives for manipulating files and directories.` * `Mapping the files onto secondary storage.` * `Backing up files on nonvolatile storage media.` Q 2.18: What are the two models of interprocess communication? What are the strengths and weaknesses of the two approaches? * **Answer:** * Message - passing model: `In this, the communicating processes exchange messages with one another to transfer information. Messages can be exchanged between the processes either directly or indirectly through a common mail box. Message passing is useful for exchanging smaller amounts of data, because no conflicts need to be avoided. It is also easier to implement than is shared memory for inter computer communication. But the main advantage is it can handle only small amounts of data.` * Shared - Memory mode: `In this, processes use shared memory creates and shared memory attaches system calls to create and gain access to regions of memory owned by other processes. Two or more processes can exchange information by reading and writing data in the shared areas. Shared memory allows maximum speed and convenience of communication, since it can be done at memory speeds when it takes place within a computer. Problem exist, however, in the areas of protection and synchronization between the processes sharing memory.` Q 2.19: Why is the separation of mechanism and policy desirable? * **Answer:** * `Mechanism determines how to do something and policy means what to do. The separation of policy and mechanism is very important for flexibility. In worst-case, each change in policy would require a change in the underlying mechanism. A general mechanism insensitive to change in policy would be more desirable.` * `Policy may change with respect to time. If the mechanism is separated and policy is independent, it can be used to support a policy decision that I/O intensive programs should have priority over CPU-intensive ones or to support the opposite policy.` Q 2.21: What is the main advantage of the microkernel approach to system design? How do user programs and system services interact in a microkernel architecture? What are the disadvantages of using the microkernel approach? * **Answer:** * **Part 1:** `The backing - store driver would normally be above the CPU scheduler, because the driver may need to wait for I/O and CPU can be rescheduled during this time. However on large system, the CPU scheduler may have more information about all the active processes that can fit in memory. Therefore, this information may need to be swapped in and out of memory, requiring the backing-store driver routine to be be below the CPU schedule.` * **Part 2:** `When a user program executes and I/O operation, it executes an I/O operation, it executes a system call that is trapped to the I/O layer, which calls the memory management layer, which in turn calls the CPU -scheduling layer, which is then passed to hardware. At each layer parameter may be modified, data may need to be passed and so on. Each layer adds overhead to system call, the net result is a system call that takes longer than does one on a non layered system.` `The layers are designed, providing most of the advantages of modularized code while avoiding difficult problems of layer definition and interaction.` **Q 2.22:** What are the advantages of using loadable kernel modules? * **Answer:** `An OS has been developed called Mach that modularized the kernel using the microkernel approach. This method structures the OS by removing all non-essential components from the kernel and implemnting them as system and user-level program. Micro kernel provides minimal process and memory management with communication facility. The communication is done indirectly via the method called Message passing.` `All new services are added to user space and consequently do not require modification of the kernel. Micro kernel provides more security and reliability, since most services are running as user rather than kernel.` What are the major activities of an operating system with respect to protection and security?This extends to the operating system as well as the data in the system. This can be done by ensuring integrity, confidentiality and availability in the operating system. The system must be protect against unauthorized access, viruses, worms etc.
What are the three 3 major activities that the operating system is responsible for with respect to memory management?Answer: The three major activities of an operating system in connection with regard to memory management are:. Keep track of which parts of memory are currently being used and by whom.. Decide which processes are to be loaded into memory when memory space becomes available.. Allocate and de allocate memory space as needed.. What are the three major activities of an operating system?An operating system has three main functions: (1) manage the computer's resources, such as the central processing unit, memory, disk drives, and printers, (2) establish a user interface, and (3) execute and provide services for applications software.
What is protection in operating system?Protection refers to a mechanism which controls the access of programs, processes, or users to the resources defined by a computer system. We can take protection as a helper to multi programming operating system, so that many users might safely share a common logical name space such as directory or files.
|