Introduction - Computer System Overview - Basic Elements - Instruction Execution – Interrupts - Memory Hierarchy - Cache Memory - Direct Memory Access - Multiprocessor and Multicore Organization. Operating system overview : objectives and functions - Evolution of Operati...
Operating System Overview
Introduction - Computer System Overview - Basic Elements - Instruction Execution – Interrupts - Memory Hierarchy - Cache Memory - Direct Memory Access - Multiprocessor and Multicore Organization. Operating system overview : objectives and functions - Evolution of Operating System.- Computer System Structure – Operating System Structures : System Components – Operating System Services - System Calls - System Programs – System Structure - OS Generation and System Boot.
Size: 2.2 MB
Language: en
Added: Jun 21, 2024
Slides: 96 pages
Slide Content
ABINAYA.R / AP / CSE / SRIT OPERATING SYSTEM
UNIT- I Operating Systems Overview Introduction - Computer System Overview - Basic Elements - Instruction Execution – Interrupts - Memory Hierarchy - Cache Memory - Direct Memory Access - Multiprocessor and Multicore Organization. Operating system overview : objectives and functions - Evolution of Operating System.- Computer System Structure – Operating System Structures : System Components – Operating System Services - System Calls - System Programs – System Structure - OS Generation and System Boot. ABINAYA.R / AP / CSE / SRIT
INTRODUCTION ABINAYA.R / AP / CSE / SRIT
What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware 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 ABINAYA.R / AP / CSE / SRIT
Need of OS Do you speak binary? Can you comprehend machine code? If I gave you a sheet full of 1s and 0s, could you tell me what it means/does? If you were to go to a country you’ve never been to that speaks a language you’ve never heard, or maybe you’ve heard of it but don’t actually speak it, what would you need while there to help you communicate with the locals? ABINAYA.R / AP / CSE / SRIT
OS-Soul of a Computer!!! Your operating system functions as that translator in your PC. It converts those 1s and 0s, yes/no, and on/off values into a readable language that you will understand. It does all of this in a streamlined graphical user interface, or GUI, that you can move around with a mouse, click things, move them, and see them happening before your eyes. ABINAYA.R / AP / CSE / SRIT
Operating System An Operating System (OS) is a collection of software that manages computer hardware and provides services for programs. Specifically, it hides hardware complexity, manages computational resources, and provides isolation and protection. Most importantly, it directly has privilege access to the underlying hardware. There are three key elements of an operating system are: (1) Abstractions (process, thread, file, socket, memory), (2) Mechanisms (create, schedule, open, write, allocate), and (3) Policies (LRU, EDF). ABINAYA.R / AP / CSE / SRIT
Overview of computer system A computer system is a set of integrated devices which takes input, process it and give output. Also it store data and information.computer system allows users to input, manipulate and store data. Computer systems include a CPU, monitor, keyboard, mouse and other optional components. ABINAYA.R / AP / CSE / SRIT
Components of a computer system All general-purpose computers require the following hardware components : Memory : It is used to store data and programs.It may be temporary or permanent e.g RAM,ROM Mass storage device : Allows a computer to store large amount of data permanently. e.g Hard Disk. ABINAYA.R / AP / CSE / SRIT
input device : Any device that sends data to a computer is called input device. e.g keyboard and mouse Output device : Any device that outputs information or data from a computer to another device is called output device. e.g display screen, printer central processing unit (CPU) : This is also called as heart of the computer, CPU is responsible for executes instructions. It receives data input, executes instructions, and processes information and then generate appropriate result.Sometimes referred to simply as the central processor, but more commonly called processor. ABINAYA.R / AP / CSE / SRIT
Input Devices Keyboard, Mouse, Digitizing Tablet, Track Ball, Joystick, TouchScreen, Light Pen, Speech Recognition System, Digital camera, Scanner, Magnetic Ink CharacterRecognition (MICR), Optical Character Recognition (OCR), Optical Mark Recognition (OMR), Barcode Reader Output Devices Monitor, Visual Display Terminal, Printer, Plotter, Computer Output on Microfilm(COM), Video Output System, Audio Response System Input-Output Devices Hard disk drive, Floppy disk drive, USB drive, CD drive, DVD drive. ABINAYA.R / AP / CSE / SRIT
computer parts and functions ABINAYA.R / AP / CSE / SRIT
Underlying principle of operation of a computer system: The Von-Neumann principle The basic cycle of operation is Fetch an instruction (Fetch) Interpret the instruction (Decode) Execute the instruction (Execute) ABINAYA.R / AP / CSE / SRIT
ABINAYA.R / AP / CSE / SRIT
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 ABINAYA.R / AP / CSE / SRIT
Four Components of a Computer System ABINAYA.R / AP / CSE / SRIT
BASIC ELEMENTS Computer-system operation One or more CPUs, device controllers connect through common bus providing access to shared memory Concurrent execution of CPUs and devices competing for memory cycles ABINAYA.R / AP / CSE / SRIT
INSTRUCTION EXECUTION Instruction is a command which is given by the user to computer. Execution is the process by which a computer performs instruction. Instruction execution means a program to be executed by a processor consists of a set of instructions stored in memory. ABINAYA.R / AP / CSE / SRIT
ABINAYA.R / AP / CSE / SRIT
Interrupt An interrupt is a signal emitted by hardware or software when a process or an event needs immediate attention. It alerts the processor to a high-priority process requiring interruption of the current working process. In I/O devices, one of the bus control lines is dedicated for this purpose and is called the Interrupt Service Routine (ISR). While the processor is handling the interrupts, it must inform the device that its request has been recognized to stop sending the interrupt request signal. Also, saving the registers so that the interrupted process can be restored in the future increases the delay between the time an interrupt is received and the start of the execution of the ISR. This is called Interrupt Latency . ABINAYA.R / AP / CSE / SRIT
An operating system usually has some code that is called an interrupt handler . The interrupt handler prioritizes the interrupts and saves them in a queue if more than one is waiting to be handled. The operating system has another little program called a scheduler that figures out which program to control next. Types of Interrupt Interrupt signals may be issued in response to hardware or software events. These are classified as hardware interrupts or software interrupts , respectively. ABINAYA.R / AP / CSE / SRIT
ABINAYA.R / AP / CSE / SRIT
Hardware Interrupts: If the signal for the processor is from external device or hardware is called hardware interrupts. Example: from keyboard we will press the key to do some action this pressing of key in keyboard will generate a signal which is given to the processor to do action, such interrupts are called hardware interrupts. Hardware interrupts can be classified into two types they are Maskable Interrupt: The hardware interrupts which can be delayed when a much highest priority interrupt has occurred to the processor. Non Maskable Interrupt : The hardware which cannot be delayed and should process by the processor immediately. ABINAYA.R / AP / CSE / SRIT
Software Interrupts : Software interrupt can also divided in to two types. They are Normal Interrupts : the interrupts which are caused by the software instructions are called software instructions. Exception : unplanned interrupts while executing a program is called Exception. For example: while executing a program if we got a value which should be divided by zero is called a exception. ABINAYA.R / AP / CSE / SRIT
Memory Hierarchy The Computer memory hierarchy looks like a pyramid structure which is used to describe the differences among memory types. It separates the computer storage based on hierarchy. Level 0: CPU registers (low-temporary storage area) Level 1: Cache memory Level 2: Main memory or primary memory Level 3: Magnetic disks or secondary memory Level 4: Optical disks or magnetic types or tertiary Memory ABINAYA.R / AP / CSE / SRIT
ABINAYA.R / AP / CSE / SRIT
Level-0 − Registers The registers are present inside the CPU. As they are present inside the CPU, they have least access time . Registers are most expensive and smallest in size generally in kilobytes. They are implemented by using Flip-Flops. Level-1 − Cache Cache memory is used to store the segments of a program that are frequently accessed by the processor . It is expensive and smaller in size generally in Megabytes and is implemented by using static RAM. Level-2 − Primary or Main Memory (important) It directly communicates with the CPU and with auxiliary memory devices through an I/O processor . Main memory is less expensive than cache memory and larger in size generally in Gigabytes . This memory is implemented by using dynamic RAM. ABINAYA.R / AP / CSE / SRIT
Level-3 − Secondary storage(additional memory) Secondary storage devices like Magnetic Disk are present at level 3. They are used as backup storage . They are cheaper than main memory and larger in size generally in a few TB ./(non volatile….we can get the file)/ Level-4 − Tertiary storage Tertiary storage devices like magnetic tape are present at level 4. They are used to store removable files and are the cheapest and largest in size (1-20 TB). ABINAYA.R / AP / CSE / SRIT
ABINAYA.R / AP / CSE / SRIT
Cache Memory Cache Memory is a special very high-speed memory. It is used to speed up and synchronize with high-speed CPU. Cache memory is costlier than main memory or disk memory but more economical than CPU registers. Cache memory is an extremely fast memory type that acts as a buffer between RAM and the CPU. It holds frequently requested data and instructions so that they are immediately available to the CPU when needed. Cache memory is used to reduce the average time to access data from the Main memory. The cache is a smaller and faster memory that stores copies of the data from frequently used main memory locations. There are various different independent caches in a CPU, which store instructions and data. ABINAYA.R / AP / CSE / SRIT
ABINAYA.R / AP / CSE / SRIT
Hit ratio The performance of cache memory is frequently measured in terms of a quantity called Hit ratio. Hit ratio = hit / (hit + miss) = no. of hits/total accesses ABINAYA.R / AP / CSE / SRIT
Direct memory access (DMA) is a method that allows an input/output (I/O) device to send or receive data directly to or from the main memory, by passing the CPU to speed up memory operations. The process is managed by a chip known as a DMA controller (DMAC). ABINAYA.R / AP / CSE / SRIT
MULTIPROCESSOR Multiprocessor Operating System refers to the use of two or more central processing units (CPU) within a single computer system. These multiple CPUs are in a close communication sharing the computer bus, memory and other peripheral devices. These systems are referred as tightly coupled systems. ABINAYA.R / AP / CSE / SRIT MULTIPROCESSOR AND MULTICORE ORGANIZATION
ABINAYA.R / AP / CSE / SRIT
MULTICORE ABINAYA.R / AP / CSE / SRIT A single computing component with multiple cores (independent processing units) is known as a multicore processor. It denotes the presence of a single CPU with several cores in the system. Individually, these cores may read and run computer instructions. They work in such a way that the computer system appears to have several processors, although they are cores, not processors. These cores may execute normal processors instructions, including add, move data, and branch. A single processor in a multicore system may run many instructions simultaneously, increasing the overall speed of the system's program execution. It decreases the amount of heat generated by the CPU while enhancing the speed with which instructions are executed.
ABINAYA.R / AP / CSE / SRIT
Various differences between the Multiprocessor and Multicore system are as follows: ABINAYA.R / AP / CSE / SRIT A multiprocessor system with multiple CPUs allows programs to be processed simultaneously. On the other hand, the multicore system is a single processor with multiple independent processing units called cores that may read and execute program instructions. Multiprocessor systems outperform multicore systems in terms of reliability. A multiprocessor is a computer with many processors. If one of any processors fails in the system, the other processors will not be affected. Multiprocessors run multiple programs faster than the multicore system. On the other hand, a multicore system quickly executes a single program. Multicore systems have less traffic than multiprocessors system because the cores are integrated into a single chip. Multiprocessors require complex configuration. On the other hand, a multicore system doesn't need to be configured. Multiprocessors are expensive as compared to multicore systems. On the other hand, multicore systems are cheaper than multiprocessors systems.
Features Multiprocessors Multicore Definition It is a system with multiple CPUs that allows processing programs simultaneously. A multicore processor is a single processor that contains multiple independent processing units known as cores that may read and execute program instructions. Execution Multiprocessors run multiple programs faster than a multicore system. The multicore executes a single program faster. Reliability It is more reliable than the multicore system. If one of any processors fails in the system, the other processors will not be affected. It is not much reliable than the multiprocessors. Traffic It has high traffic than the multicore system. It has less traffic than the multiprocessors. Cost It is more expensive as compared to a multicore system. These are cheaper than the multiprocessors system. Configuration It requires complex configuration. It doesn't need to be configured. ABINAYA.R / AP / CSE / SRIT
conclusion ABINAYA.R / AP / CSE / SRIT The terms multicore and multiprocessor differ in which multicore system refers to a single CPU with several execution units, while multiprocessor refers to a system with multiple CPUs. A multicore system would be more efficient if you only need to run one program. However, a multiprocessor machine would be faster if you have numerous apps running. Modern systems have multiple processors, and each of them has multiple cores.
REFERENCE ABINAYA.R / AP / CSE / SRIT
REFERENCE ABINAYA.R / AP / CSE / SRIT
Various Evolution of the Operating System ABINAYA.R / AP / CSE / SRIT
1. Serial Processing It develops by 1940 to 1950’s programmers incorporated by the hardware components without the implementation of the operating system. The problems here are the scheduling and setup time. The user’s login for machine time by wasting the computed time. The setup time is involved when loading the compiler, saving the compiled program, source program, linking and buffering. If any intermediate error occurs, the process gets starts over. Example: Windows 95 and 98 are examples of serial processing operating systems. ABINAYA.R / AP / CSE / SRIT
2. The Batch System It is used by improving the utilization and application of computers. Jobs were scheduled and submitted on cards and tapes. Then sequentially executed on the monitors by using Job Control Language. The first computers are used in the process of the batch operating process made the computer batch of jobs without any pause or stop. The program is written in the punch cards and then copied to the processing unit of the tape. When the computer completed a single job, it instantly begins the next task on the tape. Professional operators are trained to communicate with the machine where the users dropped the jobs and fetched back to pick the results after the job is executed. The first computers employed in the batch operation method created a computer batch of jobs that never paused or stopped. The software is written on punch cards and then transferred to the tape's processing unit. When the computer finishes one job, it immediately moves on to the next item on the tape. Example: MVS Operating System of IBM is an example of a batch processing operating system. ABINAYA.R / AP / CSE / SRIT
3. Multi-programmed Batch System It is used to have several jobs to execute which should be held in main memory. Job scheduling is made up of the processor to decide which program to execute. Example: Windows and IOS are examples of multi-programmed batched operating systems. ABINAYA.R / AP / CSE / SRIT
Time-Sharing Operating System The Time-sharing of operating systems had a great impact on the evolution of operating systems. Multiple users can access the system via terminals at the same time, and the processor's time is divided among them. Printing ports were required for programs having a command-line user interface, which required written responses to prompts or written commands. The interaction is scrolled down like a roll of paper. It was previously used to develop batch replacement systems. The user interfaces directly with the computer via printing ports, much like an electric teletype. Few users shared the computer immediately, and each activity was completed in a fraction of a second before moving on to the next. By establishing iterations when they are receiving full attention, the fast server may act on a large number of users' processes at once. Multiple programs use time-sharing systems to apply to the computer system by sharing the system interactively. Example: Unix Operating System is an example of a time-sharing OS. ABINAYA.R / AP / CSE / SRIT
5. Macintosh Operating System It was dependent on decades of research on graphical oriented personal computer operating systems and applications. In 1960, the photo shows a Sutherland pioneer program sketchpad is developed by using many characteristics of the modern graphical user interface but the hardware components cost around millions of dollars that occupied a room. After many research gaps, the project on large computers and enhancement in hardware made the Macintosh commercially and economically feasible. The research prototypes such as sketchpads are still under process at many research labs. It formed the basis of expected products. Example: Mac OS X 10.6.8 snow leopard and OS X 10.7.5 Lion are some examples of macintosh OS. ABINAYA.R / AP / CSE / SRIT
computer structure ABINAYA.R / AP / CSE / SRIT
Input Unit Central Processing Unit Control Unit Memory Unit Output Unit ABINAYA.R / AP / CSE / SRIT
ABINAYA.R / AP / CSE / SRIT
ABINAYA.R / AP / CSE / SRIT
Although it doesn’t receive any input from the outside world, it sends out commands to other components, like the register and instruction decoder. A computer’s control unit is the master of everything that goes on inside. It handles everything from executing instructions to running programs . There are two main types of memory : random access memory (RAM) and read-only memory (ROM). RAM stores data as it is being used, while ROM retains data even when power isn't provided. here’s another component involved in the processing of data: the control unit. ABINAYA.R / AP / CSE / SRIT
ABINAYA.R / AP / CSE / SRIT
Os stucture Simple structure : Such operating systems do not have well defined structure and are small, simple and limited systems. The interfaces and levels of functionality are not well separated. MS-DOS is an example of such operating system. In MS-DOS application programs are able to access the basic I/O routines. These types of operating system cause the entire system to crash if one of the user programs fails. Diagram of the structure of MS-DOS is shown below. ABINAYA.R / AP / CSE / SRIT
ABINAYA.R / AP / CSE / SRIT
Advantages of Simple structure: It delivers better application performance because of the few interfaces between the application program and the hardware. Easy for kernel developers to develop such an operating system. Disadvantages of Simple structure: The structure is very complicated as no clear boundaries exists between modules. It does not enforce data hiding in the operating system. ABINAYA.R / AP / CSE / SRIT
Layered structure : An OS can be broken into pieces and retain much more control on system. In this structure the OS is broken into number of layers (levels). The bottom layer (layer 0) is the hardware and the topmost layer (layer N) is the user interface . These layers are so designed that each layer uses the functions of the lower level layers only. This simplifies the debugging process as if lower level layers are debugged and an error occurs during debugging then the error must be on that layer only as the lower level layers have already been debugged . The main disadvantage of this structure is that at each layer, the data needs to be modified and passed on 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. ABINAYA.R / AP / CSE / SRIT
ABINAYA.R / AP / CSE / SRIT
Advantages of Layered structure: Layering makes it easier to enhance the operating system as implementation of a layer can be changed easily without affecting the other layers. It is very easy to perform debugging and system verification. Disadvantages of Layered structure: In this structure the application performance is degraded as compared to simple structure. It requires careful planning for designing the layers as higher layers use the functionalities of only the lower layers. ABINAYA.R / AP / CSE / SRIT
Monolithic kernel A monolithic kernel is an operating system architecture where the entire operating system is working in kernel space. The monolithic model differs from other operating system architectures, such as the microkernel architecture, in that it alone defines a high-level virtual interface over computer hardware. CP/M and DOS are simple examples of monolithic operating systems. Both CP/M and DOS are operating systems that share a single address space with the applications. ABINAYA.R / AP / CSE / SRIT
Micro-kernel : This structure designs the operating system by removing all non-essential components from the kernel and implementing them as system and user programs. This result in a smaller kernel called the micro-kernel. Advantages of this structure are that all new services need to be added to user space and does not require the kernel to be modified. Thus it is more secure and reliable as if a service fails then rest of the operating system remains untouched. Mac OS is an example of this type of OS. ABINAYA.R / AP / CSE / SRIT
Modular structure or approach: It is considered as the best approach for an OS . It involves designing of a modular kernel . The kernel has only set of core components and other services are added as dynamically loadable modules to the kernel either during run time or boot time . It resembles layered structure due to the fact that each kernel has defined and protected interfaces but it is more flexible than the layered structure as a module can call any other module. For example Solaris OS is organized as shown in the figure. ABINAYA.R / AP / CSE / SRIT
ABINAYA.R / AP / CSE / SRIT
Components of operating system ABINAYA.R / AP / CSE / SRIT
Process Management : Process Management : A process is a program in execution. It consists of the followings: Executable program Program’s data Stack and stack pointer Program counter and other CPU registers Details of opened files ABINAYA.R / AP / CSE / SRIT
A process can be suspended temporarily and the execution of another process can be taken up. A suspended process can be restarted later. Before suspending a process, its details are saved in a table called the process table so that it can be executed later on. An operating system supports two system calls to manage processes Create and Kill – Create a system call used to create a new process. Kill system call used to delete an existing process. A process can create a number of child processes. Processes can communicate among themselves either using shared memory or by message-passing techniques. Two processes running on two different computers can communicate by sending messages over a network. ABINAYA.R / AP / CSE / SRIT
Files Management : Files are used for long-term storage. Files are used for both input and output. Every operating system provides a file management service. This file management service can also be treated as an abstraction as it hides the information about the disks from the user. The operating system also provides a system call for file management. The system call for file management includes – File creation File deletion Read and Write operations Files are stored in a directory. System calls provide to put a file in a directory or to remove a file from a directory. Files in the system are protected to maintain the privacy of the user. Below shows the Hierarchical File Structure directory. ABINAYA.R / AP / CSE / SRIT
ABINAYA.R / AP / CSE / SRIT
Command Interpreter : There are several ways for users to interface with the operating system. One of the approaches to user interaction with the operating system is through commands. Command interpreter provides a command-line interface. It allows the user to enter a command on the command line prompt ( cmd ). The command interpreter accepts and executes the commands entered by a user. For example, a shell is a command interpreter under UNIX. The commands to be executed are implemented in two ways: The command interpreter itself contains code to be executed. The command is implemented through a system file. The necessary system file is loaded into memory and executed. ABINAYA.R / AP / CSE / SRIT
System Calls : System calls provide an interface to the services made by an operating system. The user interacts with the operating system programs through System calls. These calls are normally made available as library functions in high-level languages such as C, Java, Python etc. It provides a level of abstraction as the user is not aware of the implementation or execution of the call made. Details of the operating system is hidden from the user. Different hardware and software services can be availed through system calls. System calls are available for the following operations: Process Management Memory Management File Operations Input / Output Operations ABINAYA.R / AP / CSE / SRIT
Signals : Signals are used in the operating systems to notify a process that a particular event has occurred. Signals are the software or hardware interrupts that suspend the current execution of the task. Signals are also used for inter-process communication. A signal follows the following pattern : A signal is generated by the occurrence of a particular event it can be the clicking of the mouse, the execution of the program successfully or an error notifying, etc. A generated signal is delivered to a process for further execution. Once delivered, the signal must be handled. A signal can be synchronous and asynchronous which is handled by a default handler or by the user-defined handler. The signal causes temporarily suspends the current task it was processing, saves its registers on the stack, and starts running a special signal handling procedure, where the signal is assigned to it. ABINAYA.R / AP / CSE / SRIT
Network Management : In today’s digital world, the complexity of networks and services has created modern challenges for IT professionals and users. Network management is a set of processes and procedures that help organizations to optimize their computer networks. Mainly, it ensures that users have the best possible experience while using network applications and services. Network management is a fundamental concept of computer networks. Network Management Systems is a software application that provides network administrators with information on components in their networks. It ensures the quality of service and availability of network resources. It also examines the operations of a network, reconstructs its network configuration, modifies it for improving performance of tasks. ABINAYA.R / AP / CSE / SRIT
Security Management: The security mechanisms in an operating system ensure that authorized programs have access to resources, and unauthorized programs have no access to restricted resources. Security management refers to the various processes where the user changes the file, memory, CPU, and other hardware resources that should have authorization from the operating system. ABINAYA.R / AP / CSE / SRIT
I/O Device Management The I/O device management component is an I/O manager that hides the details of hardware devices and manages the main memory for devices using cache and spooling. This component provides a buffer cache and general device driver code that allows the system to manage the main memory and the hardware devices connected to it. It also provides and manages custom drivers for particular hardware devices. The purpose of the I/O system is to hide the details of hardware devices from the application programmer. An I/O device management component allows highly efficient resource utilization while minimizing errors and making programming easy on the entire range of devices available in their systems. ABINAYA.R / AP / CSE / SRIT
Secondary Storage Management : Broadly, the secondary storage area is any space, where data is stored permanently and the user can retrieve it easily. Your computer’s hard drive is the primary location for your files and programs. Other spaces, such as CD-ROM/DVD drives, flash memory cards, and networked devices, also provide secondary storage for data on the computer. The computer’s main memory (RAM) is a volatile storage device in which all programs reside, it provides only temporary storage space for performing tasks. Secondary storage refers to the media devices other than RAM (e.g. CDs, DVDs, or hard disks) that provide additional space for permanent storing of data and software programs which is also called non-volatile storage. ABINAYA.R / AP / CSE / SRIT
Main memory management : Main memory is a flexible and volatile type of storage device. It is a large sequence of bytes and addresses used to store volatile data. Main memory is also called Random Access Memory (RAM), which is the fastest computer storage available on PCs. It is costly and low in terms of storage as compared to secondary storage devices. Whenever computer programs are executed, it is temporarily stored in the main memory for execution. Later, the user can permanently store the data or program in the secondary storage device. ABINAYA.R / AP / CSE / SRIT
Following are the services provided by an operating system - Program execution Input/output devices File Management Error Detection and Response Communication Security and Protection Program creation Accounting ABINAYA.R / AP / CSE / SRIT
Program execution To execute a program , several tasks need to be performed. Both the instructions and data must be loaded into the main memory . In addition, input-output devices and files should be initialized, and other resources must be prepared. The Operating structures handle these kinds of tasks. Loads a program into memory. Executes the program. Handles program's execution. Provides a mechanism for process synchronization. Provides a mechanism for process communication. Provides a mechanism for deadlock handling. Input/output devices As there are numerous types of I/O devices within the computer system, and each I/O device calls for its own precise set of instructions for the operation.. An Operating System manages the communication between user and device drivers. I/O operation means read or write operation with any file or any specific I/O device. Operating system provides the access to the required I/O device when required. ABINAYA.R / AP / CSE / SRIT
File management Computers keep data and information on secondary storage devices like magnetic tape, magnetic disk, optical disk, etc. Each storage media has its capabilities like speed, capacity, data transfer rate, and data access methods. For file management, the operating system must know the types of different files and the characteristics of different storage devices. It has to offer the proportion and safety mechanism of documents additionally. Program needs to read a file or write a file. The operating system gives the permission to the program for operation on file. Permission varies from read-only, read-write, denied and so on. Operating System provides an interface to the user to create/delete files. Operating System provides an interface to the user to create/delete directories. Operating System provides an interface to create the backup of file system. ABINAYA.R / AP / CSE / SRIT
Communication The operating system manages the exchange of data and programs among different computers connected over a network. This communication is accomplished using message passing and shared memory. Error Detection and Response Errors can occur anytime and anywhere. An error may occur in CPU , in I/O devices or in the memory hardware . Following are the major activities of an operating system with respect to error handling − The OS constantly checks for possible errors. The OS takes an appropriate action to ensure correct and consistent computing. ABINAYA.R / AP / CSE / SRIT
Program Creation The Operating system offers the structures and tools, including editors and debuggers, to help the programmer create, modify, and debugging programs. ABINAYA.R / AP / CSE / SRIT
Security and Protection Operating device affords safety to the statistics and packages of a person and protects any interference from unauthorized users. The safety feature counters threats, which are published via way of individuals out of doors the manage of the running device. The OS ensures that all access to system resources is controlled. The OS ensures that external I/O devices are protected from invalid access attempts. The OS provides authentication features for each user by means of passwords. ABINAYA.R / AP / CSE / SRIT
What is a System Call? A system call is a method for a computer program to request a service from the kernel of the operating system on which it is running. A system call is a method of interacting with the operating system via programs. A system call is a request from computer software to an operating system's kernel. The Application Program Interface (API) connects the operating system's functions to user programs. It acts as a link between the operating system and a process, allowing user-level programs to request operating system services. The kernel system can only be accessed using system calls. System calls are required for any programs that use resources. ABINAYA.R / AP / CSE / SRIT
Types of System Calls System calls can be grouped roughly into six major categories: process control , file manipulation , device manipulation , information maintenance , communications , and protection A running program needs to be able to halt its execution either normally ( end() ) or abnormally ( abort() ). If a system call is made to terminate the currently running program abnormally, or if the program runs into a problem and causes an error trap, a dump of memory is sometimes taken and an error message generated. The dump is written to disk and may be examined by a debugger —a system program designed to aid the programmer in finding and correcting errors, or bugs —to determine the cause of the problem. Under either normal or abnormal circumstances, the operating system must transfer control to the invoking command interpreter. The command interpreter then reads the next command. In an interactive system, the command interpreter simply continues with the next command; it is assumed that the user will issue an appropriate command to respond to any error. In a GUI system, a pop-up window might alert the user to the error and ask for guidance. In a batch system, the command interpreter usually terminates the entire job and continues with the next job. Some systems may allow for special recovery actions in case an error occurs. If the program discovers an error in its input and wants to terminate abnormally, it may also want to define an error level. More severe errors can be indicated by a higher-level error parameter. It is then possible to combine normal and abnormal termination by defining a normal termination as an error at level 0. The command interpreter or a following program can use this error level to determine the next action automatically. ABINAYA.R / AP / CSE / SRIT
Process control ◦ end, abort ◦ load, execute ◦ create process, terminate process ◦ get process attributes, set process attributes ◦ wait for time ◦ wait event, signal event ◦ allocate and free memory • File management ◦ create file, delete file ◦ open, close ◦ read, write, reposition ◦ get file attributes, set file attributes • Device management ◦ request device, release device ◦ read, write, reposition ◦ get device attributes, set device attributes ◦ logically attach or detach devices • Information maintenance ◦ get time or date, set time or date ◦ get system data, set system data ◦ get process, file, or device attributes ◦ set process, file, or device attributes • Communications ◦ create, delete communication connection ◦ send, receive messages ◦ transfer status information ◦ attach or detach remote devices ABINAYA.R / AP / CSE / SRIT
Process Windows Unix Process Control CreateProcess() ExitProcess() WaitForSingleObject() Fork() Exit() Wait() File Manipulation CreateFile () ReadFile () WriteFile () CloseHandle () Open() Read() Write() Close() Device Management SetConsoleMode() ReadConsole() WriteConsole() Ioctl () Read() Write() Information Maintenance GetCurrentProcessID() SetTimer() Sleep() Getpid() Alarm() Sleep() Communication CreatePipe() CreateFileMapping() MapViewOfFile() Pipe() Shmget() Mmap() Protection SetFileSecurity () InitializeSecurityDescriptor () SetSecurityDescriptorgroup () Chmod () Umask () Chown () ABINAYA.R / AP / CSE / SRIT
S ystem programs In an operating system a user is able to use different types of system programs and the system program is responsible for all the application software performance of the computer. The system programs are responsible for the development and execution of a program and they can be used by the help of system calls because system calls define different types of system programs for different tasks. ABINAYA.R / AP / CSE / SRIT
Types of System programs The types of system programs are as follows − Utility program It manages, maintains and controls various computer resources. Utility programs are comparatively technical and are targeted for the users with solid technical knowledge. Few examples of utility programs are: antivirus software, backup software and disk tools. Device drivers It controls the particular device connected to a computer system. Device drivers basically act as a translator between the operating system and device connected to the system. Example − printer driver, scanner driver, storage device driver etc. Directory reporting tools These tools are required in an operation system to have some software to facilitate the navigation through the computer system. Example − dir , ls, Windows Explorer etc. ABINAYA.R / AP / CSE / SRIT
OS Generation The First Generation ( 1945 - 1955 ): Vacuum Tubes and Plugboards Digital computers were not constructed until the second world war. Calculating engines with mechanical relays were built at that time. However, the mechanical relays were very slow and were later replaced with vacuum tubes. These machines were enormous but were still very slow. These early computers were designed, built and maintained by a single group of people. Programming languages were unknown and there were no operating systems so all the programming was done in machine language. All the problems were simple numerical calculations. By the 1950’s punch cards were introduced and this improved the computer system. Instead of using plugboards, programs were written on cards and read into the system. The Second Generation ( 1955 - 1965 ): Transistors and Batch Systems Transistors led to the development of the computer systems that could be manufactured and sold to paying customers. These machines were known as mainframes and were locked in air-conditioned computer rooms with staff to operate them. The Batch System was introduced to reduce the wasted time in the computer. A tray full of jobs was collected in the input room and read into the magnetic tape. After that, the tape was rewound and mounted on a tape drive. Then the batch operating system was loaded in which read the first job from the tape and ran it. The output was written on the second tape. After the whole batch was done, the input and output tapes were removed and the output tape was printed. ABINAYA.R / AP / CSE / SRIT
The Third Generation ( 1965 - 1980 ): Integrated Circuits and Multiprogramming Until the 1960’s, there were two types of computer systems i.e the scientific and the commercial computers. These were combined by IBM in the System/360. This used integrated circuits and provided a major price and performance advantage over the second generation systems. The third generation operating systems also introduced multiprogramming. This meant that the processor was not idle while a job was completing its I/O operation. Another job was scheduled on the processor so that its time would not be wasted. The Fourth Generation ( 1980 - Present ): Personal Computers Personal Computers were easy to create with the development of large-scale integrated circuits. These were chips containing thousands of transistors on a square centimeter of silicon. Because of these, microcomputers were much cheaper than minicomputers and that made it possible for a single individual to own one of them. The advent of personal computers also led to the growth of networks. This created network operating systems and distributed operating systems. The users were aware of a network while using a network operating system and could log in to remote machines and copy files from one machine to another. ABINAYA.R / AP / CSE / SRIT
Booting in Operating System Booting is the process of starting a computer. It can be initiated by hardware such as a button press or by a software command. After it is switched on, a CPU has no software in its main memory, so some processes must load software into memory before execution. This may be done by hardware or firmware in the CPU or by a separate processor in the computer system. Restarting a computer also is called rebooting, which can be " hard ", e.g., after electrical power to the CPU is switched from off to on, or " soft ", where the power is not cut. On some systems, a soft boot may optionally clear RAM to zero. Hard and soft booting can be initiated by hardware such as a button press or a software command. Booting is complete when the operative runtime system, typically the operating system and some applications, is attained. ABINAYA.R / AP / CSE / SRIT
ABINAYA.R / AP / CSE / SRIT
Cold Booting: When the computer starts for the first time or is in a shut-down state and switch on the power button to start the system, this type of process to start the computer is called cold booting. During cold booting, the system will read all the instructions from the ROM (BIOS) and the Operating System will be automatically get loaded into the system. This booting takes more time than Hot or Warm Booting. Warm Booting: Warm or Hot Booting process is when computer systems come to no response or hang state, and then the system is allowed to restart during on condition. It is also referred to as rebooting. There are many reasons for this state, and the only solution is to reboot the computer. Rebooting may be required when we install new software or hardware. The system requires a reboot to set software or hardware configuration changes, or sometimes systems may behave abnormally or may not respond properly. In such a case, the system has to be a force restart. Most commonly Ctrl+Alt+Del button is used to reboot the system. Else, in some systems, the external reset button may be available to reboot the system. ABINAYA.R / AP / CSE / SRIT
Booting Process in Operating System When our computer is switched on, it can be started by hardware such as a button press, or by software command, a computer's central processing unit (CPU) has no software in its main memory, there is some process which must load software into main memory before it can be executed. Below are the six steps to describe the boot process in the operating system, such as: ABINAYA.R / AP / CSE / SRIT