OS M-1
OS M-1
Operating Systems have evolved over the years. So, their evolution
through the years can be mapped using generations of operating
systems. There are four generations of operating systems. These can
be described as follows −
The First Generation ( 1945 - 1955 ): Vacuum Tubes and
Plugboards
Digital computers were not constructed until the second world war.
Calculating engines with mechanical relays were built at that time.
However, the mechanical relays were very slow and were later
replaced with vacuum tubes. These machines were enormous but were
still very slow.
These early computers were designed, built and maintained by a single
group of people. Programming languages were unknown and there
were no operating systems so all the programming was done in
machine language. All the problems were simple numerical
calculations.
By the 1950’s punch cards were introduced and this improved the
computer system. Instead of using plugboards, programs were written
on cards and read into the system.
The Second Generation ( 1955 - 1965 ): Transistors and Batch
Systems
Transistors led to the development of the computer systems that could
be manufactured and sold to paying customers. These machines were
known as mainframes and were locked in air-conditioned computer
rooms with staff to operate them.
The Batch System was introduced to reduce the wasted time in the
computer. A tray full of jobs was collected in the input room and read
into the magnetic tape. After that, the tape was rewound and mounted
on a tape drive. Then the batch operating system was loaded in which
read the first job from the tape and ran it. The output was written on
the second tape. After the whole batch was done, the input and output
tapes were removed and the output tape was printed.
The Third Generation ( 1965 - 1980 ): Integrated Circuits and
Multiprogramming
Until the 1960’s, there were two types of computer systems i.e the
scientific and the commercial computers. These were combined by
IBM in the System/360. This used integrated circuits and provided a
major price and performance advantage over the second generation
systems.
The third generation operating systems also introduced
multiprogramming. This meant that the processor was not idle while a
job was completing its I/O operation. Another job was scheduled on
the processor so that its time would not be wasted.
The Fourth Generation ( 1980 - Present ): Personal Computers
Personal Computers were easy to create with the development of large-
scale integrated circuits. These were chips containing thousands of
transistors on a square centimeter of silicon. Because of these,
microcomputers were much cheaper than minicomputers and that
made it possible for a single individual to own one of them.
The advent of personal computers also led to the growth of networks.
This created network operating systems and distributed operating
systems. The users were aware of a network while using a network
operating system and could log in to remote machines and copy files
from one machine to another.
TYPES OF OPEARTING SYSTEM
An Operating System performs all the basic tasks like managing
files, processes, and memory. Thus operating system acts as the
manager of all the resources, i.e. resource manager. Thus, the
operating system becomes an interface between user and machine.
Types of Operating Systems: Some widely used operating systems
are as follows-
1. Batch Operating System –
This type of operating system does not interact with the computer
directly. There is an operator which takes similar jobs having the
same requirement and group them into batches. It is the
responsibility of the operator to sort jobs with similar needs.
Advantages of RTOS:
• Maximum Consumption: Maximum utilization of devices
and system, thus more output from all the resources
• Task Shifting: The time assigned for shifting tasks in these
systems are very less. For example, in older systems, it takes
about 10 microseconds in shifting one task to another, and in
the latest systems, it takes 3 microseconds.
• Focus on Application: Focus on running applications and
less importance to applications which are in the queue.
• Real-time operating system in the embedded
system: Since the 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 types 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 interrupts signals to respond 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.
1. Program Execution
2. Input Output Operations
3. File Management
4. Error Handling
5. Resource Management
6. Communication between Processes
Program Execution:
File Management:
Error Handling:
The Operating System also handles the error occurring in the CPU, in
Input-Output devices, etc. It also ensures that an error does not occur
frequently and fixes the errors. It also prevents the process from
coming to a deadlock. It also looks for any type of error or bugs that
can occur while any task. The well-secured OS sometimes also acts as
a countermeasure for preventing any sort of breach of the Computer
System from any external source and probably handling them.
Resource Management:
A system call is a way for a user program to interface with the operating
system. The program requests several services, and the OS responds by
invoking a series of system calls to satisfy the request. A system call
can be written in assembly language or a high-level language
like C or Pascal. System calls are predefined functions that the
operating system may directly invoke if a high-level language is used.
In this article, you will learn about the system calls in the operating
system and discuss their types and many other things.
ode and data for system calls are stored in global kernel memory.
Why do you need system calls in Operating System?
There are various situations where you must require system calls in the
operating system. Following of the situations are as follows:
A simple system call may take few nanoseconds to provide the result,
like retrieving the system date and time. A more complicated system
call, such as connecting to a network device, may take a few seconds.
Most operating systems launch a distinct kernel thread for each system
call to avoid bottlenecks. Modern operating systems are multi-
threaded, which means they can handle various system calls at the same
time.
There are commonly five types of system calls. These are as follows:
1. Process Control
2. File Management
3. Device Management
4. Information Maintenance
5. Communication
Now, you will learn about all the different types of system calls one-
by-one
Process Control
Process control is the system call that is used to direct the processes.
Some process control examples include creating, load, abort, end,
execute, process, terminate the process, etc.
File Management
File management is a system call that is used to handle the files. Some
file management examples include creating files, delete files, open,
close, read, write, etc.
Device Management
Device management is a system call that is used to deal with devices.
Some examples of device management include read, device, write, get
device attributes, release device, etc.
Information Maintenance
Communication
There are various examples of Windows and Unix system calls. These
are as listed below in the table:
Process Windows
Communication CreatePipe()
CreateFileMapping()
MapViewOfFile()
Protection SetFileSecurity()
InitializeSecurityDescriptor()
SetSecurityDescriptorgroup()
open()
The open() system call allows you to access a file on a file system. It
allocates resources to the file and provides a handle that the process
may refer to. Many processes can open a file at once or by a single
process only. It's all based on the file system and structure.
read()
It is used to obtain data from a file on the file system. It accepts three
arguments in general:
o A file descriptor.
o A buffer to store read data.
o The number of bytes to read from the file.
The file descriptor of the file to be read could be used to identify it and
open it using open() before reading.
wait()
write()
It is used to write data from a user buffer to a device like a file. This
system call is one way for a program to generate data. It takes three
arguments in general:
o A file descriptor.
o A pointer to the buffer in which data is saved.
o The number of bytes to be written from the buffer.
fork()
close()
It is used to end file system access. When this system call is invoked,
it signifies that the program no longer requires the file, and the buffers
are flushed, the file information is altered, and the file resources are de-
allocated as a result.
exec()
exit()
The exit() is a system call that is used to end program execution. This
call indicates that the thread execution is complete, which is especially
useful in multi-threaded environments. The operating system reclaims
resources spent by the process following the use of the exit() system
function.
Monolithic kernel
o In CP/M, the 16-bit address space starts with system variables and
the application area. It ends with three parts of the operating
system, namely CCP (Console Command Processor), BDOS
(Basic Disk Operating System), and BIOS (Basic Input/Output
System).
o 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.
LAYERED STRUCTURE
o A particular layer can access all the layers present below it, but it
cannot access them. That is, layer n-1 can access all the layers
from n-2 to 0, but it cannot access the nth
o Layer 0 deals with allocating the processes, switching between
processes when interruptions occur or the timer expires. It also
deals with the basic multiprogramming of the CPU.
Thus if the user layer wants to interact with the hardware layer, the
response will be traveled through all the layers from n-1 to 1. Each layer
must be designed and implemented such that it will need only the
services provided by the layers below it.
Though this system has several advantages over the Monolithic and
Simple design, there are also some disadvantages, such as:
Architecture of Microkernel
The microkernel ensures that the code may be easily controlled because
the services are split in the user space. It means some code runs in the
kernel mode, resulting in improved security and stability.
1. Inter-Process Communication
2. Memory Management
3. CPU Scheduling
Inter-Process Communication
Memory Management
CPU Scheduling
CPU scheduling refers to which process the CPU will execute next. All
processes are queued and executed one at a time. Every process has a
level of priority, and the process with the highest priority is performed
out first. CPU scheduling aids in optimizing CPU utilization. In
addition, resources are being used more efficiently. It also minimizes
the waiting time. Waiting time shows that a process takes less time in
the queue and that resources are allocated to the process more quickly.
CPU scheduling also reduces response and turnaround times.
Advantages
1. Microkernels are secure since only those parts are added, which
might disturb the system's functionality.
2. Microkernels are modular, and the various modules may be
swapped, reloaded, and modified without affecting the kernel.
3. Microkernel architecture is compact and isolated, so it may
perform better.
4. The system expansion is more accessible, so it may be introduced
to the system application without disrupting the kernel.
5. When compared to monolithic systems, microkernels have fewer
system crashes. Furthermore, due to the modular structure of
microkernels, any crashes that do occur are simply handled.
6. The microkernel interface helps in enforcing a more modular
system structure.
7. Server failure is treated the same as any other user program
failure.
8. It adds new features without recompiling.
Disadvantages
VIRTUAL MACHINES
Benefits
Let us see the major benefits of virtual machines for operating-system
designers and users which are as follows −
• The multiple Operating system environments exist
simultaneously on the same machine, which is isolated from
each other.
• Virtual machine offers an instruction set architecture which
differs from real computer.
• Using virtual machines, there is easy maintenance,
application provisioning, availability and convenient
recovery.
Virtual Machine encourages the users to go beyond the limitations of
hardware to achieve their goals.
The operating system achieves virtualization with the help of a
specialized software called a hypervisor, which emulates the PC client
or server CPU, memory, hard disk, network and other hardware
resources completely, enabling virtual machines to share resources.
The hypervisor can emulate multiple virtual hardware platforms that
are isolated from each other allowing virtual machines to run Linux
and window server operating machines on the same underlying
physical host.