OS-I Unit
OS-I Unit
2. Second Generation
Introduction:
1. 1959-1965 is the period of second-generation computer.
2. 3.Second generation computers were based on Transistor instead of
vacuum tubes.
Few Examples are:
1. Honeywell 400
2. IBM 7094
3. CDC 1604
4. CDC 3600
5. UNIVAC 1108
Advantages:
1. Due to the presence of transistors instead of vacuum tubes, the size of
electron component decreased. This resulted in reducing the size of a
computer as compared to first generation computers.
2. Less energy and not produce as much heat as the first genration.
3. Assembly language and punch cards were used for input.
4. Low cost than first generation computers.
5. Better speed, calculate data in microseconds.
6. Better portability as compared to first generation
Disadvantages:
1. A cooling system was required.
2. Constant maintenance was required.
3. Only used for specific purposes.
3. Third Generation
Introduction:
1. 1965-1971 is the period of third generation computer.
2. These computers were based on Integrated circuits.
3. IC was invented by Robert Noyce and Jack Kilby In 1958-1959.
4. IC was a single component containing number of transistors.
Few Examples are:
1. PDP-8
2. PDP-11
3. ICL 2900
4. IBM 360
5. IBM 370
Advantages:
1. These computers were cheaper as compared to second-generation
computers.
2. They were fast and reliable.
3. Use of IC in the computer provides the small size of the computer.
4. IC not only reduce the size of the computer but it also improves the
performance of the computer as compared to previous computers.
5. This generation of computers has big storage capacity.
6. Instead of punch cards, mouse and keyboard are used for input.
7. They used an operating system for better resource management and used
the concept of time-sharing and multiple programming.
8. These computers reduce the computational time from microseconds to
nanoseconds.
Disadvantages:
1. IC chips are difficult to maintain.
2. The highly sophisticated technology required for the manufacturing of IC
chips.
3. Air conditioning is required.
4. Fourth Generation
Introduction:
1. 1971-1980 is the period of fourth generation computer.
2. This technology is based on Microprocessor.
3. A microprocessor is used in a computer for any logical and arithmetic
function to be performed in any program.
4. Graphics User Interface (GUI) technology was exploited to offer more
comfort to users.
Few Examples are:
1. IBM 4341
2. DEC 10
3. STAR 1000
4. PUP 11
Advantages:
1. Fastest in computation and size get reduced as compared to the previous
generation of computer.
2. Heat generated is negligible.
3. Small in size as compared to previous generation computers.
4. Less maintenance is required.
5. All types of high-level language can be used in this type of computers.
Disadvantages:
1. The Microprocessor design and fabrication are very complex.
2. Air conditioning is required in many cases due to the presence of ICs.
3. Advance technology is required to make the ICs.
5. Fifth Generation
Introduction:
1. The period of the fifth generation in 1980-onwards.
2. This generation is based on artificial intelligence.
3. The aim of the fifth generation is to make a device which could respond to
natural language input and are capable of learning and self-organization.
4. This generation is based on ULSI(Ultra Large Scale Integration)
technology resulting in the production of microprocessor chips having ten
million electronic component.
Few Examples are:
1. Desktop
2. Laptop
3. NoteBook
4. UltraBook
5. Chromebook
Advantages:
1. It is more reliable and works faster.
2. It is available in different sizes and unique features.
3. It provides computers with more user-friendly interfaces with multimedia
features.
Disadvantages:
1. They need very low-level languages.
2. They may make the human brains dull and doomed.
GENERATION YEAR ELECTRONIC DEVICE USED TYPES OF OS DEVICE
1. Client-Server Systems
Centralized systems today act as server systems to satisfy requests generated by client
systems. The general structure of a client-server system is depicted in the figure below:
Server Systems can be broadly categorized as: Compute Servers and File Servers.
Compute Server systems, provide an interface to which clients can send requests to
perform an action, in response to which they execute the action and send back results to
the client.
File Server systems, provide a file-system interface where clients can create, update,
read, and delete files.
2. Peer-to-Peer Systems
The growth of computer networks - especially the Internet and World Wide Web (WWW) – has
had a profound influence on the recent development of operating systems. When PCs were
introduced in the 1970s, they were designed for personal use and were generally considered
standalone computers. With the beginning of widespread public use of the Internet in the 1990s
for electronic mail and FTP, many PCs became connected to computer networks.
In contrast to the Tightly Coupled systems, the computer networks used in these applications
consist of a collection of processors that do not share memory or a clock. Instead, each processor
has its own local memory. The processors communicate with one another through various
communication lines, such as high-speed buses or telephone lines. These systems are usually
referred to as loosely coupled systems ( or distributed systems). The general structure of a client-
server system is depicted in the figure below:
Advantages of Distributed Operating System:
Failure of one will not affect the other network communication, as all systems are
independent from each other
Electronic mail increases the data exchange speed
Since resources are being shared, computation is highly fast and durable
Load on host computer reduces
These systems are easily scalable as many systems can be easily added to the network
Delay in data processing reduces
Disadvantages of Distributed Operating System:
Failure of the main network will stop the entire communication
To establish distributed systems the language which are used are not well defined yet
These types of systems are not readily available as they are very expensive. Not only that
the underlying software is highly complex and not understood well yet
Examples of Distributed Operating System are- LOCUS etc.
4. Network Operating System:
These systems run on a server and provide the capability to manage data, users, groups,
security, applications, and other networking functions. These type of operating systems
allow shared access of files, printers, security, applications, and other networking
functions over a small private network. One more important aspect of Network Operating
Systems is that all the users are well aware of the underlying configuration, of all other
users within the network, their individual connections etc. and that’s why these
computers are popularly known as tightly coupled systems.
Advantages of Network Operating System:
Highly stable centralized servers
Security concerns are handled through servers
New technologies and hardware up-gradation are easily integrated to the system
Server access are possible remotely from different locations and types of systems
Disadvantages of Network Operating System:
Servers are costly
User has to depend on central location for most operations
Maintenance and updates are required regularly
Examples of Network Operating System are: Microsoft Windows Server 2003, Microsoft
Windows Server 2008, UNIX, Linux, Mac OS X, Novell NetWare, and BSD etc.
There are many types of operating system exists in the current scenario:
5. Real-Time Operating System:
These types of OSs serves the real-time systems. The time interval required to process and
respond to inputs is very small. This time interval is called response time. In Real Time systems,
each job carries a certain deadline within which the Job is supposed to be completed, otherwise
the huge loss will be there or even if the result is produced then it will be completely useless.
Real-time systems are used when there are time requirements are very strict like missile systems
(if you want to drop a missile then the missile is supposed to be dropped with certain precision),
air traffic control systems, robots etc.
Two types of Real-Time Operating System which are as follows:
Hard Real-Time Systems:
These OSs are meant for the applications where time constraints are very strict and even
the shortest possible delay is not acceptable. These systems are built for saving life like
automatic parachutes or air bags which are required to be readily available in case of
any accident. Virtual memory is almost never found in these systems.
Soft Real-Time Systems:
These OSs are for applications where for time-constraint is less strict.
The BSP provides a common application programming interface (API) and a stable environment
for the real-time operating system.
Advantages of RTOS:
Maximum Consumption: Maximum utilization of devices and system, thus more output
from all the resources
Task Shifting: Time assigned for shifting tasks in these systems are very less. For
example in older systems it takes about 10 micro seconds in shifting one task to another
and in latest systems it takes 3 micro seconds.
Focus on Application: Focus on running applications and less importance to
applications which are in queue.
Real time operating system in embedded system: Since size of programs are small,
RTOS can also be used in embedded systems like in transport and others.
Error Free: These types of systems are error free.
Memory Allocation: Memory allocation is best managed in these type of systems.
Disadvantages of RTOS:
Limited Tasks: Very few tasks run at the same time and their concentration is very less
on few applications to avoid errors.
Use heavy system resources: Sometimes the system resources are not so good and they
are expensive as well.
Complex Algorithms: The algorithms are very complex and difficult for the designer to
write on.
Device driver and interrupt signals: It needs specific device drivers and interrupt
signals to response earliest to interrupts.
Thread Priority: It is not good to set thread priority as these systems are very less prone
to switching tasks.
Examples of Real-Time Operating Systems are: Scientific experiments, medical imaging
systems, industrial control systems, weapon systems, robots, air traffic control systems, etc.
6. Mobile OS
Mobile operating systems are those OS which is especially that are designed to power
smartphones, tablets, and wearables devices. Some most famous mobile operating systems are
Android and iOS, but others include BlackBerry, Web, and watchOS.
7. Multiprogramming Operating System
Multiprogramming is an extension to the batch processing where the CPU is kept always busy.
Each process needs two types of system time: CPU time and IO time.
In multiprogramming environment, for the time a process does its I/O, The CPU can start the
execution of other processes. Therefore, multiprogramming improves the efficiency of the
system.
8. Multiprocessing Operating System
In Multiprocessing, Parallel computing is achieved. It consists of several processors that share a
common physical memory. in the system which can execute more than one process at the same
time. This will increase the throughput of the system. This system provides higher computing
power and speed. In multiprocessor system all processors operate under single operating system.
Multiplicity of the processors and how they do act together are transparent to the others.
Advantages of Multiprocessor Systems
1. Enhanced performance
2. Execution of several tasks by different processors concurrently, increases the system's
throughput without speeding up the execution of a single task.
3. If possible, system divides task into many subtasks and then these subtasks can be
executed in parallel in different processors. Thereby speeding up the execution of single
tasks.
9. Desktop Systems
Earlier, CPUs and PCs lacked the features needed to protect an operating system from user
programs. PC operating systems therefore were neither multiuser nor multitasking. However,
the goals of these operating systems have changed with time; instead of maximizing CPU and
peripheral utilization, the systems opt for maximizing user convenience and responsiveness.
These systems are called Desktop Systems and include PCs running Microsoft Windows and
the Apple Macintosh. Operating systems for these computers have benefited in several ways
from the development of operating systems for mainframes.
Microcomputers were immediately able to adopt some of the technology developed for larger
operating systems. On the other hand, the hardware costs for microcomputers are
sufficiently low that individuals have sole use of the computer, and CPU utilization is no longer
a prime concern. Thus, some of the design decisions made in operating systems for mainframes
may not be appropriate for smaller systems.
10. Clustered Systems
Like parallel systems, clustered systems gather together multiple CPUs to accomplish
computational work.
Clustered systems differ from parallel systems, however, in that they are composed of
two or more individual systems coupled together.
The definition of the term clustered is not concrete; the general accepted definition is
that clustered computers share storage and are closely linked via LAN networking.
Clustering is usually performed to provide high availability.
A layer of cluster software runs on the cluster nodes. Each node can monitor one or more
of the others. If the monitored machine fails, the monitoring machine can take ownership
of its storage, and restart the application(s) that were running on the failed machine. The
failed machine can remain down, but the users and clients of the application would only
see a brief interruption of service.
Asymmetric Clustering - In this, one machine is in hot standby mode while the other is
running the applications. The hot standby host (machine) does nothing but monitor the
active server. If that server fails, the hot standby host becomes the active server.
Symmetric Clustering - In this, two or more hosts are running applications, and they are
monitoring each other. This mode is obviously more efficient, as it uses all of the
available hardware.
Parallel Clustering - Parallel clusters allow multiple hosts to access the same data on the
shared storage. Because most operating systems lack support for this simultaneous data
access by multiple hosts, parallel clusters are usually accomplished by special versions of
software and special releases of applications.
Clustered technology is rapidly changing. Clustered system's usage and it's features should
expand greatly as Storage Area Networks(SANs). SANs allow easy attachment of multiple
hosts to multiple storage units. Current clusters are usually limited to two or four hosts due to the
complexity of connecting the hosts to shared storage.
Microcomputers were immediately able to adopt some of the technology developed for larger
operating systems. On the other hand, the hardware costs for microcomputers are
sufficiently low that individuals have sole use of the computer, and CPU utilization is no longer
a prime concern. Thus, some of the design decisions made in operating systems for mainframes
may not be appropriate for smaller systems.
11. Handheld Systems
Handheld systems include Personal Digital Assistants(PDAs), such as Palm-Pilots or Cellular
Telephones with connectivity to a network such as the Internet. They are usually of limited size
due to which most handheld devices have a small amount of memory, include slow processors,
and feature small display screens.
Many handheld devices have between 512 KB and 8 MB of memory. As a result, the
operating system and applications must manage memory efficiently. This includes
returning all allocated memory back to the memory manager once the memory is no
longer being used.
Currently, many handheld devices do not use virtual memory techniques, thus forcing
program developers to work within the confines of limited physical memory.
Processors for most handheld devices often run at a fraction of the speed of a processor in
a PC. Faster processors require more power. To include a faster processor in a handheld
device would require a larger battery that would have to be replaced more frequently.
The last issue confronting program designers for handheld devices is the small display
screens typically available. One approach for displaying the content in web pages is web
clipping, where only a small subset of a web page is delivered and displayed on the
handheld device.
Some handheld devices may use wireless technology such as BlueTooth, allowing remote access
to e-mail and web browsing. Cellular telephones with connectivity to the Internet fall into this
category. Their use continues to expand as network connections become more available and
other options such as cameras and MP3 players, expand their utility.
System Call
In computing, 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.
A figure representing the execution of the system call is given as follows
−
As can be seen from this diagram, the processes execute normally in the user mode until a
system call interrupts this. Then the system call is executed on a priority basis in the kernel
mode. After the execution of the system call, the control returns to the user mode and execution
of user processes can be resumed.
Services Provided by System Calls:
An Operating System provides services to both the users and to the programs.
It provides programs an environment to execute.
It provides users the services to execute the programs in a convenient manner.
Following are a few common services provided by an operating system −
a. Program execution
b. I/O operations
c. File System manipulation
d. Communication
e. Error Detection
f. Resource Allocation
g. Protection
a. Program execution
Operating systems handle many kinds of activities from user programs to system
programs like printer spooler, name servers, file server, etc. Each of these activities is
encapsulated as a process.
A process includes the complete execution context (code to execute, data to manipulate,
registers, OS resources in use). Following are the major activities of an operating system
with respect to program management −
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.
b. I/O Operation
An I/O subsystem comprises of I/O devices and their corresponding driver software.
Drivers hide the peculiarities of specific hardware devices from the users.
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.
c. File system manipulation
A file represents a collection of related information. Computers can store files on the disk
(secondary storage), for long-term storage purpose. Examples of storage media include
magnetic tape, magnetic disk and optical disk drives like CD, DVD. Each of these media
has its own properties like speed, capacity, data transfer rate and data access methods.
A file system is normally organized into directories for easy navigation and usage. These
directories may contain files and other directions. Following are the major activities of an
operating system with respect to file management −
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.
d. Communication
In case of distributed systems which are a collection of processors that do not share memory,
peripheral devices, or a clock, the operating system manages communications between all the
processes. Multiple processes communicate with one another through communication lines in
the network.
The OS handles routing and connection strategies, and the problems of contention and
security. Following are the major activities of an operating system with respect to
communication −
Two processes often require data to be transferred between them
Both the processes can be on one computer or on different computers, but are connected
through a computer network.
Communication may be implemented by two methods, either by Shared Memory or by
Message Passing.
e. Error handling
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.
f. Resource Management
In case of multi-user or multi-tasking environment, resources such as main memory, CPU
cycles and files storage are to be allocated to each user or job. Following are the major
activities of an operating system with respect to resource management −
The OS manages all kinds of resources using schedulers.
CPU scheduling algorithms are used for better utilization of CPU.
g. Protection
Considering a computer system having multiple users and concurrent execution of multiple
processes, the various processes must be protected from each other's activities.
Protection refers to a mechanism or a way to control the access of programs, processes, or
users to the resources defined by a computer system. Following are the major activities of an
operating system with respect to protection −
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.
Types of System Calls: There are 5 different categories of system calls –
1. Process control: end, abort, create, terminate, allocate and free memory.
2. File management: create, open, close, delete, read file etc.
3. Device management: reading from device buffers, writing into device buffers etc.
4. Information maintenance: handle information and its transfer between the operating
system and the user program.
5. Communication: useful for interprocess communication and also deal with creating
and deleting a communication connection.
Examples of Windows and Unix System Calls –
WINDOWS UNIX
CreateProcess() fork()
ExitProcess() exit()
Process Control WaitForSingleObject() wait()
CreateFile() open()
ReadFile() read()
WriteFile() write()
File Manipulation CloseHandle() close()
SetConsoleMode() ioctl()
ReadConsole() read()
Device Manipulation WriteConsole() write()
CreatePipe() pipe()
CreateFileMapping() shmget()
Communication MapViewOfFile() mmap()
SetFileSecurity() chmod()
InitlializeSecurityDescriptor() umask()
Protection SetSecurityDescriptorGroup() chown()
There are many different system calls as shown above. Details of some of those system calls are
as follows −
open()
The open() system call is used to provide access to a file in a file system. This system call
allocates resources to the file and provides a handle that the process uses to refer to the file. A
file can be opened by multiple processes at the same time or be restricted to one process. It all
depends on the file organisation and file system.
read()
The read() system call is used to access data from a file that is stored in the file system. The file
to read can be identified by its file descriptor and it should be opened using open() before it can
be read. In general, the read() system calls takes three arguments i.e. the file descriptor, buffer
which stores read data and number of bytes to be read from the file.
write()
The write() system calls writes the data from a user buffer into a device such as a file. This
system call is one of the ways to output data from a program. In general, the write system calls
takes three arguments i.e. file descriptor, pointer to the buffer where data is stored and number of
bytes to write from the buffer.
close()
The close() system call is used to terminate access to a file system. Using this system call means
that the file is no longer required by the program and so the buffers are flushed, the file metadata
is updated and the file resources are de-allocated.
Structure of an OS:
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. Here, we will
learn about six combinations that have been tested and tried. These six combinations
are monolithic systems, layered systems, microkernels, client-server models, virtual
machines, and exokernels.
Note: Before we get started it’s important to understand what a kernel is.
When your computer is running in kernel mode, all the permissions are available (think
of it as an administrator).
In macOS, this is known as giving ‘root’ access. In Windows, you invoke this by running
applications as ‘administrator.’
If not the kernel mode, the computer normally runs in user mode, where a lot of
permissions are not given to the user that may damage the system files.
Simple Structure
If an application requires a service, the hardware address space of the
application switches to the hardware address space of the operating system
to execute it.
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.
In terms of information hiding, there is none. All procedures are running in kernel mode, so they
have access to all modules and packages of other procedures.
However, using this approach without any restrictions can lead to thousands of procedure calls,
and this can lead to a messy system. 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 already is a
basic structure given by the organization
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.
Simple Monolithic Operating Systems Example
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. In CP/M, the 16 bit
address space starts with system variables and the application area and ends with three parts of
the operating system, namely CCP (Console Command Processor), BDOS (Basic Disk Operating
System) and BIOS (Basic Input/Output System). In DOS, the 20 bit address space starts with the
array of interrupt vectors and the system variables, followed by the resident part of DOS and the
application area and ending with a memory block used by the video card and BIOS.
Most contemporary operating systems, including Linux and Windows, are also considered
monolithic, even though their structure is certainly significantly different from the simple
examples of CP/M and DOS.
When the application requests the OS services for a service, the OS services
communicate with each other to provide the required service to the
application. Here, the Inter Process Communication (IPC) helps to establish
this communication. Overall, microkernel-based OS provides a great level of
extensibility. It is also possible to customize the services of the operating
system depending on the requirements of the application.
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.
Working
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.
A Microkernel architecture
Example: MINIX 3
The MINIX 3 is an OS written in C with 3200 lines of code and about 800 lines of code
for the assembler to handle low-level functions like catching interrupts or switching
processes.
The C code handles managing and scheduling processes, handles interprocess
communication.
It also provides a set of 35 kernel calls to allow the rest of the operating system to do its
work. These calls perform functions like hooking handlers to interrupts, moving data
between address spaces, and installing new memory maps for newly created processes.
The process structure of MINIX 3 is divided into three parts above the kernel.
The lowest layer contains device drivers.
The middle layer includes servers.
Difference between Microkernel and Monolithic Kernel
Comparison Chart
BASIS FOR
MICROKERNEL MONOLITHIC KERNEL
COMPARISON
Working
There are six layers in the system, each with different purposes.
Layer Function
5 The operator
4 User Programs
3 Input/Output Management
2 Operator-process communication