Unit-1
Unit-1
Processor I/O
Modules
Memory System
Bus
Processor
Referred to as
the Central
Processing Unit
(CPU)
Memory is device
that is used to
store
data/information
• Volatile • Non-Volatile
• RAM & ROM • HDD, CD &
DVD
Exercis Give the difference between primary memory and secondary
e memory.
I/O Module (Input/Output Module)
• Input/output module is a device that acts as the connective bridge between a computer system
at one end and an I/O or peripheral device at the other, such as a printer, webcam or scanner.
Examples
of
Operating
System
Where OS lies? (Interaction of OS & Hardware)
1. Kernel Mode
• has complete access to all the hardware
User
• can execute any instruction that a machine is capable Mode
of executing Software User Program
User
Mode user-mode program
User Program performs trap instruction
Software
The disk controller will find the User has to check the status of
requested data in the disk and fetch it disk controller operation where
from disk to disk controller buffer. it has finished or not.
OS as Extended Machine
7+9–6*4/2
P P P P
= 2 2 3 4
3 4 1 2
4 1 0
OS as Resource Manager
• It is the job of OS to proper allocate these resources to the various applications so that:
• Deadlock are detected, resolved and avoided.
OS as Resource Manager
Main
Memory
Objectives / Goals of Operating System (OS)
Objectives / Goals of Operating System (OS)
Vacuum tubes
Plug board
Generations / History of OS (Second generation)
1. Program development
• It provides editors and debuggers to assist (help) the programmer in creating programs.
2. Program execution
• Following tasks need to be perform to execute a program:
• Instructions and data must be loaded into main memory.
• I/O devices and files must be initialized.
• The OS handles all these duties for the user.
Services / Functions / Tasks of Operating System (OS)
4. Memory management
• OS manages memory hierarchy.
• OS keeps the track of which part of memory area in use and free memory.
• It allocates memory to program when they need it.
• It de-allocate the memory when the program finish execution.
P1
P2
Services / Functions / Tasks of Operating System (OS)
6. Communication
• In multitasking environment, the processes need to communicate with each other and to exchange their information.
• Operating system performs the communication among various types of processes in the form of shared memory.
Services / Functions / Tasks of Operating System (OS)
8. Accounting
• Keeping a track of which users are using how much and what kinds of computer resources can be used for accounting or
simply for accumulating usage statistics.
• Usage statistics is used to reconfigure the system to improve computing services.
Services / Functions / Tasks of Operating System (OS)
Batch OS – processes routine jobs without any interactive user presents i.e. claim
processing in insurance
Timesharing – allows multiple remote users to run their jobs at once i.e.
querying a database, airline booking system
Types of Operating Systems (OS)
• A system call is a way for programs to interact with the operating system.
• A system call is a mechanism that provides the interface between a process and the operating system.
• A computer program makes a system call when it makes a request to the operating system's kernel.
• It is a programmatic method in which a computer program requests a service from the kernel
of the OS.
• System call provides the services of the operating system to the user programs via Application Program
Interface(API).
• System calls are the only entry points for the kernel system.
Types of system calls
• Process Control: This system calls perform the task of process creation, process termination, etc.
• Functions:
• End and abort
• Load and execute
• Create process and terminate process
• Wait and signed event
• Allocate and free memory
• File Management: File management system calls handle file manipulation jobs like creating a file, reading,
and writing, etc.
• Functions:
• Create a file
• Delete file
• Open and close file
• Read, write and reposition
• Get and set file attributes
Types of system calls
• Device Management: Device management does the job of device manipulation like reading from device
buffers, writing into device buffers, etc.
• Functions
• Request and release device
• Logically attach/ detach devices
• Get and Set device attributes
• Information Maintenance: It handles information and its transfer between the OS and user program.
• Functions:
• Get or set time and date
• Get process and device attributes
Types of system calls
• Communication: These types of system calls are specially used for interprocess communications (IPC).
• Functions:
• Create, delete communications connections
• Send, receive message
• Help OS to transfer status information
• Attach or detach remote devices
Example of system calls (Read system call)
Kernel Dispatc
7 8 Sys
call
space h
handler
Steps involved in making a system call (Read system call)
1. Monolithic systems
2. Layered systems
3. Microkernel
4. Client-server model
5. Virtual machines
I. VM/370
II. Virtual machines rediscovered
III. The java virtual machine
6. Exokernels
Monolithic systems
• A virtual machine (VM) is a virtual environment that functions as a virtual computer system with its
own CPU, memory, network interface, and storage, created on a physical hardware system.
• The initial releases of OS/360 were strictly batch systems.
• But many users wanted to be able to work interactively at a terminal, so OS designers decided to write
timesharing systems for it.
• Types of Virtual machines are:
• VM/370
• Virtual Machines Rediscovered
• The Java Virtual Machine
VM/370
• Virtual machine monitor run on the bare hardware and does the multiprogramming.
• Each virtual machine is identical to the true hardware; each one can run any OS (may be different) that
will run directly on the bare hardware.
• On VM/370, some run OS/360 while the others run single user interactive system called CMS
(Conversational Monitor System) for interactive time sharing users.
VM/370
• When CMS program executed a system call, a call was trapped to the operating system in its own virtual
machine, not on VM/370.
• CMS then issued the normal hardware I/O instruction for reading its virtual disk or whatever was needed to
carry out the call.
Virtual Machines Rediscovered
• Companies can run their mail servers, web servers, FTP servers and other servers on the same machine
without having a crash of one server bring down the rest.
• Web hosting company offers virtual machines for rent, where a single physical machine can run many virtual
machines; each one appears to be a complete machine.
• Customers who rent a virtual machine can run any OS or software.
• A hypervisor, also known as a virtual machine monitor or VMM, is software that creates and runs virtual
machines (VMs).
Virtual Machines Rediscovered
• Another use of virtualization is for end users who want to be able to run two or more operating systems at
the same time, say Windows and Linux.
• Type 1 hypervisors runs on the bare hardware.
• Type 2 hypervisors run as application programs on top of Windows, Linux, or some other operating
system, known as the host operating system.
Java Virtual Machine
• In layered approach, the designer have choice where to draw the kernel and user mode boundary.
• It is better to put as little as possible in kernel mode because bugs in the kernel can bring down the system
instantly.
• The microkernel design provides high reliability by splitting OS up into small well defined modules,
only one module run in kernel and rest of all run in user mode.
• As each device driver runs as a user process, a bug in audio driver will cause the sound to be stop, but not crash
the computer.
• Examples: Integrity, K42, QNX, Symbian and MINIX 3.
• Kernel contains only
• Sys (Kernel call handler)
• Clock (because scheduler interact with it)
Exokernels
• Rather than cloning (copying) the actual machine, another strategy is partitioning it (giving each user a subset
of the resource).
• For example one virtual machine might get disk blocks 0 to 1023, the next one might get block 1024 to 2047, and so
on.
• Program running at the bottom layer (kernel mode) is called the exokernel.
• Its job is to allocate resources to virtual machines and then continuously check to make sure no machine is
trying to use somebody else’s resources.
• The advantage of the exokernel scheme is that it saves a layer of mapping.
• Exokernels are typically small in size because of their limited operability.
Multiprogramming v/s Multiprocessing v/s Multitasking
Multiprogramming v/s Multiprocessing v/s Multitasking