Operating System

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 17

UNIX

The UNIX operating system is a set of programs that link the computer and the user. UNIX operating
system was created in the 1960s and has been updated continuously since then. It is a powerful multi-
user, multitasking OS created by AT&T Bell Laboratories. It is quite popular among scientists, engineers,
and academics because of its most valued properties such as flexibility, portability, network capabilities,
etc. It is a stable, multi-user, multitasking system for servers, PCs, and laptops. It is written in the C
language, enabling the UNIX operating system to operate on various platforms.

UNIX operating system comes with a Command Line Interface (CLI). UNIX knowledge is required for
actions that aren't covered by graphical software or when there isn't a window interface available, such
as during a telnet session.

Advantages and Disadvantages of UNIX Operating System

There are various advantages and disadvantages of a UNIX operating system. Some of the advantages
and disadvantages of the UNIX operating system are as follows:

Advantages

Many large online stores operate their websites on UNIX or Linux servers. It has also been used to
control mobile phones and other electronic devices.

It consumes less memory when running complicated programs. It may handle the virtual memory very
effectively. The virtual memory grows as many programs come into the main memory. In UNIX, most of
the jobs are completed with fewer resources.

The UNIX operating system is both free and safe, so it is commonly used by web hosting providers.
Domain Name Server (DNS), Dynamic Host Configuration Protocol (DHCP), and the webserver are all
tools used by many web hosting servers.

It allows you to open many programs, and all the programs execute in parallel using multiprocessor
technology.

It offers numerous users a safe and secure environment to interact with servers online without worrying
about security issues. The communication with the UNIX servers is quick and error-free.
Multiple web servers and electronic devices do not require user participation. It is an excellent choice
for machines and systems that require little or no user interactions. It may handle the automatic
working of systems very effectively.

Disadvantages

For UNIX, there is no proper documentation available. If the user has an issue, he must seek the advice
of an expert, as obtaining online assistance from the documentation is quite difficult.

UNIX commands are far more difficult to learn than Windows, MS-DOS, and macOS.

It is difficult to use for new users. Because most UNIX work is done with commands in the CLI, beginners
must learn various commands. It is designed exclusively for programmers, not for new users. Some users
with a lot of experience have trouble utilizing the commands since the names of some commands are
extremely different.

Most of the UNIX commands use cryptic words. It's tough for a non-technical user to grasp how
commands work. Some commands use unusual characters, and it may be difficult for new programmers
to grasp them.

The user interface of the UNIX operating system is not attractive.

Some variants of UNIX need most memory usage.

What is Windows Operating System?

Windows is an operating system that was designed and developed by Microsoft Cooperation. It is one of
the most famous OSs around the world. Windows uses a Graphical User Interface (GUI). It allows the
users to store files, watch videos, run software, play games, and access the Internet. The first version of
Microsoft Windows is version 1.0 that was released on November 10, 1983. Microsoft Windows comes
in various versions, including Windows XP, Vista, Windows 95, Windows 7, 8, 10, and 11.

The first business-oriented Windows version, known as Windows NT 3.1, was introduced in 1993. The
next versions, Windows 3.5, 4/0, and Windows 2000, were released. Microsoft created the various
versions of Windows XP for home and the commercial environment when it was released in 2001. It was
built using common x86 hardware, like AMD and Intel processors. Therefore, it may run on different
hardware, including HP, Dell, Sony systems, and custom-built PCs.

The Windows operating system comes with very useful features. The user may easily create folders and
arrange their files. The start button can be used to locate the installed software on the system. Users
may also use the start button to access the control panel and get system help and support. Different
themes may also be used to customize the desktop. It also comes with various helpful software,
including Microsoft Excel, PowerPoint, and Word.

Advantages and Disadvantages of Windows Operating System

There are various advantages and disadvantages of a Windows operating system. Some of the
advantages and disadvantages of the Windows operating system are as follows:

Advantages

The Windows platform is suitable for game and software developers. Because Windows has a large user
base, so designers want to create utilities, games, and programming for the operating system.

Windows 10 is intended for use on both touch-screen devices and desktop systems. Windows 10's user
interface is meant to operate better with a Windows gadget.

