An operating system is a program that manages application programs after being loaded by a boot program. Key concepts include process management, memory management, and file system operations, with various scheduling algorithms and methods for handling deadlocks and fragmentation. The document also discusses system calls, multiprocessor systems, and the advantages and disadvantages of different allocation methods.
An operating system is a program that manages application programs after being loaded by a boot program. Key concepts include process management, memory management, and file system operations, with various scheduling algorithms and methods for handling deadlocks and fragmentation. The document also discusses system calls, multiprocessor systems, and the advantages and disadvantages of different allocation methods.
initially loaded into the computer by a boot program, manages all of the other application programs in a computer. || Define a system program. → System programs provide basic functioning to users so that they do not need to write their own environment for program development (editors, compilers) and program execution (shells). || Which scheduler controls the degree of multiprogramming? → The Multiprogramming degree is mostly controlled by the Long-Term Scheduler. || What is Turn-Around Time? → The interval from the time of submission of a process to the time of completion is the turnaround time. || What is meant by Deadlock? → A deadlock is a situation in which two computer programs sharing the same resource are effectively preventing each other from accessing the resource, resulting in both programs ceasing to function. || What is demand paging? → The basic idea behind paging is that when a process is swapped in, the pager only loads into memory those pages that it expects the process to need (right away). || What do you mean by seeking Time in Disk Scheduling? → Seek Time - It is the time taken by the disk arm to locate the desired track. || Define Rollback?→ A rollback is the process of returning a database to its previous state. Rollback should not be confused with backups.Logical Address → Logical Address is generated by the CPU while a program is running. The logical address is virtual address as it does not exist physically, therefore, it is also known as Virtual Address. This address is used as a reference to access the physical memory location by CPU. || Physical Address → Physical Address identifies a physical location of required data in a memory. The user never directly deals with the physical address but can access it by its corresponding logical address.What is meant by a multiprocessing system? → Multiprocessor systems are also called parallel systems or tightly coupled systems. The computer bus is shared by two or more processors. || What is the process? → 1.A process is a program in execution. As the program executes the process changes state. 2.The state of a process is defined by its current activity. 3.Process execution is an alternating sequence of CPU and I/O bursts, beginning and ending with a CPU burst. 4.Thus, each process may be in one of the following states: New, Active, Waiting || List various operations on File. → Various operations which can be implemented on a file are:- 1.Create 3.Read 5.Delete 2.Write 4.Re-position 6.Truncate. || Define Context Switch? → It is a process that involves switching of the CPU from one process to another. In this, execution of the process that is present in the running state is suspended by the kernel and another process that is present in the ready state is executed by the CPU. || What is a page frame? → A page frame is the smallest fixed-length contiguous block of physical memory into which memory pages are mapped by the operating system. || What is compaction?→ Compaction refers to combining all the empty spaces together and processes. Compaction helps to solve the problem of fragmentation, but it requires a lot of CPU time. It moves all the occupied areas of storage to one end and leaves one large free space for incoming jobs. || What is starvation?→ Starvation: Another problem related to deadlocks is indefinite blocking, or starvation, a situation in which processes wait indefinitely within the semaphore. Indefinite blocking may occur if we remove processes from the list associated with a semaphore in LIFO order. || What is meant by Address Binding? → Programs are stored on the secondary storage disks as binary executable files. When the programs are to be executed they are brought into the main memory and placed within a process. || Define Burst Time. → Burst time, also referred to as “execution time”. It is the amount of CPU time the process requires to complete its execution. It is the amount of processing time required by a process to execute a specific task or unit of a job. || Explain Operating System Structure. → The structure of the operating system consists of four layers, those are Hardware, Operating system, System and Application programs and Users. The hardware consists of the Central Processing Unit (CPU), the main memory, I/O devices, secondary storage, etc. || What is a medium term scheduler? → Medium term scheduler takes care of swapped out processes. If the running process needs some I/O time for completion then it needs to change its state from running to waiting. Medium term scheduler is used for this purpose. Such processes are called swapped out processes and this procedure is called Swapping. The medium term scheduler is used for suspending and resuming the process. || Explain semaphores and their types in detail. → The first major advance in dealing with the problems of concurrent processes came in 1965 with Dijkstra's solution. Dijkstra's proposal for mutual exclusion among an arbitrary number of processes is called Semaphore. There are two types of semaphores: 1.Counting Semaphores:- Counting semaphores can take an integer value ranging between 0 and an arbitrarily large number. The Initial value represents the number of units of the critical resources that are available. This is also known as general semaphore. 2.Binary Semaphores:-The value of semaphore can range only between 0 and 1. Initially the value is set to 1 and if some process wants to use a resource then the wait() function is called and the value of the semaphore is changed from 0 to 1. || Explain multilevel Feedback queue Algorithm. → Multilevel feedback queue allows a process to move between queues. The idea is to separate processes with different CPU - Burst characteristics. If a process uses too much CPU time, it will be moved to a lower priority queue. This leaves I/O bound and interactive processes in the higher priority queues. Then it is moved to a higher priority queue. This form of aging prevents starvation. || Shortest Seek Time First. → Shortest Seek Time First (SSTF) selects the request with the minimum seek time from the current head position. Shortest Seek Time First (SSTF) scheduling is a form of Shortest Job First (SJF) scheduling; may cause starvation of some requests. || Linked Allocation for File System. → Linked allocation solves all the problems of contiguous allocation (Fig. 8.8). With chained allocation, each file is a linked list of disk blocks; the blocks may be scattered anywhere on the disk. Again, the file allocation table needs just a single entry for each file, showing starting block and length of file. Although static allocation is possible, it is more common simply to allocate blocks as needed. There is no external fragmentation because only one block at a time is needed. || Address binding in case of memory management. → Programs are stored on the secondary storage disks as binary executable files. When the programs are to be executed they are brought into the main memory and placed within a process. The collection of processes on the disk waiting to enter the main memory forms the Input Queue.The loader will convert this re-locatable address to absolute address. Each binding is a mapping from one address space to another. || Draw and explain the Contiguous Memory Allocation. → Contiguous allocation is one of the most used methods for allocation. With this method a single contiguous set of blocks is allocated to a file creation. Thus, this is the static allocation method, using variable-size portions. The FAT needs just one entry. For each file, showing the starting block and the length of the file. Contiguous allocation is best for sequential file.Contiguous allocation has some problems. || Define ‘Least Recently Used’ in memory management. → LRU (Last Recently Used) If we use the recent past as an approximation of the near future, then LRU replaces the page which has not been used for the longest period of time. This is the least recently used algorithm. LRU replacement associates with each page the time of its last use. When a page is to be replaced, LRU chooses that page which has not been used for the longest period or time. || List any four characteristics of the operating system. → Some characteristics of an Operating System are: 1.Multi-tasking: Multiple programs can run on it simultaneously. 2.Multi-processing: It can take advantage of multiple processors. 3.Multi-user: Multiple users can run programs on it simultaneously. 4.Security: It can reliably prevent application programs from directly accessing hardware devices i.e. protected. It has built-in support for graphics and Networks. || Define a safe state. → There are 3 states of the system: safe, unsafe and deadlock.When a system can allocate the resources to the process in such a way so that they still avoid deadlock then the state is called a safe state. A system is in safe state only if there exists a safe sequence. A sequence of process P1, P2, ...., P, is a safe sequence for the current allocation state if for each P₁ the resources request that P, can still make can be satisfied by currently available resources pulls the resources held by all Pj with j < i. || List and explain services provided by the operating system. → 1.User Interface: Almost all operating systems have a User Interface (UI). 2.Program Execution: The system must be able to load a program into memory and run the program. 3.I/O Operations: All the programs dealing with I/O operations relating to specific devices are to be dealt with by the operating system. 4.File System Implementation: The file system is of particular interest. Programs need to read and write files. 5.Protection: In a multi-user environment, protection of valuable resources plays an important role. || Explain Process Control Block (PCB) with a diagram. → 1.Each process is represented in the operating system by a Process Control Block (PCB) also called a Task Control Block. 2.The operating system groups all information that it needs about a particular process into a data structure called a PCB or Process Descriptor. 3.Diagram || Explain the ‘Dining Philosopher’ Synchronization problem. → 1.The Dining Philosopher problem is considered a classic synchronization problem. 2.One simple solution is to represent each chopstick of a semaphore. 3.A philosopher tries to grab the chopstick by executing a wait operation on that semaphore. || What is Fragmentation? Explain types of it in detail. → Fragmentation refers to the phenomenon where available space in storage (such as memory or disk space) becomes divided into smaller chunks that are not contiguous. There are two main types of fragmentation: 1. Internal Fragmentation: The phenomenon, in which there is wasted space internal to a partition due to the fact that the block of data loaded is smaller than the partition, is referred to as Internal Fragmentation. For Example: If there is a block of 50 Kb and if the process requests 40 Kb and if the block is allocated to the process then there will be 10 Kb of memory left. 2.External Fragmentation: External Fragmentation exists when there is enough memory space to satisfy the request, but its not contiguous i.e storage is fragmented into a large number of small holes. External Fragmentation may be either minor or a major problem. || Describe I/O Hardware with its type of I/O devices. → Computers operate a great many kinds of devices. Most fit into the general categories of storage devices such as disks, tapes etc. transmission devices such as network cards, modems etc. and human-interface devices such as screen, keyboard, mouse and so on. Devices communicate with the computer via signals sent over wires or through the air. Devices connect with the computer through ports, e.g. a serial or parallel port. Types of I/O devices are printers, hard disks, keyboards and mice. || What do you mean by Seek Time in Disk Scheduling? → Seek time is the time required to move the disk arm to the required track. The seek time consists of two key components - the initial startup time and the time taken to traverse the tracks that have to be crossed once the access is up to speed. || Explain Indexed Allocation in detail. → Linked allocation solves the external fragmentation and size declaration problem and contiguous allocation.Indexed allocation solves this problem by bringing all the pointers together into one location: the index block. In this case, the FAT contains a separate one-level index for each file; the index has one entry for each portion allocated to the file. File indexes are not physically stored as part of the FAT, but it is kept in a separate block and entry for the file in the FAT points to that block.Allocation may be on the basis of either fixed-sized blocks or variable-size partitions. || Explain different methods for recovery from deadlock? → a.Process Termination - 1.Abort all deadlocked processes: This method clearly will break the deadlock cycle, but at a great expense, these processes may have computed for a long time, and the result of these partial computations must be discarded and probably recomputed later. b.Resource Preemption - 1.Selecting a victim: Deciding which resources to preempt from which processes involves many of the same decision criteria outlined above. 2.Rollback: Ideally one would like to roll back a preempted process to a safe state prior to the point at which that resource was originally allocated to the process. || List any two types of Multiprocessor. → There are two types of multiprocessing systems : 1.Asymmetric Multiprocessing:- It is a multiprocessor Computer system where not all of multiple interconnected central processing units (CPUs) are treated equally. For example: AMP can be used in assigning specific tasks to the CPV based on the priority & the importance of task Completion. 2.Symmetric Multiprocessing :- It involves multiprocessor computer hardware & software architecture where two or more identical processors are connected to a Single, shared memory , & have full access to all input & output devices. || Explain advantages and disadvantages of linked allocation methods. → Advantage :- 1.Any free blocks can be added to a chain. 2.There is no external fragmentation. 3.Best suited for sequential files that are to be processed sequentially. Disadvantages :- 1.There is no accommodation of the principle of locality that series of accesses to different parts of the disk are required. 2.Space is required for the pointers. 1.5% of disk is used for the pointers and not for information. 3.This method cannot support direct access. || What is Interrupts? → The motivation for incorporating interrupt into the computer hardware is to eliminate the need for the device driver to constantly poll the controller status register. In the scenario using interrupts, the device management functionality is partitioned into four different parts: 1.The device driver that initiates the I/O operation. 2.Device status table. 3.Interrupt handler. 4.Device handler. || Explain various types of system programs. → 1.File Manipulation: These programs create, delete, copy, rename, print, dump, list and generally manipulate files and directories. 2.Status Information: Some programs simply ask the operating system for the date, time, and amount of available memory or disk space, number of users or similar status information. 3.File Modification: Several text editors may be available to create and modify the contents of files stored on a disk or a tape. 4.Programming Language Support: Compilers, assemblers and interpreters for common programming languages. || List and explain advantages of the Multiprocessor system. → Advantages of Multiprocessor System: 1.Increased throughput: As the number of processors increases, the result or output is faster. The time required is less to compute the task. 2.Economy of scale: The cost of a multiprocessor system is less than that of multiple single-processor systems, because peripheral devices, memory, and bus are shared. 3.Increased reliability: In a multiprocessor system, if any of the processors fails, the work of that processor is shared by the remaining processor and the system will not halt. || List and explain system calls related to Process and Job control. → Process is nothing but a program in execution. A running program needs to be able to halt its execution either normally or abnormally. A process or job executing one program may want to load and execute another program. System calls related to Process Control are: (i) End, Abort. (ii) Load,Execute. (iii) Create process. Terminate process. (iv) Ready process, Dispatch process. (v) Suspend process. Resume process. (vi) Get process attributes. Set process attributes. (vii) Wait for Time. (viii) Wait event, Signal event. (ix) Change the priority of a process. || Define Belady’s Anomaly → Belady’s anomaly is the phenomenon in which increasing the number of page frames results in an increase in the number of page faults for certain memory access patterns. This phenomenon is commonly experienced when using the first-in first-out (FIFO) page replacement algorithm.The FIFO page replacement algorithm is easy to understand and program. Its performance is not always good. || What is meant by Free Space Management? Define Bit vector and Grouping. → The system maintains a free space list by keeping track of the free disk space. The free space list contains all the records of the free space disk block. Bit Vector :- This technique is used to implement free space management. When the block is free its bit is set to 1 and when the block is allocated the bit is set to 0. Grouping :- This is also the technique of free space management. In this, there is a modification of the free-list approach which stores the address of the n free blocks. || Explain Resource Allocation Graph in detail. → Deadlock can be described more precisely in terms of a directed graph called a system Resource Allocation Graph. In the Resource Allocation Graph, processes are represented by a circle and resources are represented by boxes. Resource boxes have some number of dots inside indicating the available number of that resource that is the number of instances. || What is the difference between Preemptive and Non-Preemptive Scheduling. → Preemptive Scheduling :- 1.The CPU is allocated to the processes for a limited time. 2.The executing process in preemptive scheduling is interrupted in the middle of execution when a higher priority one comes whereas the executing process. 3.There is the overhead of switching the process from the ready state to the running state, vise-versa, and maintaining the ready queue. Non-preemptive scheduling :- 1.Non-preemptive scheduling, the CPU is allocated to the process till it terminates or switches to the waiting state. 2.Non-preemptive scheduling is not interrupted in the middle of execution and waits till its execution. 3.Non-preemptive scheduling there is no overhead of switching the process from running state to ready state. || Write a short note on solutions for critical section problems. → Consider a system consisting of n processes (Po, P1 Pn-1). Each process has a segment of code, called a Critical Section, in which the process may be changing common variables, updating a table, writing a file and so on.There are three sections which can be categorized as Entry Section, Critical Section, and Exit Section. The process has to make request in first section that is entry section.Thus, is often referred to as mutual exclusion || What are the characteristics and necessary conditions for a deadlock? → In a deadlock, processes never finish executing and system resources are tied up, preventing other jobs from starting. Before we discuss the various methods for dealing with the deadlock problems, we shall describe features that characterize deadlocks. Necessary Conditions for deadlock are :- 1.Mutual Exclusion: At least one resource is held in a non-sharable mode; that is only one process at a time can use the resource. 2.Hold and Wait: A process must be holding at least one resource and waiting to acquire additional resources that are currently being held by other processes. 3.No preemption: The process which once scheduled will be executed till the completion. 4.Circular Wait: All the processes must be waiting for the resources in a cyclic manner so that the last process is waiting for the resource which is being held by the first process. || Explain File System Access Methods. → File System Access Methods are :- a.Sequential Access method:- 1.One of the simplest file access methods. 2.Most of the OS uses a sequential access method to access the file. 3.In this method, the OS reads the file word by word and we have a pointer that points to the file's base address. b.Direct Access :- 1.For direct access, the file is viewed as a number of sequential blocks of records. 2.A block is generally a fixed length quantity, defined by an operating system. c.Index Sequential Access Method (ISAM):- 1.It is a different method of accessing files which is built on top of the sequential access method. 2.These methods construct an index for the file. 3.It controls the pointer by using an index. || Explain Paging in case of memory management. → 1.Paging is a non-contiguous memory allocation technique that permits the physical address space of a process to be non-contiguous. 2.Support for paging is handled by hardware. 3.It is used to avoid external fragmentation. 4.Paging avoids the considerable problem of fitting the varying sized memory chunks onto the backing store. || What is scheduling? Compare short term scheduler with long term scheduler. → Scheduling is the process by which the operating system decides which ready-to-run process should be allocated to the CPU next. The Goal is to optimize resource usage, fourness and system responsiveness. Long-term Schedulers and short-term schedulers are the two main types of schedulers. Long Term Schedulers :- 1.It is an operating system scheduler that chooses processes from the job queue and loads them to execution in the main memory. 2.It is also referred to as the Job Scheduler. 3.It is slower 4.It controls the multiprogramming degree. Short Term Schedulers :- 1.It is an operating System scheduler that chooses the process from the several processes that the processor runs. 2.It is also referred to as a CPU scheduler. 3.It is faster. 4.It provides less control over the multiprogramming degree. || Draw and explain Round Robin Scheduling with the help of an example. → Round Robin is a preemptive scheduling algorithm designed for fairness and to prevent any process from waiting indefinitely. It works as follows:- 1.Ready Queue - Processes waiting to use the CPU are placed in a Circular queue. 2.Time Quantum - A fixed time slice (quantum) is defined, representing the maximum time a process can run before it's preempted. 3.Execution - The CPU is allocated to the process at the front of the queue. The process runs for the time quantum or until it completes, whichever happens first. 4.Preemption - If the process does not complete within the time quantum, it is preempted (interrupted) and. placed at the back of the ready queue. 5.Context Switch - The CPU switches to the next process in the queue, and the cycle repeats. || List various properties of the file. → 1.Name: Every file carries a name by which the file is recognized in the file system.One directory cannot have two files with the same name. 2.Identifier: Along with the name, Each File has its own extension which identifies the type of the file. 3.Type: In a File System, the Files are classified in different types such as video files, audio files, text files, executable files, etc. 4.Location: In the File System, there are several locations on which the files can be stored. Each file carries its location as its attribute. 5.Size: The Size of the File is one of its most important attributes. 6.Protection: The Admin of the computer may want the different protections for the different files. ||