Unit 1
Unit 1
Unit 1
2. Operating system – controls and coordinates the use of the hardware among the various application
programs for the various users.
3. Applications programs – Define the ways in which the system resources are used to solve the
computing problems of the users (compilers, database systems, video games, business programs).
4. Users (people, machines, other computers).
A program that acts as an intermediary between a user of a computer and the computer hardware.
An operating System is a collection of system programs that together control the operations of a
computer system.
Some examples of operating systems are UNIX, Mach, MS-DOS, MS-Windows, Windows/NT,
Chicago, OS/2, MacOS, VMS, MVS, and VM.
(2)Shell is called the command interpreter. It is a set of programs used to interact with the
application programs. It is responsible for the execution of instructions given to OS (called
commands).
• Command-Interpreter System
Many commands are given to the operating system by control statements that 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
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 making it convenient for the users to run programs.
4. Communications
•The processes need to communicate with each other to exchange information during execution. It may
be between processes running on the same computer or running on different computers. Communication can
occur in two ways:
(i) shared memory or (ii) message passing
5. Error Detection
•An error in one part of the system may cause the malfunctioning of the complete system. To avoid such
a situation operating system constantly monitors the system for detecting errors. This relieves the user of the
worry of errors propagating to various parts of the system and causing malfunctioning.
Operating-System Structures
System Components
Operating System Services
System Calls
System Programs
System Structure
Virtual Machines
System Design and Implementation
System Generation
Advantages
Disadvantages
• Mainframes cannot be used as a normal computer, because they are made for specific task only.
• It requires a special OS to run.
• Are very expensive.
• Mainly used for commercial purposes like transaction processing.
• Cannot calculate or solve complex problems like a supercomputer.
Evolution of OS:
2. Batch Processing Operating System:
• 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.
3. Multiprogramming Operating System:
• This type of OS is used to execute more than one job simultaneously by a single processor. it increases
CPU utilization by organizing jobs so that the CPU always has one job 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.
4. Time-Sharing/multitasking Operating Systems
These systems use the concept of virtual memory for effective utilization of memory space. Hence, in this
OS, no jobs are discarded. Each one is executed using the virtual memory concept. It uses CPU
scheduling, memory management, disc management, and security management. Examples: CTSS,
MULTICS, CAL, UNIX etc.
The ability to continue providing service proportional to the level of surviving hardware is called
graceful degradation. Systems designed for graceful degradation are called fault tolerant.
5. Multiprocessor Operating Systems
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
shares the computer bus, the clock, and sometimes memory and peripheral devices. It
executes multiple jobs at th e same time and makes processing faster.
These systems include PCs running Microsoft Windows and the Apple Macintosh.
The MS-DOS operating system from Microsoft has been superseded by multiple
flavors of Microsoft Windows and IBM has upgraded MS-DOS to the OS/2
multitasking system.
The Apple Macintosh operating system has been ported to more advanced
hardware, and now includes new features such as virtual memory and
multitasking.
3. Real-Time Operating Systems (RTOS)
The real time operating system can be classified into two categories:
1. hard real time system and 2. soft real time system.
A hard real-time system guarantees that critical tasks be completed on time. This goal
requires that all delays in the system be bounded, from the retrieval of stored data to the
time that it takes the operating system to finish any request made of it. Such time
constraints dictate the facilities that are available in hard real-time systems.
A soft real-time system is a less restrictive type of real-time system. Here, a critical
real-time task gets
priority over other tasks and retains that priority until it completes. Soft real time system can
be mixed with other types of systems. Due to less restriction, they are risky to use for
industrial control and robotics.
System Call:
System calls provide an interface between the process and the operating system.
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
System calls allow user-level processes to request some services from the operating system which t h e 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 a particular
area, and this request is satisfied by the operating system.
• The following different types of system calls are provided by an operating system:
•
Process control
File management
Information Maintenance
Device management
Communications
Process control
• File management
create file, delete file
open, close
read, write, reposition
get file attributes, set file attributes
•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
• Device management
request device, release device
read, write, reposition
get device attributes, set device attributes
logically attach or detach devices
Examples of Windows and Unix system calls
• A structure of an Operating System determines how it has been designed and how it
functions.
• There are numerous ways of designing a new structure of an Operating system.
• In this organizational structure, the entire operating system runs as a single program in the
kernel mode.
• An operating system is a collection of various procedures linked together in a binary file.
• In this system, any procedure can call any other procedure. Since it is running in kernel
mode itself, it has all the permissions to call whatever it wants.
• For this purpose, the actual OS is constructed in a hierarchy. All the individual procedures
are compiled into a single executable file using the system linker.
• Even a monolithic system has a structure in which it can run in user mode.
• There is a basic structure:
1. The main procedure that invokes the requested service procedures.
2. A set of service procedures that carry out system calls.
3. A set of utility procedures that help out the system procedures.
Layered Systems Structure in Operating Systems
Layer Function
5 The operator
4 User Programs
3 Input/Output Management
2 Operator-process communication
1 Memory and drum management
0 Processor allocation and multiprogramming
Layer 0 ––
This layer deals with the allocation of the processor, switching between the processes when
interrupts occur or when the timers expire.
Sequential processes can be programmed individually without having to worry about other
processes running on the processor. That is, layer 0 provides the basic multiprogramming of the
CPU
Layer 1 –
This layer deals with allocating memory to the processes in the main memory. The drum is used
to hold parts of the processes (pages) for which space couldn’t be provided in the main memory.
The processes don’t have to worry if there is available memory or not as layer 1 software takes
care of adding pages wherever necessary.
Layer 2 –
In this layer, each process communicates with the operator (user) through the console. Each
process has its own operator console and can directly communicate with the operator.
Layer 3 –
This layer handles and manages all the I/O devices, and it buffers the information streams
that are made available to it. Each process can communicate directly with the abstract I/O
devices with all of its properties.
Layer 4 –
The programs used by the user are operated in this layer, and they don’t have to worry
about I/O management, operator/processes communication, memory management, or
processor allocation.
Layer 5 –
The system operator process is located in the outermost layer.
Microkernels system in an operating system
• Traditionally, all the layers of the OS in a layered system went into the kernel. So they all had
root access to the OS, and any small bug in any layer could be fatal to the OS.
• Famous examples of a microkernel system include Integrity, K42, PikeOS, Symbian, and
MINIX 3
• The primary purpose of this system is to provide high reliability. Because of the high
reliability that it provides, the applications of microkernels can be seen in real-time, industrial,
avionics (electronics fitted in aircraft and aviation), and military applications that are mission-
critical and require high reliability.
• The operating system is split into small, well-defined modules, of which only one, the
microkernel, runs in kernel mode.
• The rest of the modules run as powerless ordinary user processes. Running each device
driver and file system as separate user processes is a fail-safe method as a bug in one of
the drivers, will fail only that component.
• A bug easily references an invalid memory address and brings the system to a grinding
halt instantly.
THANK YOU