As the Windows operating system is used by 95% of users, most equipment merchants create drivers for
Windows.

Most equipment may be differentiated naturally by attachment and play include. You do not require to
install the equipment physically, but it is used when linked, like a console, mouse, webcam, cell phone,
etc.

All versions of Microsoft Windows have something in common that allows users to switch from one
version to another easily. Users of Windows 7 will have no difficulty switching to Windows 10 because
the majority of the features of Windows 10 are the same as those of Windows 7. The user interface of
Windows is also easier to use than those of UNIX and MAC.

Disadvantages

Most of Windows's products are paid, such as design programming, games, download chief, and another
popular programming. Users must purchase these products or pay a monthly charge to use them.

Linux operating system is open-source and free to use for anyone, but Windows requires a purchased
license and cannot be used for free. Windows operating system is also expensive. You'll also need to
purchase other Microsoft software, such as MS Office, to do regular office work on the system.

Windows have a high amount of hacker attacks. Hackers may easily crack Windows security. As a result,
Windows users are relying on anti-virus software and must pay monthly charges to firms to secure their
data. In addition, Windows users must keep their operating systems up to date in order to receive
security fixes.
Windows operating system support is not ideal for most users. Only a few significant enterprises may
rely on the Windows team for assistance. Common users must look for forums to fix their problems.

If you install Windows, your computer will have plenty of RAM, lots of good hard drive space, and a
good graphics card. It is due to the features used in Windows. If you wish to install graphics applications,
such as Photoshop, you should have at least 16 GB of RAM.

Main differences between the UNIX and Windows operating system


UNIX vs Windows Operating System

There are various main differences between the UNIX and Windows operating systems. Some of the
main differences between the UNIX and Windows operating systems are as follows:

UNIX operating system comes with a Command Line Interface (CLI). In contrast, Windows operating
system comes with a Graphical User Interface (GUI).

Multiprocessing is possible in the UNIX OS. In contrast, multiprocessing is not possible in the Windows
operating system.

UNIX is a free and open-source OS. In contrast, Windows is a licensed OS.

UNIX is a command-based OS. In contrast, Windows is a menu-based OS.

Unix is fully case-sensitive, and files can be considered separate files. In contrast, Windows has case
sensitivity as an option.

Unix operating system is known for being very stable to execute. Although Windows stability has
improved greatly in recent years, most Unix systems remain far superior in this context.

UNIX systems have limited hardware support. Some hardware could not have drivers available. In
contrast, the Windows operating system contains almost all of the drivers for all of the available
hardware.

Unix is a flexible operating system that may be installed on various systems, including mainframes,
supercomputers, and microcomputers. Unix also promotes new software design ideas, such as solving
problems by connecting simpler tools rather than developing massive, monolithic applications. In
contrast, the Windows operating system is less powerful than Unix, but it is comparatively simple to
operate in terms of capabilities.

The UNIX operating system utilizes the ERR and STD.IO file systems and the UFS (Unix File System) treat
all physical drives as if they were one logical drive. It has a stable and effective file system. A hierarchical
tree with a single root represents the file system. On the other hand, Windows uses the New
Technology File System (NTFS) and File Allocation Table (FAT32) systems to handle files and requires the
owner of executables before executing them. Files are stored into folders on several hard drives, like C,
D, and E.

Users may save two files with the same name in the UNIX operating system. In contrast, the user may
not save two files with the same name in Windows operating system.

Operating System: Definition:


An operating system is a program that controls the execution of application programs and acts as an
interface between the user of a computer and the computer hardware.

A more common definition is that the operating system is the one program running at all times on the
computer (usually called the kernel), with all else being application programs.

An operating system is concerned with the allocation of resources and services, such as memory,
processors, devices, and information. The operating system correspondingly includes programs to
manage these resources, such as a traffic controller, a scheduler, a memory management module, I/O
programs, and a file system

Monolithic Structure of Operating System


The monolithic operating system is a very basic operating system in which file management, memory
management, device management, and process management are directly controlled within the kernel.
The kernel can access all the resources present in the system. In monolithic systems, each component of
the operating system is contained within the kernel. Operating systems that use monolithic architecture
were first time used in the 1970s.

