Operating Systems-Basics, Processes, Characteristics, Applications

By Mona Kumari|Updated : June 26th, 2021

Operating System

Introduction to Operating System

An Operating System is software responsible for performing all the basic tasks in a computer system like managing files, processes, and memory. An operating system behaves as a manager for all the resources, hence also known as a resource manager. In simple words, an operating system is defined as an interface between user and hardware.

Operating System

Introduction to Operating System

An Operating System is software responsible for performing all the basic tasks in a computer system like managing files, processes, and memory. An operating system behaves as a manager for all the resources, hence also known as a resource manager. In simple words, an operating system is defined as an interface between user and hardware.

  1. TYPES OF OPERATING SYSTEMS

Here are some widely used types of operating systems:

1.1. Batch Operating System –

The batch operating system doesn’t interact with the computer directly. There exists an operator who collects all similar kinds of jobs together (i.e. jobs having the exact requirement) and then groups them into batches. The operator is responsible for sorting appointments of similar needs.

Advantages of Batch Operating System:

  • Batch OS processors know the time required for the process execution. It is very tough to guess the time needed by any process to complete.
  • Batch operating systems are shareable between multiple users.
  • It has a concise ideal time.
  • Manageable operating system, the large amount of work can be managed easily.

Disadvantages of Batch Operating System:

  • The computer’s operator should be smart enough to differentiate between different processes with similar needs. 
  • Debugging is tough. 
  • It is expensive and less cost-efficient
  • The system can get into starvation mode if any job gets failed. 

 Examples: It is used in Payroll System, Bank Statements etc.

1.2. Time-Sharing Operating Systems –

In a time-sharing operating system, each process gets some time to execute so that all the processes get done smoothly. Each user gets some time on the CPU if they use a single system. These systems are also called Multitasking Systems. The time unit that each process gets to execute is called quantum. After this time interval finishes, the OS switches to the next task.

Advantages of Time-Sharing OS:

  • Every process gets equal time to execute.
  • Software duplication chances are low.
  • CPU idle time may be reduced.

Disadvantages of Time-Sharing OS:

  • The system is not reliable
  • Difficult to maintain security and integrity of users program and data.
  • It can cause data communication issues.

Examples: It is used in Unix etc.

1.3. Distributed Operating System –

Distributed operating systems are a recent advancement in computer technology, and these operating systems are being broadly accepted all over the world. Various independent interconnected computers communicate with each other using a shared communication network. Independent (autonomous) systems have their own CPU and memory uni. These systems are also known as loosely coupled systems or distributed systems

Distributed system’s processors may differ in size and functioning. The major advantage of loosely coupled operating systems is that one user can access the software or files which are not actually present on his system but present on some other system connected within this network, i.e., remote access of files and software and other data is enabled within the devices connected within that network.

Advantages of Distributed Operating System:

  • If one system gets failed it will not affect the other system’s in the network communication, all the systems are independent of each other.
  • Electronic mail (e-mail) increases the data transmission speed.
  • Sharable resources result in fast and durable computation.
  • It reduces the load on the host system.
  • Scalable in nature, i.e. so many computer systems can be added once a system is being installed.
  • Data processing speed is high, so delay in data processing is reduced.

Disadvantages of Distributed Operating System:

  • If the main host fails, the entire network will be hampered.
  • It doesn’t have any well-defined language yet for establishment.
  • Highly expensive and not readily available.
  • Complex system design.
  • Very difficult to understand.

Examples: It is used in LOCUS etc.

1.4. Network Operating System –

Network OS runs over a server and has the capability to manage data, users, applications, groups, security, and other networking functions. Such kind operating systems allow shared access of files, applications, printers, security, and other networking functions over a small network. One important aspect of Networked operating systems is that all the users are aware of the underlying configuration of the system, of all the users within the network, their individual connections etc. and these computers are also known as tightly coupled systems.

Advantages of Network Operating System:

  • Network os have highly stable centralized servers
  • All the security issues are handled through servers.
  • Scalable and reliable systems, we can add new technologies and can up-grade hardware easily.
  • Remote access of the server is possible from various locations and various kind of systems.

Disadvantages of Network Operating System:

  • Servers are costly.
  • Each user has to depend on the central server for most operations.
  • Regular maintenance and updates are required.

Examples: It is widely used in Microsoft Windows Server 2003, Microsoft Windows Server 2008, UNIX, Linux, Mac OS X, Novell NetWare, and BSD etc.

1.5.         Real-Time Operating System –

