#Chapter 2# Q 2.1: What is the purpose of system calls? Answer: A system call is a program that request a service from kernel of operating system. This may include services like accessing hard disk, executing and creating new processes and defines communication with kernel services like scheduling. These calls provide an interface between operating systems and a process. 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:
It helps in protecting the processes from deadlocks. It helps in providing mechanisms for communication between processes. It provides synchronization for multiple processes. It provides resumption and suspension of processes. It creates and deletes processes of both user processes and system processes. Q 2.3: What are the three major activities of an operating system with regard to memory management?
The three major activities of an operating system in connection with regard to memory management are:
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. Answer: Five services provided by the operated system are given as follows: 1. `Program execution` 2. `I/O operations` 3. `File-system manipulation` 4. `Communications` 5. `Error detection` Program Exection: * `It allows the user to execute programs by providing convenient environment for development and execution of programs.` * `A user level program cannot properly allocate CPU time.` I/O Operations: * `Every program may require some input/output such as a file or an I/O device.` * `The operating system provides an environment to handle I/O operations.` * `A user level program cannot control the I/O devices directly. For some I/O devices, special functions are necessary.` File-system manipulation: * `All task related to files such as creating a file, deleting a file, reading a file, writing to a file, etc. are handle by the operating system.` * `A user need not to know the details of secondary storage system. All a user can see is that his task is accomplished.` * `User made programs cannot be made to allocate free blocks when available and deallocate the blocks after deletion.` Communications: * `There are times when a process needs to communicate with other process. All this is taken care by operating system.` * `Communication takes place in the form of data packets and they need access to the network device but user level programs cannot provide that.` Q 2.15: What are the five major activities of an operating system with regard to file management? Answer:
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?
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?
Q 2.22: What are the advantages of using loadable kernel modules? Answer:
What is the purpose of command interpreter?A command interpreter is the part of a computer operating system that understands and executes commands that are entered interactively by a human being or from a program. In some operating systems, the command interpreter is called the shell.
Why is the kernel separate from the operating system?This separation prevents user data and kernel data from interfering with each other and causing instability and slowness, as well as preventing malfunctioning applications from affecting other applications or crashing the entire operating system.
What is the purpose of the kernel?It basically acts as an interface between user applications and hardware. The major aim of kernel is to manage communication between software i.e. user-level applications and hardware i.e., CPU and disk memory.
What are the purpose of system calls explain the user mode and kernel mode of an operating system?System call provides the services of the operating system to the user programs via Application Program Interface(API). It provides an interface between a process and operating system to allow user-level processes to request services of the operating system. System calls are the only entry points into the kernel system.
What system calls have to be executed by a command interpreter or shell in order to start a new process on UNIX system?Q 5) What system calls have to be executed by a command interpreter or shell in order to start a new process? Ans: In UNIX systems, a fork system call followed by an exec system call need to be performed to start a new process.
What is the purpose of the command?In computing, a command is a directive to a computer program to perform a specific task. It may be issued via a command-line interface, such as a shell, or as input to a network service as part of a network protocol, or as an event in a graphical user interface triggered by the user selecting an option in a menu.
|