The monolithic operating system is also known as the monolithic kernel. This is an old operating system
used to perform small tasks like batch processing and time-sharing tasks in banks. The monolithic kernel
acts as a virtual machine that controls all hardware parts.

Microkernel in Operating Systems


Kernel is the core part of an operating system that manages system resources. It also acts as a bridge
between the application and hardware of the computer. It is one of the first programs loaded on start-
up (after the Bootloader).

What is Microkernel?
A microkernel is one of the classifications of the kernel. Being a kernel it manages all system resources.
But in a microkernel, the user services and kernel services are implemented in different address spaces.
The user services are kept in user address space, and kernel services are kept under kernel address
space, thus also reduces the size of kernel and size of an operating system as well.

Virtual Machines in Operating System


Virtual Machine abstracts the hardware of our personal computer such as CPU, disk drives, memory, NIC
(Network Interface Card) etc, into many different execution environments as per our requirements,
hence giving us a feel that each execution environment is a single computer. For example, VirtualBox.

When we run different processes on an operating system, it creates an illusion that each process is
running on a different processor having its own virtual memory, with the help of CPU scheduling and
virtual-memory techniques. There are additional features of a process that cannot be provided by the
hardware alone like system calls and a file system. The virtual machine approach does not provide these
additional functionalities but it only provides an interface that is same as basic hardware

Advantages:
There are no protection problems because each virtual machine is completely isolated from all other
virtual machines.

Virtual machine can provide an instruction set architecture that differs from real computers.

Easy maintenance, availability and convenient recovery.

Disadvantages:
When multiple virtual machines are simultaneously running on a host computer, one virtual machine
can be affected by other running virtual machines, depending on the workload.

Virtual machines are not as efficient as a real one when accessing the hardware.

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 Batch Operating System:


It is very difficult to guess or know the time required for any job to complete. Processors of the batch
systems know how long the job would be when it is in queue

Multiple users can share the batch systems

The idle time for the batch system is very less

It is easy to manage large work repeatedly in batch systems

Disadvantages of Batch Operating System:

The computer operators should be well known with batch systems

Batch systems are hard to debug

It is sometimes costly

The other jobs will have to wait for an unknown time if any job fails

Examples of Batch based Operating System: Payroll System, Bank Statements, etc.

. Time-Sharing Operating Systems –


Each task is given some time to execute so that all the tasks work smoothly. Each user gets the time of
CPU as they use a single system. These systems are also known as Multitasking Systems. The task can be
from a single user or different users also. The time that each task gets to execute is called quantum.
After this time interval is over OS switches over to the next task.

Advantages of Time-Sharing OS:

Each task gets an equal opportunity

Fewer chances of duplication of software

CPU idle time can be reduced

Resource Sharing: Time-sharing systems allow multiple users to share hardware resources such as the
CPU, memory, and peripherals, reducing the cost of hardware and increasing efficiency.

Improved Productivity: Time-sharing allows users to work concurrently, thereby reducing the waiting
time for their turn to use the computer. This increased productivity translates to more work getting
done in less time.
Improved User Experience: Time-sharing provides an interactive environment that allows users to
communicate with the computer in real-time, providing a better user experience than batch processing.

Disadvantages of Time-Sharing OS:

Reliability problem

One must have to take care of the security and integrity of user programs and data

Data communication problem

High Overhead: Time-sharing systems have a higher overhead than other operating systems due to the
need for scheduling, context switching, and other overheads that come with supporting multiple users.

Complexity: Time-sharing systems are complex and require advanced software to manage multiple users
simultaneously. This complexity increases the chance of bugs and errors.

Security Risks: With multiple users sharing resources, the risk of security breaches increases. Time-
sharing systems require careful management of user access, authentication, and authorization to ensure
the security of data and software.

Examples of Time-Sharing OSs are: Multics, Unix, etc.

3. Distributed Operating System –

