Operating System Introduction -Compiled for CSIT Ref: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc.
Content 1.1 Introduction Definition and Function, Two views of Operating System, Evolution/History and Types 1.2 System Calls
1.1: Introduction
What Is An Operating System? Lots of hardware !! One or more processors Main memory Disks Printers Various input/output devices Managing all these components requires a layer of software – the operating system
Where is the software? Where the operating system fits in.
Functions of operating system Process management Process creation, deletion, suspension and resumption Process synchronization and inter process communication Process interactions – deadlock detection, avoidance and correction Mutitasking Memory management Allocate and deallocate memory to process Manage multiple processes within the memory Manage the sharing of memory between processes Determine which processed to load when memory is available
Functions of operating system Storage Management Directory / File creation and deletion File system management File/directory manipulation Backup and achieve Free-space management Disk scheduling I/O management Device driver installation Device interface and management
Functions of operating system Protection and security File attribute for accidental modification Provides policy for user Authentication Data encryption Firewall Networking Provides different sets of protocols that are used for secure networking TCP/IP, FTP, POP, SMTP Interface CUI GUI Interactive
Two Views of OS OS as Extended Machine OS as Resource Manager
The Operating System as an Extended Machine
The Operating System as a Resource Manager Allow multiple programs to run at the same time Manage and protect memory, I/O devices, and other resources Multiplexes (shares) resources in two different ways: In time In space
History of Operating Systems Generations: (1945–55) Vacuum Tubes (1955–65) Transistors and Batch Systems (1965–1980) ICs and Multiprogramming (1980–Present) Personal Computers, Tablets, Phones
Transistors and Batch Systems (1) Figure 1-3. An early batch system. (a) Programmers bring cards to 1401. (b)1401 reads batch of jobs onto tape.
Transistors and Batch Systems (2) Figure 1-3. (c) Operator carries input tape to 7094. (d) 7094 does computing. (e) Operator carries output tape to 1401. (f) 1401 prints output.
ICs and Multiprogramming MULTICS Timesharing CTSS (MIT) Multics UNix Figure 1-5. A multiprogramming system with three jobs in memory.
More third generation . Time Sharing (CTSS) Multics Unix Linux MULTICS Timesharing CTSS (MIT) Multics UNix .
Fourth generation . PCs Network Operating Systems Distributed Operating Systems MULTICS Timesharing CTSS (MIT) Multics UNix .
The Operating System Types Mainframe operating systems Big-thousands of disks…. Lots of jobs with lots of I/O Services-batch (payroll) transactions (airline reservations, timesharing (query database) Elderly-Unix, Linux replacing them
The Operating System Types:
The Operating System Types: Batch operating systems The users of a batch operating system do not interact with the computer directly. Each user prepares his job on an off-line device like punch cards and submits it to the computer operator. To speed up processing, jobs with similar needs are batched together and run as a group. Disadvantage: Lack of interaction between the user and the job. CPU is often idle, because the speed of the mechanical I/O devices is slower than the CPU. Difficult to provide the desired priority.
The Operating System Types: Server operating systems Workstations File, print, web servers BSD, Linux, Windows Multiprocessor operating systems Use multiple cores
The Operating System Types: PC operating systems-Linux, Mac, Windows Smart phone operating systems- Android, iPhone, Blackberry No hard disk Palm, Symbian popular OS’s Multiprogramming OS Run multiple program on single core Advantage: Reduce CPU idle time and utilize it Disadvantage: Question of security and integrity of user programs and data.
The Operating System Types: Real-Time OS- 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 response time. Types: Hard real-time: Guarantee that critical tasks complete on time. Secondary storage is limited or missing with data stored in ROM. Virtual memory is almost never found.
The Operating System Types: Soft real-time: Soft real time systems are less restrictive. Have limited utility than hard real-time systems. Example: Multimedia, virtual reality, Advanced Scientific Projects like undersea exploration and planetary rovers etc.
The Operating System Types: Embedded Operating System An operating system for embedded computer systems. Typically designed to be resource-efficient and reliable. Resource efficiency comes at the cost of losing some functionality or granularity that larger computer operating systems provide, including functions which may not be used by the specialized applications they run. The hardware running an embedded operating system can be very limited in resources such as RAM and ROM In order to take better advantage of the processing power of the CPU, software developers may write critical code directly in assembly. Often times, embedded operating systems are written entirely in more portable languages, like C. Unlike a desktop operating system, the embedded operating system does not load and execute applications. This means that the system is only able to run a single application.
The Operating System Types: Smart Card Operating System OS designed for smart card Every smart card has an operating system. The OS is the hardware-specific firmware that provides basic functionality as secure access to on-card storage, authentication and encryption. Some cards allow writing programs that are loaded onto the smart card – just like programs on a computer. Example: Javacard OS, MultOS(Multi-application OS)
Operating Systems Structure Monolithic systems A main program that invokes the requested service procedure. A set of service procedures that carry out the system calls. A set of utility procedures that help the service procedures.
Monolithic Systems
Easy for error detection Layered Systems-THE operating system Components are organized and module are layered them from one top to next Module are not free to communicate directly without maintaining hierarchy Easy for error detection
Layered Systems-THE operating system Dijkstra’s the author
Layered Systems
Microkernels
Microkernels Small number of processes are allowed in the kernel Minimizes effects of bugs Don’t want bug in driver to crash system Put mechanism in kernel and policy outside the kernel Mechanism- schedule processes by priority scheduling algorithm Policy-assign process priorities in user space
Microkernels Structure of the MINIX 3 system.
Microkernels
Client-Server Model Divide operating kernel into several process I/O server, memory server, thread interface server, print server etc Servers run in user mode provide service when client demands
Client-Server Model The client-server model over a network.
Virtual Machines (1) The structure of VM/370 with CMS.
Virtual Machines (2) (a) A type 1 hypervisor. (b) A type 2 hypervisor.
1.2: System Call
What is System Call A system call is the programmatic way in which a computer program requests a service from the kernel of the operating system it is executed on. A system call is a way for programs to interact with the operating system. A computer program makes a system call when it makes a request to the operating system’s kernel. System call provides the services of the operating system to the user programs via Application Program Interface(API). It provides an interface between a process and operating system to allow user-level processes to request services of the operating system. System calls are the only entry points into the kernel system. All programs needing resources must use system calls.
Kernel mode and User Mode Every modern OS supports Kernel Mode and User Mode
Kernel Mode When CPU is in kernel mode, the code being executed can access any memory address and any hardware resource. Hence kernel mode is a very privileged and powerful mode. If a program crashes in kernel mode, the entire system will be halted.
User Mode When CPU is in user mode, the programs don't have direct access to memory and hardware resources. In user mode, if any program crashes, only that particular program is halted. That means the system will be in a safe state even if a program in user mode crashes. Hence, most programs in an OS run in user mode.
Service Provided By System Calls Process creation and management Main memory management File Access, Directory and File system management Device handling(I/O) Protection Networking, etc.
Types: Process control: end, abort, create, terminate, allocate and free memory. File management: create, open, close, delete, read file etc. Device management Information maintenance Communication
Examples of windows and unix system call