In real-time operating systems, a small-time interval is required to process and respond to input data. This small time interval is called response time.

These OSs are used when time requirements are very strict, like in missile systems, air traffic control systems, robots etc.

The real-time operating system is further divided into two types:

  • Hard Real-Time Systems: These OSs are designed for applications where time constraints are very strict, and even the shortest possible delay is not acceptable. Such operating systems are built for life-saviour applications like automatic parachutes or airbags, which are needed to be readily available in case of an accident. Virtual memory is never found in these systems.
  • Soft Real-Time Systems: These OSs are for those applications where time-constraint is less strict.

Advantages of RTOS:

  • Maximum Consumption: It utilizes each device and consumes almost all resources.
  • Task Shifting: Time assigned for shifting tasks, i.e., switching between different processes in these systems, is very less. Like, in earlier systems, it takes about 10 microseconds in shifting one job to another, and in the latest systems, it takes only 3 microseconds.
  • Focus on Application: Real-time OSs focus on running applications and give less importance to the applications present in the queue.
  • The real-time operating system in the embedded system: It can be used in embedded systems like in transport and others as the size of the program in RTOS is small.
  • Error Free: RTOS need to be error-free, and they are free from errors. 
  • Memory Allocation: Memory allocation is perfectly managed in RTOS.

Disadvantages of RTOS:

  • Limited Tasks: Very few tasks can run simultaneously, and it concentrates on few applications to avoid errors.
  • Use heavy system resources: Sometimes, it makes use of expensive resources.
  • Complex Algorithms: It makes use of a complex algorithm which is difficult to write and implement.
  • Device driver and interrupt signals: It requires specific device drivers and interrupts signals so that it can give a response earliest to the interrupts.
  • Thread Priority:  It is better not to set thread priority because these systems switch tasks very little.

Examples: Scientific experiments, medical imaging systems, industrial control systems, weapon systems, robots, air traffic control systems, etc.

  1. MODES OF OPERATION IN OS

Operating system operates in two modes, one is known as User mode and the other is Kernel mode. 

2.1. User Mode

The system is said to be in user mode when the OS is running a user application such as managing a text editor. Switching to kernel mode from user mode happens when the application requests any help from the operating system or a system call or an interrupt occurs.

In the user mode  the mode bit is set to 1 . Mode bit is changed from 1 to 0 when changed from user mode to kernel mode.

2.2. Kernel Mode

When the system starts up or boots in the system, it is in kernel mode and then the OS is loaded, it executes all applications in the user mode. In computers there are some privileged instructions that can only be executed in kernel mode.

These privileged instructions are interrupt instructions, input output management, etc. If privileged instructions are executed in user mode, it will be illegal and a trap is generated.

In the kernel mode the mode bit is set to 0 . Mode bit is changed from 0 to 1 when switching from kernel mode to user mode.

 

Necessity of Dual Mode (User Mode and Kernel Mode) in Operating System

The lack of a dual mode in an operating system can cause some serious problems. Some of these issues are −

  • A running user program can accidentally wipe out from the  system by overwriting the running program with user data.
  • Multiple processes can be overwritten in the same system at the same time, which will give disastrous results.

Such issues could have occurred in the MS-DOS OS which had no mode bit so no dual mode.

  1. THREADS IN OS

A thread may be defined  as a flow of execution through some process code.

  • A thread is also known as a lightweight process
  • Threads improves application’s performance by providing parallelism. 
  • Threads improve the performance of operating systems by reducing the process overhead.
  • Thread is equivalent to a classical process and it is a software approach for software improvement. 
  • Every thread belongs to only one process and not a single thread can exist outside a process.

3.1.         Difference between Process and Thread

S.N.

Process

Thread

1

Process is resource intensive or  heavy weight.

Thread is a light-weight process  which requires less resources than a process.

2

Process switching needs interaction with the OS.

Thread switching doesn’t require any interaction with the operating system.

3

In multiprocessing environments, each process has its own memory and file resources but executes  the same code.

All threads can share the same open files, child processes, etc..

4

If one process gets blocked, then another process cannot run until the first process is unblocked.

Whereas if one thread gets blocked and waiting, a second thread of the same task can execute.

5

Multiple processes without threads needs more resources.

Multi-threaded processes use less resources.

6

In multiple processes each process operates independently of the others.

Thread can read, write or alternate another thread's data.

 