These types of the operating system is a recent advancement in the world of computer technology and
are being widely accepted all over the world and, that too, with a great pace. Various autonomous
interconnected computers communicate with each other using a shared communication network.
Independent systems possess their own memory unit and CPU. These are referred to as loosely coupled
systems or distributed systems. These system’s processors differ in size and function. The major benefit
of working with these types of the operating system is that it is always possible that one user can access
the files or software which are not actually present on his system but some other system connected
within this network i.e., remote access is enabled within the devices connected in that network.

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 is 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 types 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 into the system

Server access is possible remotely from different locations and types of systems

Disadvantages of Network Operating System:


Servers are costly

User has to depend on a 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.

5. Real-Time Operating System –


These types of OSs serve real-time systems. The time interval required to process and respond to inputs
is very small. This time interval is called response time.

Real-time systems are used when there are time requirements that are very strict like missile systems,
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 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
airbags which are required to be readily available in case of any accident. Virtual memory is rarely found
in these systems.

Soft Real-Time Systems:

These OSs are for applications where time-constraint is less strict .A soft real-time system is a system
whose operation is degraded if results are not produced according to the specified timing requirement.
In a soft real-time system, the meeting of deadline is not compulsory for every task, but the process
should get processed and give the result.

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.

What is a System Call?

A system call is a method for a computer program to request a service from the kernel of the operating
system on which it is running. A system call is a method of interacting with the operating system via
programs. A system call is a request from computer software to an operating system's kernel.

The Application Program Interface (API) connects the operating system's functions to user programs. It
acts as a link between the operating system and a process, allowing user-level programs to request
operating system services. The kernel system can only be accessed using system calls. System calls are
required for any programs that use resources.

Process Table and Process Control Block (PCB)


While creating a process the operating system performs several operations. To identify the processes, it
assigns a process identification number (PID) to each process. As the operating system supports multi-
programming, it needs to keep track of all the processes. For this task, the process control block (PCB) is
used to track the process’s execution status. Each block of memory contains information about the
process state, program counter, stack pointer, status of opened files, scheduling algorithms, etc. All
these information is required and must be saved when the process is switched from one state to
another. When the process makes a transition from one state to another, the operating system must
update information in the process’s PCB.

A process control block (PCB) contains information about the process, i.e. registers, quantum, priority,
etc. The process table is an array of PCB’s, that means logically contains a PCB for all of the current
processes in the system.

Pointer – It is a stack pointer which is required to be saved when the process is switched from one state
to another to retain the current position of the process.

Process state – It stores the respective state of the process.

Process number – Every process is assigned with a unique id known as process ID or PID which stores
the process identifier.

Program counter – It stores the counter which contains the address of the next instruction that is to be
executed for the process.

Register – These are the CPU registers which includes: accumulator, base, registers and general
purpose registers.

Memory limits – This field contains the information about memory management system used by
operating system. This may include the page tables, segment tables etc.

Open files list – This information includes the list of files opened for a process.

New (Create) – In this step, the process is about to be created but not yet created, it is the program
which is present in secondary memory that will be picked up by OS to create the process.
Ready – New -> Ready to run. After the creation of a process, the process enters the ready state i.e. the
process is loaded into the main memory. The process here is ready to run and is waiting to get the CPU
time for its execution. Processes that are ready for execution by the CPU are maintained in a queue for
ready processes.

Run – The process is chosen by CPU for execution and the instructions within the process are executed
by any one of the available CPU cores.

Blocked or wait – Whenever the process requests access to I/O or needs input from the user or needs
access to a critical region(the lock for which is already acquired) it enters the blocked or wait state. The
process continues to wait in the main memory and does not require CPU. Once the I/O operation is
completed the process goes to the ready state.

Terminated or completed – Process is killed as well as PCB is deleted.

Suspend ready – Process that was initially in the ready state but was swapped out of main
memory(refer Virtual Memory topic) and placed onto external storage by scheduler is said to be in
suspend ready state. The process will transition back to ready state whenever the process is again
brought onto the main memory.

Suspend wait or suspend blocked – Similar to suspend ready but uses the process which was
performing I/O operation and lack of main memory caused them to move to secondary memory. When
work is finished it may go to suspend ready

Context Switching in OS (Operating System)

