




































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Notes for operating system subject
Typology: Cheat Sheet
1 / 44
This page cannot be seen from the preview
Don't miss anything!
On special offer
Operating System (UNIT 1) An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. An Operating System (OS) is an interface between computer user and computer hardware. An operating system is software which performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers. The purpose of an operating system is to provide an environment in which a user can execute programs in convenient and efficient manner. Some popular Operating Systems include Linux Operating System, Windows Operating System, VMS, OS/400, AIX, z/OS, etc.
An operating system is a program that acts as an interface between the user and the computer hardware and controls the execution of all kinds of programs. Following are some of important functions of an operating System. Memory Management Processor Management Device Management File Management Security Control over system performance Job accounting Error detecting aids
Coordination between other software and users
Memory management refers to management of Primary Memory or Main Memory. Main memory is a large array of words or bytes where each word or byte has its own address. Main memory provides a fast storage that can be accessed directly by the CPU. For a program to be executed, it must in the main memory. An Operating System does the following activities for memory management − Keeps tracks of primary memory, i.e., what part of it are in use by whom, what part are not in use. In multiprogramming, the OS decides which process will get memory when and how much. Allocates the memory when a process requests it to do so. De-allocates the memory when a process no longer needs it or has been terminated.
In multiprogramming environment, the OS decides which process gets the processor when and for how much time. This function is called process scheduling. An Operating System does the following activities for processor management − Keeps tracks of processor and status of process. The program responsible for this task is known as traffic controller. Allocates the processor (CPU) to a process. De-allocates processor when a process is no longer required.
An Operating System manages device communication via their respective drivers. It does the following activities for device management − Keeps tracks of all devices. Program responsible for this task is known as the I/O controller. Decides which process gets the device when and for how much time. Allocates the device in the efficient way. De-allocates devices.
A file system is normally organized into directories for easy navigation and usage. These directories may contain files and other directions.
o This allows implementers to change the inner workings and increases modularity. o As long as the external interface of the routines doesn't change, developers have more freedom to change the inner workings of the routines. o The main advantage is the simplicity of construction and debugging. The main difficulty is defining the various layers. The main disadvantage of this structure is that the data needs to be modified and passed on at each layer, which adds overhead to the system. Moreover, careful planning of the layers is necessary as a layer can use only lower-level layers. UNIX is an example of this structure. There are six layers in the layered operating system. A diagram demonstrating these layers is as follows:
The process management component is a procedure for managing many processes running simultaneously on the operating system. Every running
software application program has one or more processes associated with them. For example, when you use a search engine like Chrome, there is a process running for that browser program. Process management keeps processes running efficiently. It also uses memory allocated to them and shutting them down when needed. The execution of a process must be sequential so, at least one instruction should be executed on behalf of the process. Functions of process management Here are the following functions of process management in the operating system, such as: o Process creation and deletion. o Suspension and resumption. o Synchronization process o Communication process
A file is a set of related information defined by its creator. It commonly represents programs (both source and object forms) and data. Data files can be alphabetic, numeric, or alphanumeric.
o Distributed systems help you to various computing resources in size and function. They may involve minicomputers, microprocessors, and many general-purpose computer systems. o A distributed system also offers the user access to the various resources the network shares. o It helps to access shared resources that help computation to speed up or offers data availability and reliability.
Main memory is a large array of storage or bytes, which has an address. The memory management process is conducted by using a sequence of reads or writes of specific memory addresses. It should be mapped to absolute addresses and loaded inside the memory to execute a program. The selection of a memory management method depends on several factors. However, it is mainly based on the hardware design of the system. Each algorithm requires corresponding hardware support. Main memory offers fast storage that can be accessed directly by the CPU. It is costly and hence has a lower storage capacity. However, for a program to be executed, it must be in the main memory. Functions of Memory management An Operating System performs the following functions for Memory Management in the operating system: o It helps you to keep track of primary memory.
o Determine what part of it are in use by whom, what part is not in use. o In a multiprogramming system, the OS decides which process will get memory and how much. o Allocates the memory when a process requests. o It also de-allocates the memory when a process no longer requires or has been terminated.
The most important task of a computer system is to execute programs. These programs help you to access the data from the main memory during execution. This memory of the computer is very small to store all data and programs permanently. The computer system offers secondary storage to back up the main memory. Today modern computers use hard drives/SSD as the primary storage of both programs and data. However, the secondary storage management also works with storage devices, such as USB flash drives and CD/DVD drives. Programs like assemblers and compilers are stored on the disk until it is loaded into memory, and then use the disk is used as a source and destination for processing. Functions of Secondary storage management Here are some major functions of secondary storage management in the operating system: o Storage allocation o Free space management o Disk scheduling
One of the important use of an operating system that helps to hide the variations of specific hardware devices from the user.
For example, memory addressing hardware helps to confirm that a process can be executed within its own address space. The time ensures that no process has control of the CPU without renouncing it. Lastly, no process is allowed to do its own I/O to protect, which helps you to keep the integrity of the various peripheral devices. Security can improve reliability by detecting latent errors at the interfaces between component subsystems. Early detection of interface errors can prevent the foulness of a healthy subsystem by a malfunctioning subsystem. An unprotected resource cannot misuse by an unauthorized or incompetent user.
One of the most important components of an operating system is its command interpreter. The command interpreter is the primary interface between the user and the rest of the system.
Many commands are given to the operating system by control statements. A program that reads and interprets control statements is automatically executed when a new job is started in a batch system or a user logs in to a time-shared system. This program is variously called. o The control card interpreter, o The command-line interpreter, o The shell (in UNIX), and so on. Its function is quite simple, get the next command statement, and execute it. The command statements deal with process management, I/O handling, secondary storage management, main memory management, file system access, protection, and networking.
o Memory management : It manages both the primary and secondary memory such as RAM, ROM, hard disk, pen drive, etc. It checks and decides the allocations and deallocation of memory space to different processes. When a user interacts with a system, the CPU is supposed to read or write operations, in this case, OS decides the amount of memory to be allocated for loading the program instructions and data into RAM. After this program is terminated, the memory area is again free and is ready to be allocated to other programs by the OS. o Processor Management : It facilitates processor management, where it decides the order for the processes to access the processor as well as decides the processing time to be allocated for each process. Besides
the CPU time, then the CPU time is sliced into segments and allocated to these processes in a round-robin fashion to prevent a single process from monopolizing the CPU. o Deadlock Prevention : Sometimes a resource that is supposed to be shared by two or more processes is held by one process due to which the resource cannot continue. This situation is known as deadlock. The OS does not let this situation arise by carefully distributing the resources among the different processes. o Interrupt Handling : OS also responds to interrupts, which are signals generated by a program or a device to seek the attention of the CPU. The OS checks the priority of the interrupt, and if it is more important than the currently running process, it stops the execution of the current process and preserves this state of CPU then executes the requested process. Thereafter the CPU returns to the same state where it was stopped. Preemptive Scheduling is a CPU scheduling technique that works by dividing time slots of CPU to a given process. The time slot given might be able to complete the whole process or might not be able to it. When the burst time of the process is greater than CPU cycle, it is placed back into the ready queue and will execute in the next chance. This scheduling is used when the process switch to ready state. Algorithms that are backed by preemptive Scheduling are round-robin (RR), priority, SRTF (shortest remaining time first). Non-preemptive Scheduling is a CPU scheduling technique the process takes the resource (CPU time) and holds it till the process gets terminated or is pushed to the waiting state. No process is interrupted until it is completed, and after that processor switches to another process. Algorithms that are based on non-preemptive Scheduling are non-preemptive priority, and shortest Job first. Preemptive Vs Non-Preemptive Scheduling Preemptive Scheduling Non-Preemptive Scheduling Resources are allocated according to the cycles for a limited time. Resources are used and then held by the process until it gets terminated.
Preemptive Scheduling Non-Preemptive Scheduling The process can be interrupted, even before the completion. The process is not interrupted until its life cycle is complete. Starvation may be caused, due to the insertion of priority process in the queue. Starvation can occur when a process with large burst time occupies the system. Maintaining queue and remaining time needs storage overhead. No such overheads are required.
The interaction between a user and the computer does not occur in this system. The user is required to prepare jobs on punch cards in the form of batches and submit them to the computer operator. The computer operator sorts the jobs or programs and keeps similar programs or jobs in the same batch and run as a group to speed up processing. It is designed to execute one job at a time. Jobs are processed on a first-come, first-serve basis, i.e., in the order of their submission without any human intervention. For example, the credit card bill generated by banks is an example of batch processing. A separate bill is not generated for each credit card purchase, rather a single bill that includes all purchases in a month is generated through batch processing. The bill details are collected and held as a batch,
As the name suggests, it enables multiple users located at different terminals to use a computer system and to share the processor's time simultaneously. In other words, each task gets time to get executed, and thus all tasks are executed smoothly. Each user gets the processor's time as they get while using a single system. The duration of time allocated to a task is called quantum or time slice; when this duration is over, OS starts the next task. Advantages of time sharing operating system: o It reduces CPU idle time and thus makes it more productive. o Each process gets the chance to use the CPU. o It allowed different applications run simultaneously. Disadvantages of time sharing operating system: o It requires a special operating system as it consumes more resources. o Switching between tasks may hang up the system as it serves lots of users and runs lots of applications at the same time, so it requires hardware with high specifications. o It is less reliable.
It uses or runs on multiple independent processors (CPUs) to serve multiple users and multiple real-time applications. The communication between
processors is established through many communication lines such as telephone lines and high-speed buses. The processors may differ from each other in terms of size and function. The availability of powerful microprocessor and advanced communication technology have made it possible to design, develop, and use the distributed operating system. Besides this, it is an extension of a network operating system that supports a high level of communication and integration of machines on the network. Advantages of distributed operating system: o Its performance is higher than a single system as resources are being shared. o If one system stops working, malfunctions, or breaks down, other nodes are not affected. o Additional resources can be added easily. o Shared access to resources like printer can be established. o Delay in processing is reduced to a greater extent. o Data sharing or exchange speed is high, owing to the use of electronic mail. Disadvantages of distributed operating system: o Security issue may arise due to sharing of resources o Few messages may be lost in the system o Higher bandwidth is required in case of handling a large amount of data o Overloading issue may arise o The performance may be low o The languages which are used to set up a distributed system are not well defined yet o They are very costly, so they are not easily available.