







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
COURSE-B.Tech.(C.S./I.T.) UNIT1-OPERATING SYSTEM AND FUNCTION SEMESTER-4 SEM
Typology: Lecture notes
1 / 13
This page cannot be seen from the preview
Don't miss anything!








An operating system is a program that acts as an intermediary between a user of a computer and the computer hardware. An operating system is a system software which may be viewed as an organized collection of software consisting of procedure’s for operating a computer and providing an environment for execution of programs. The purpose of an operating system is to provide an environment in which a user can execute programs. The primary goal of an operating system is thus to make the computer system convenient to use.
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
Process Management A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity. Process needs resources to accomplish its task such as CPU, memory, I/O, files Process termination requires reclaim of any reusable resources. Typically system has many processes, some user, some operating system running concurrently on one or more CPUs Concurrency by multiplexing the CPUs among the processes / threads.
Process Management Activities The operating system is responsible for the following activities in connection with process management: Creating and deleting both user and system processes Suspending and resuming processes Providing mechanisms for process synchronization
Providing mechanisms for process communication Providing mechanisms for deadlock handling
Memory Management To execute a program all (or part) of the instructions and data that is needed must be in memory. Memory management determines what is in memory and when and thus optimizing CPU utilization and computer response to users. Memory management activities Keeping track of which parts of memory are currently being used and by whom Deciding which processes (or parts thereof) and data to move into and out of memory Allocating and deallocating memory space as needed
Storage Management OS provides uniform, logical view of information storage Abstracts physical properties to logical storage unit - file Each medium is controlled by device (i.e., disk drive, tape drive) Varying properties include access speed, capacity, data-transfer rate, access method (sequential or random)
File-System management Files usually organized into directories Access control on most systems to determine who can access what OS activities include Creating and deleting files and directories Primitives to manipulate files and directories Mapping files onto secondary storage Backup files onto stable (non-volatile) storage media
Device Management Usually disks used to store data that does not fit in main memory or data that must be kept for a “long” period of time Proper management is of central importance Entire speed of computer operation hinges on disk subsystem and its algorithms OS activities : - Free-space management Storage allocation Disk scheduling Some storage need not be fast Tertiary storage includes optical storage, magnetic tape o Still must be managed – by OS or applications o Varies between WORM (write-once, read-many-times) and RW (read-write)
Operating systems provide an environment for execution of programs and services to programs and users One set of operating-system services provides functions that are helpful to the user: User interface - Almost all operating systems have a user interface (UI). Varies between Command-Line (CLI), Graphics User Interface (GUI), Batch Program execution - The system must be able to load a program into memory and to run that program, end execution, either normally or abnormally (indicating error) I/O operations - A running program may require I/O, which may involve a file or an I/O device File-system manipulation - Programs need to read and write files and directories, create and delete them, search them, list file Information, permission management.
- Process Management A process is only ONE instant of a program in execution. There are many processes can be running the same program. The five major activities of an operating system in regard to process management are: - Creation and deletion of user and system processes. - Suspension and resumption of processes. - A mechanism for process synchronization. - A mechanism for process communication. - A mechanism for deadlock handling. - Main-Memory Management Main-Memory is a large array of words or bytes. Each word or byte has its own address. Main memory is a repository of quickly accessible data shared by the CPU and I/O devices. The major activities of an operating system in regard to memory-management are: Keep track of which part of memory are currently being used and by whom. Decide which processes are loaded into memory when memory space becomes available. Allocate and deallocate memory space as needed. - File Management A file is a collected of related information defined by its creator. Computer can store files on the disk (secondary storage), which provide long term storage. - The creation and deletion of files. - The creation and deletion of directions. - The support of primitives for manipulating files and directions. - The mapping of files onto secondary storage. - The backup of files on stable storage media. - I/O System Management One of the purposes of an operating system is to hide the peculiarities of specific hardware devices from the user. systems have several levels of storage, including primary storage, secondary storage and cache storage. Instructions and data must be placed in primary storage or cache to be referenced by a running program. - Networking A distributed system is a collection of processors that do not sharememory, peripheral devices, or a clock. The processors communicate with one another through communication lines called network**.
The Operating System as Resource Manager
A computer is a set of resources for the movement, storage, and processing of data and for the control of these functions. The OS is responsible for managing these resources.
A portion of the OS is in main memory. This includes the kernel, or nucleus, which contains themost frequently used functions in the OS and, at a given time, other portions of the OS currently in use. The remainder of main memory contains user programs and data. The allocation of this resource (main memory) is controlled jointly by the OS and memory management hardware in the processor.The OS decides when an I/O device can be used by a program in execution and controls access to and use of files. The processor itself is a resource, and the OS must determine how much processor time is to be devoted to the execution of a particular user program. In the case of a multiple-processor system, this decision must span all of the processors.
Types of Operating Systems
With the earliest computers, from the late 1940s to the mid-1950s, the programmer interacted directly with the computer hardware; there was no OS. These computers were run from a console consisting of display lights, toggle switches, some form of input device, and a printer. Programs in machine code were loaded via the input device (e.g., a card reader). If an error halted the program, the error condition was indicated by the lights. If the program proceeded to a normal completion, the output appeared on the printer. These early systems presented two main problems:
The monitor performs a scheduling function. A batch of jobs is queued up, and jobs are executed as rapidly as possible, with no intervening idle time. The monitor improves job setup time as well. With each job, instructions are included in a primitive form of job control language (JCL). This is a special type of programming language used to provide instructions to the monitor. The monitor, or batch operating system, is simply a computer program. It relies on the ability of the processor to fetch instructions from various portions of main memory to alternately seize and relinquish control. Certain other hardware features are also desirable:
Memory protection : Does not allow the memory area containing the monitor to be altered Timer : Prevents a job from monopolizing the system Privileged instructions Privileged instructions : Certain machine level instructions can only be executed by the monitor
Multiprogrammed Batch Systems Even with the automatic job sequencing provided by a simple batch operating system, the processor is often idle. The problem is that I/O devices are slow compared to the processor. When we have a single program, it is referred to as uniprogramming.
The processor spends a certain amount of time executing, until it reaches an I/O instruction. It must then wait until that I/O instruction concludes before proceeding. This inefficiency is not necessary. We know that there must be enough memory to hold the OS (resident monitor) and one user program. Suppose that there is room for the OS and two user programs. When one job needs to wait for I/O, the processor can switch to the other job, which is likely not waiting for I/O Furthermore, we might expand memory to hold three, four, or more programs and switch among all of them. The approach is known as multiprogramming , or multitasking. It is the central theme of modern operating systems.
The important features of a Multiprogramming OS are : Main memory should be big enough to hold multiple programs in the memory. When the CPU is taken away from a process, it is necessary to save the current contents of different registers in CPU at that time so that the program may resume again from where it left off. Memory protection should be provided so that the programs do not interfere with each other. Proper mixture of CPU bound and I/O bound programs.
Time-Sharing Systems With the use of multiprogramming, batch processing can be quite efficient. However, for many jobs, it is desirable to provide a mode in which the user interacts directly with the computer. Indeed, for some jobs, such as transaction processing, an interactive mode is essential. Just as multiprogramming allows the processor to handle multiple batch jobs at a time, multiprogramming can also be used to handle multiple interactive jobs. In this latter case, the technique is referred to as time sharing, because processor time is shared among multiple users. In a time-sharing system, multiple users simultaneously access the system through terminals, with the OS interleaving the execution of each user program in a short burst or quantum of computation. Thus, if there are n users actively requesting service at one time, each user will only see on the average 1/n of the effective computer capacity, not counting OS overhead. However, given the relatively slow human reaction time, the response time on a properly designed system should be similar to that on a dedicated computer.
Multiprocessor Systems Multiprocessor systems (also known as parallel systems or multicore systems) have two or more processors in close communication, sharing the computer bus and sometimes the clock, memory, and peripheral devices. Multiprocessor systems first appeared prominently appeared in servers and have since migrated to desktop and laptop systems. Recently, multiple processors have appeared on mobile devices such as smart phones and tablet computers. Multiprocessor systems have three main advantages:
Increased reliability of a computer system is crucial in many applications. The ability to continue providing service proportional to the level of surviving hardware is called graceful degradation. Some systems go beyond graceful degradation and are called fault tolerant, because they can suffer a failure of any single component and still continue operation. The multiple-processor systems in use today are of two types: Asymmetric multiprocessing : in which each processor is assigned a specific task. A boss processor controls the system; the other processors either look to the boss for instruction or have predefined tasks. This scheme defines a boss–worker relationship. The boss processor schedules and allocates work to the worker processors. Symmetric multiprocessing (SMP), in which each processor performs all tasks within the operating system. SMP means that all processors are peers; no boss–worker relationship exists between processors.
Real Time Operating System A real-time system is defined as a data processing system in which the time interval required to process and respond to inputs is so small that it controls the environment. The time taken by the system to respond to an input and display of required updated information is termed as the response time. So in this method, the response time is very less as compared to online processing. Real-time systems are used when there are rigid time requirements on the operation of a processor or the flow of data and real-time systems can be used as a control device in a dedicated application. A
Operating System Structure
Simple Structure : A system as large and complex as a modern operating system must be engineered carefully if it is to function properly and be modified easily. A common approach is to partition the task into small components, or modules, rather than have one monolithic system. Each of these modules should be
Layered Approach
The operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface. With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers
System Calls
Use of system call to do an I/O