3.2.         Advantages of Threads

  • Responsiveness: If any process is divided into multiple threads and one thread completes its execution, then its output will be returned immediately.
  • Faster context switch: Context switching is faster in threads as compared to context switching in processes because process context-switching requires CPU overhead
  • Effective utilization of multiprocessor system: Multiple threads in a multiprocessor system results in faster and more efficient utilization of resources.
  • Resource sharing: All threads of a process can share resources like code, data, etc. 

 

Note-1: Stack space, registers, and Program counter cannot be shared among the threads. Each thread maintains its own program counter and has its own stack and registers.

Note-2: A thread shares few information like data segment, code segment, and open files with its peer threads.

byjusexamprep

Fig-1: threads

  • Communication: As the threads share common address space, the communication between multiple threads is easier. Whereas in process we have to follow some communication techniques to establish communication between  processes.
  • Enhanced throughput of the system: If a single process is divided into multiple threads, and every thread functioning is considered as one complete job, then the total number of jobs completed per unit of time will be increased, thus, this will result in increasing system throughput.

3.3.         Types of Thread

Threads are of two  −

  • User Level Threads − Threads managed by users.
  • Kernel Level Threads − Threads managed by operating system.

 

3.3.1 User Level Threads

In user level threads, the thread management kernel is unaware of the existence of user level threads. The thread library consists of code for creating and destroying threads, for passing messages & data between various threads, for scheduling thread execution and for saving and restoring thread contexts.

3.3.2 Kernel Level Threads

Kernel is responsible for thread-management. Application area of the program doesn’t have any code for thread-management. Kernel threads are directly supported by the operating system. Any system application can be programmed to be multithreaded. 

 

3.3.3 Difference between User Level thread and Kernel Level thread

USER LEVEL THREAD

KERNEL LEVEL THREAD

User thread are implemented by users.

kernel threads are implemented by OS.

OS doesn’t recognize user level threads.

Kernel threads are recognized by OS.

Implementation of User threads is easy.

Implementation of Kernel thread is complicated.

Context switch time is less.

Context switch time is more.

Context switch requires no hardware support.

Hardware support is needed.

If one user level thread perform blocking operation then entire process will be blocked.

If one kernel thread performs blocking operation then another thread can continue execution.

User level threads are designed as dependent threads.

Kernel level threads are designed as independent threads.

 

Table-2: Types of threads

  1. PROCESS LIFE CYCLE

byjusexamprep

Fig-2: Process state Diagram

  1. New State-
  • When a program is present in the secondary memory and initiated for execution it is said to be in a new state. 
  1. Ready State-
  • When a process is loaded into the main memory and is ready for execution, so the process moves from a new state to a ready state
  • The process waits for its execution by the processor in the ready state.
  • In a multiprogramming environment, many processes may be present in the ready state at the same time.
  1. Run State-
  • A process moves to run stata from ready state after CPU is assigned to the process for execution.
  1. Terminate State-
  • A process moves  to terminate state from run state  after its execution is completed.
  • After entering into the terminate state, context (PCB) of the process is removed by the operating system.
  1. Block/Wait State-
  • A process moves to block or wait state from run state if it requires an I/O operation or some blocked resource during its execution.
  • After the I/O operation is completed or a blocked resource becomes available, the process moves to the ready state again for the execution.
  1. Suspend Ready State-
  • A process moves to suspend ready from ready state if a process arrives with higher priority and it has to be executed but the main memory is full.
  • Moving a process with lower priority from ready state to suspend ready state makes space for a higher priority process in the ready queue.
  • Process remains in the suspend ready state until the main memory becomes available to store the process.
  • Once the main memory is available, the process is brought back to the ready state.
  1. Suspend Wait State-
  • A process moves to suspend wait state from wait state if the main memory is full and a process with higher priority has to be executed.
  • Moving a process with lower priority to suspend wait  state from waiting state makes space for higher priority processes in the ready queue.
  • After the resource becomes available, the process is moved to the suspend ready state.
  • Once the main memory is available, the process is brought back to the ready state.

 

Candidates can practice 150+Mock Tests with BYJU'S Exam Prep Test Series for exams like GATE, ESE, NIELIT from the following link:

Click Here to Avail Electronics Engineering Test Series (150+ Mock Tests)

Get unlimited access to 24+ structured Live Courses all 150+ mock tests to boost your GATE 2021 Preparation with Online Classroom Program:

Click here to avail Online Classroom Program for Electronics Engineering

Thanks

Sahi Prep Hai To Life Set Hai.

 
Download BYJU'S Exam Prep, Best gate exam app for Preparation

Comments

write a comment

Follow us for latest updates