The Context switching is a technique or method used by the operating system to switch a process from
one state to another to execute its function using CPUs in the system. When switching perform in the
system, it stores the old running process's status in the form of registers and assigns the CPU to a new
process to execute its tasks. While a new process is running in the system, the previous process must
wait in a ready queue. The execution of the old process starts at that point where another process
stopped it. It defines the characteristics of a multitasking operating system in which multiple processes
shared the same CPU to perform multiple tasks without the need for additional processors in the
system.

The need for Context switching


The switching of one process to another process is not directly in the system. A context
switching helps the operating system that switches between the multiple processes to use the
CPU's resource to accomplish its tasks and store its context. We can resume the service of the
process at the same point later. If we do not store the currently running process's data or
context, the stored data may be lost while switching between processes.

If a high priority process falls into the ready queue, the currently running process will be shut
down or stopped by a high priority process to complete its tasks in the system.

If any running process requires I/O resources in the system, the current process will be
switched by another process to use the CPUs. And when the I/O requirement is met, the old
process goes into a ready state to wait for its execution in the CPU. Context switching stores the
state of the process to resume its tasks in an operating system. Otherwise, the process needs to
restart its execution from the initials level.

If any interrupts occur while running a process in the operating system, the process status is
saved as registers using context switching. After resolving the interrupts, the process switches
from a wait state to a ready state to resume its execution at the same point later, where the
operating system interrupted occurs.

A context switching allows a single CPU to handle multiple process requests simultaneously
without the need for any additional processors.

Threads in Operating System (OS)


A thread is a single sequential flow of execution of tasks of a process so it is also known as
thread of execution or thread of control. There is a way of thread execution inside the process
of any operating system. Apart from this, there can be more than one thread inside a process.
Each thread of the same process makes use of a separate program counter and a stack of
activation records and control blocks. Thread is often referred to as a lightweight process.

Threads in os

The process can be split down into so many threads. For example, in a browser, many tabs can
be viewed as threads. MS Word uses many threads - formatting text from one thread,
processing input from another thread, etc.
Need of Thread:

It takes far less time to create a new thread in an existing process than to create a new process.

Threads can share the common data, they do not need to use Inter- Process communication.

Context switching is faster when working with threads.

It takes less time to terminate a thread than a process.

Types of Threads

In the operating system, there are two types of threads.

Kernel level thread.

User-level thread.

User-level thread

The operating system does not recognize the user-level thread. User threads can be easily
implemented and it is implemented by the user. If a user performs a user-level thread blocking
operation, the whole process is blocked. The kernel level thread does not know nothing about
the user level thread. The kernel-level thread manages user-level threads as if they are single-
threaded processes?examples: Java thread, POSIX threads, etc.

Advantages of User-level threads

The user threads can be easily implemented than the kernel thread.

User-level threads can be applied to such types of operating systems that do not support
threads at the kernel-level.

It is faster and efficient.

Context switch time is shorter than the kernel-level threads.

It does not require modifications of the operating system.


User-level threads representation is very simple. The register, PC, stack, and mini thread control
blocks are stored in the address space of the user-level process.

It is simple to create, switch, and synchronize threads without the intervention of the process.

Disadvantages of User-level threads

User-level threads lack coordination between the thread and the kernel.

If a thread causes a page fault, the entire process is blocked.

Threads in os

Kernel level thread

The kernel thread recognizes the operating system. There is a thread control block and process
control block in the system for each thread and process in the kernel-level thread. The kernel-
level thread is implemented by the operating system. The kernel knows about all the threads
and manages them. The kernel-level thread offers a system call to create and manage the
threads from user-space. The implementation of kernel threads is more difficult than the user
thread. Context switch time is longer in the kernel thread. If a kernel thread performs a blocking
operation, the Banky thread execution can continue. Example: Window Solaris.

Threads in os

Advantages of Kernel-level threads

The kernel-level thread is fully aware of all threads.

The scheduler may decide to spend more CPU time in the process of threads being large
numerical.

The kernel-level thread is good for those applications that block the frequency.

Disadvantages of Kernel-level threads

The kernel thread manages and schedules all threads.


The implementation of kernel threads is difficult than the user thread.

The kernel-level thread is slower than user-level threads.

Components of Threads

Any thread has the following components.

Program counter

Register set

Stack space

You might also like