Operating Systems Lecture 1 PDF
Document Details
Uploaded by GratifyingPointillism6471
Ashu Mehta
Tags
Summary
This lecture introduces the fundamental concepts of operating systems, explaining their role as intermediaries between users and computer hardware. It covers important topics like the need for an operating system, its functions (such as memory management, processor management, and device management), and various types of operating systems. This information is suitable for undergraduate-level computer science students.
Full Transcript
Chapter 1 Introduction -Ashu Mehta Database Systems What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware. An operating system is a powerful, and usually large, program that controls and manages the...
Chapter 1 Introduction -Ashu Mehta Database Systems What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware. An operating system is a powerful, and usually large, program that controls and manages the hardware and other software on a computer. All computers and computer-like devices have operating systems, including your laptop, tablet, desktop, smart phone, smart watch Examples include: Microsoft Windows (like Windows 10,Windows 8, Windows 7, Windows Vista, and Windows XP), Apple's macOS, iOS, Linux Need of OS Need of OS If the user wants to access any of the hardware they have to write a program and whenever they want to access any hardware they have to write the program everytime. So it would be very complex For E.g:Print a word file , we need to write the instruction for printing of the file. Introduction to Operating System What is an Operating system? – OS is a resource allocator Manages all resources Decides between conflicting requests for efficient and fair resource use – OS is a control program Controls execution of programs to prevent errors and improper use of the computer Operating system goals: – Execute user programs and make solving user problems easier – Make the computer system convenient to use – Use the computer hardware in an efficient manner An operating system is the one program that is running at all the times on the computer- usually called the kernel. Computer System Structure Computer system can be divided into four components – Hardware – provides basic computing resources CPU, memory, I/O devices – Operating system Controls and coordinates use of hardware among various applications and users – Application programs – define the ways in which the system resources are used to solve the computing problems of the users Word processors, compilers, web browsers, database systems, video games – Users People, machines, other computers Four Components of a Computer System Functions of operating system 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 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. Processor Management 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. Device Management 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. File Management A file system is normally organized into directories for easy navigation and usage. These directories may contain files and other directions. An Operating System does the following activities for file management − – Keeps track of information, location, uses, status etc. The collective facilities are often known as file system. – Decides who gets the resources. – Allocates the resources. – De-allocates the resources. Other Important Activities Following are some of the important activities that an Operating System performs − Security − By means of password and similar other techniques, it prevents unauthorized access to programs and data. Control over system performance − Recording delays between request for a service and response from the system. Job accounting − Keeping track of time and resources used by various jobs and users. Coordination between other softwares and users − Coordination and assignment of compilers, interpreters, assemblers and other software to the various users of the computer systems. Types of OS Batch operating system Time-sharing operating system Distributed operating system Network operating system Real-time operating system Batch operating system This type of operating system do not interact with the computer directly. There is an operator which takes similar jobs having same requirement and group them into batches. It is the responsibility of operator to sort the jobs with similar needs. Time sharing os Each task has given some time to execute, so that all the tasks work smoothly. Each user gets time of CPU as they use single system. These systems are also known as Multitasking Systems. The task can be from single user or from different users also. The time that each task gets to execute is called quantum. After this time interval is over OS switches over to next task. Distributed os These types of operating system is a recent advancement in the world of computer technology and are being widely accepted all-over the world. Various autonomous interconnected computers communicate each other using a shared communication network. Independent systems possess their own memory unit and CPU. These are referred as loosely coupled systems or distributed systems. These systems processors differ in sizes and functions. The major benefit of working with these types of operating system is that it is always possible that one user can access the files or software which are not actually present on his system but on some other system connected within this network i.e., remote access is enabled within the devices connected in that network. Network Operating System These systems runs on a server and provides the capability to manage data, users, groups, security, applications, and other networking functions. These type of operating systems allows shared access of files, printers, security, applications, and other networking functions over a small private network. One more important aspect of Network Operating Systems is that all the users are well aware of the underlying configuration, of all other users within the network, their individual connections etc. and that’s why these computers are popularly known as tightly coupled systems. Real-Time Operating System These types of OSs serves the real-time systems. The time interval required to process and respond to inputs is very small. This time interval is called response time. Real-time systems are used when there are time requirements are very strict like missile systems, air traffic control systems, robots etc. Two types of Real-Time Operating System which are as follows: Hard Real-Time Systems: These OSs are meant for the applications where time constraints are very strict and even the shortest possible delay is not acceptable. These systems are built for saving life like automatic parachutes or air bags which are required to be readily available in case of any accident. Soft Real-Time Systems: These OSs are for applications where time-constraint is less strict. Goals Of OS Primary Goal – Convenience/User Friendly Secondary Goal – Efficiency Multiprogramming& Multitasking – Multiprogrammed OS (CPU should not be idle) (Non-Preemptive) CPU should not be free. In this the process1(P1) will be executed fully by CPU only then the CPU will acquired by the process(P2),or if the p1 wants to leave otherwise CPU is not going to release the P1. Multiprogramming In multiprogramming system, when one program is waiting for I/O transfer; there is another program ready to utilize the CPU. So it is possible for several jobs to share the time of the CPU. But it is important to note that multiprogramming is not defined to be the execution of jobs at the same instance of time Advantages Of Multiprogramming It improves the CPU efficiency by increasing the CPU utilization. Increase throughput- Throughput means total number of programs executed over a fixed period of time. Multiprocessing Multiple Processing means multiple processor. In a single system ,we have multiple processor like Octa core->8 Processor Dual Core->2 Processor In multiprocessing OS ,more than one process can run on different CPU at the same time, So there is real parallel execution of Process. Multiprocessing CPU1 CPU2 CPU3 RAM Advantages Of Multiprocessing Increased Throughput − By increasing the number of processors, more work can be completed in a unit time. Cost Saving − Parallel system shares the memory, buses, peripherals etc. Multiprocessor system thus saves money as compared to multiple single systems. Multitasking Multitasking has the same meaning of multiprogramming but in a more general sense, as it refers to having multiple (programs, processes, tasks, threads) running at the same time. This term is used in modern operating systems when multiple tasks share a common processing resource (e.g., CPU and Memory) Multitasking Multitasking is an extension to Multiprogramming OS. The Jobs will be executed in the time sharing mode. Multitasking OS Multitasking/Timesharing Os Preemptive (Responsiveness) Some Specific time limit must be given to the Process1(P1) if it runs on that particular time, its well & good otherwise that process will be run in future and the CPU will be acquired by the Process2(P2).