OS Unit 1
OS Unit 1
Indore
RAJIV GANDHI PROUDYOGIKI VISHWAVIDYALAYA, BHOPAL
Operating System
New Scheme Based On AICTE Flexible Curricula
• Control program – controls the execution of user programs and operations of I/O devices.
(1) Kernel is an active part of an OS i.e. it is the part of OS running at all times. It is a programs
which can interact with the hardware. Ex: Device driver, dll files, system files etc.
(2) Shell is called as the command interpreter. It is a set of programs used to interact with the
application programs. It is responsible for execution of instructions given to OS (called
commands).
User View: The OS is designed for one user to monopolize its resources, to maximize the
work that the user is performing and for ease of use.
System View: An operating system is a control program that manages the execution of user
programs to prevent errors and improper use of the computer. It is concerned with the
operation and control of I/O devices.
• Process Management
• Main Memory Management
• File Management
• I/O System Management
• Secondary Management
• Networking
• Protection System
• Command-Interpreter System
The operating system is responsible for the following activities in connection with process
management.
✦ Process creation and deletion.
✦ process suspension and resumption.
✦ Provision of mechanisms for:
• process synchronization
• process communication
• Memory is a large array of words or bytes, each with its own address. It is a repository of
quickly accessible data shared by the CPU and I/O devices.
• Main memory is a volatile storage device. It loses its contents in the case of system
failure.
The operating system is responsible for the following activities in connections with
memory management:
• Keep track of which parts of memory are currently being used and by whom.
• Decide which processes to load when memory space becomes available.
• Allocate and de-allocate memory space as needed.
• The operating system is responsible for the following activities in connections with file
management:
✦ File creation and deletion.
✦ Directory creation and deletion.
✦ Support of primitives for manipulating files and directories.
✦ Mapping files onto secondary storage.
✦ File backup on stable (nonvolatile) storage media.
Since main memory (primary storage) is volatile and too small to accommodate all data and
programs permanently, the computer system must provide secondary storage to back up
main memory.
Most modern computer systems use disks as the principle on-line storage medium, for both
programs and data.
The operating system is responsible for the following activities in connection with disk
management:
✦ Free space management
✦ Storage allocation
✦ Disk scheduling
• Many commands are given to the operating system by control statements which deal with:
✦ process creation and management
✦ I/O handling
✦ secondary-storage management
✦ main-memory management
✦ file-system access
✦ protection
✦ networking
• The program that reads and interprets control statements is called variously:
✦ command-line interpreter
✦ shell (in UNIX)
• Its function is to get and execute the next command statement.
• This type of OS accepts more than one jobs, and these jobs are batched/ grouped together
according to their similar requirements. This is done by computer operator. Whenever the
computer becomes available, the batched jobs are sent for execution and gradually the
output is sent back to the user.
• It allowed only one program at a time.
• This OS is responsible for scheduling the jobs according to priority and the resource
required.
• This type of OS is used to execute more than one jobs simultaneously by a single processor. it increases
CPU utilization by organizing jobs so that the CPU always has one job to execute.
• The concept of multiprogramming is described as follows:
All the jobs that enter the system are stored in the job pool( in disc). The operating system loads a set of
jobs from job pool into main memory and begins to execute.
During execution, the job may have to wait for some task, such as an I/O operation, to complete.
In a multiprogramming system, the operating system simply switches to another job and executes.
When that job needs to wait, the CPU is switched to another job, and so on.
When the first job finishes waiting and it gets the CPU back.
As long as at least one job needs to execute, the CPU is never idle.
Multiprogramming operating systems use the mechanism of job scheduling and CPU scheduling.
• Multiprocessor operating systems are also known as parallel OS or tightly coupled OS.
Such operating systems have more than one processor in close communication that
sharing the computer bus, the clock and sometimes memory and peripheral devices. It
executes multiple jobs at same time and makes the processing faster.
• In distributed system, the different machines are connected in a network and each
machine has its own processor and own local memory.
• In this system, the operating systems on all the machines work together to manage the
collective network resource.
• It can be classified into two categories:
1. Client-Server systems
2. Peer-to-Peer systems
Resources Sharing
load sharing
Reliability
Communications
Requires networking infrastructure.
Local area networks (LAN) or Wide area networks (WAN)
• Following are the five services provided by operating systems to the convenience of the
users.
1. Program Execution
The purpose of computer systems is to allow the user to execute programs. So the operating
system provides an environment where the user can conveniently run programs. Running a
program involves the allocating and deallocating memory, CPU scheduling in case of
multiprocessing.
2. I/O Operations
Each program requires an input and produces output. This involves the use of I/O. So the
operating systems are providing I/O makes it convenient for the users to run programs.
• System calls provide an interface between the process and the operating system.
• System calls allow user-level processes to request some services from the operating
system which process itself is not allowed to do.
• For example, for I/O a process involves a system call telling the operating system to read
or write particular area and this request is satisfied by the operating system.
Booting the system is done by loading the kernel into main memory, and starting its
execution.
• The CPU is given a reset event, and the instruction register is loaded with a predefined
memory location, where execution starts.
• The initial bootstrap program is found in the BIOS read-only memory.
• This program can run diagnostics, initialize all components of the system, loads and starts
the Operating System loader. (Called boot strapping)
• The loader program loads and starts the operating system.
• When the Operating system starts, it sets up needed data structures in memory, sets
several registers in the CPU, and then creates and starts the first user level program. From
this point, the operating system only runs in response to interrupts.