Skip to main content

Introduction to OS-Operating System

What is Operating System

 
The Operating System is a program with the following features 

An operating system is a system software that acts as an interface between the user and the computer hardware.
It is an integrated set of specialized programs used to manage overall resources and operations of the computer. 
It is a specialized software that controls and monitors the execution ofall other programs that reside in the computer, including application Unit 
 

Intorduction to Opeating System

all other programs that reside in the computer, including applicationprograms and other system software. 

Objectives of Operating System


To make the computer system convenient to use in an efficientmanner. To hide the details of the hardware resources from the users.To provide users a convenient interface to use the computer system. To act as an intermediary between the hardware and its users, makingit easier for the users to access and use other resources.  To manage the resources of a computer system.


Memory Management 


Memory management refers to management of Primary Memory or Main Memory. For a program to be executed, it must in the main memory.  

An Operating System does the following activities for memory management


Keeps tracks of primary memory, i.e., what part of it are in use by whom, what part arenot in use. 
In multiprogramming, the OS decides which process will get memory when and howmuch.
Allocates the memory when a process requests it to do so.
 

Processor Management

 

Important Functions of OS


The OS decides which process gets the processor when and for how much time. Thisfunction is called CPU scheduling.

An Operating System does the following activities for processor management
 
Keeps tracks of processor and status of process. The program responsible for this task is known as traffic controller.

Allocates the processor (CPU) to a process. 
Deallocate processor when a process is no longer required.
De-allocates the memory when a process no longer needs it or has been terminated.

Device Management


The OS Keeps track of all the devices. 
It does the following activities fordevice management.
Keeps tracks of all devices. The program responsible for this task is known asthe I/O controller. 

Decides which process gets the device when and for how much time.
Allocates the device in the most efficient way. 
De-allocates devices. 

File Management 


A file system is normally organized into directories for easy navigation and usage. These directories may contain files and other directions. 

An Operating System does the following activities for file management


Keeps track of information, location, uses, status etc. The collective facilities are often known as file system. Decides who gets the resources.  

Security: Prevents unauthorized access to programs and data by means of passwords and other similar techniques.

Following are the common services offered by an almost all OS 


User Interface

 
Usually Operating system comes in two forms or types. 

Depending on theinterface their types have been further subdivided. These are,

  • Command line interface (CLI) 
  • Graphical User Interface (GUI) 
The CLI usually deals with using text commands and a technique for enteringServices Provided by Operating System those commands. 

GUI is a window system with a pointing device (like mouse or trackball) topoint to the I/O, choose from menus driven interface and to make choicesviewing from a number of lists and a keyboard to entry the texts. 

Program Execution in Operating system

 
The operating system must have the capability to load a program into memoryand execute that program. 

Furthermore, the program must be able to end its execution, either normally orabnormally.

File System Manipulation in Operating System

File handling portion of operating system also allows users tocreate and delete files by specific name along with extension,search for a given file and / or list file information. 

Some programs comprise of permissions management forallowing or denying access to files or directories based on file

I/O operations in Operating System
A program which is currently executing may require I/O, whichmay involve file or other I/O device. For efficiency and protection, users cannot directly govern theI/O devices. So, the OS provide a means to do I/O Input /Output operation which means read or write operation with any
ownership. file.

Communication system of Operating System


Processes executing on same computer system or on differentcomputer systems can communicate using operating system support.

Resource Allocation


When multiple jobs running concurrently, resources must need to beallocated to each of them. Resources can be CPU cycles, mainmemory storage, file storage and I/O devices. CPU schedulingroutines are used here to establish how best the CPUcan be used. 

Error Detection


Errors may occur within CPU, memory hardware, I/O devices and inthe user program. For each type of error, the OS takes necessaryaction to handle the error. This service of the operating system keeps track of which users areusing how much and what kinds of computer resources have beenused for accounting or simply to accumulate usage statistics.

Security


Prevents unauthorized access to programs and data bymeans of passwords and other similar techniques.
routines are used here to establish how best the CPUcan be used. 

Accounting


A process is basically a program in execution. A process is defined as an entity which represents the basic unit ofwork to be implemented in the system. A computer program becomes a process when an executable file isloaded into memory 

To put it in simple terms, we write our computer programs in a textfile and when we execute this program, it becomes a process whichperforms all the tasks mentioned in the program. 

Concept of Process in OS


A word processing program being run by an individual user on aPC is a process. 
Process

A system task such as sending output to printer can also be aprocess.

When a program is loaded into the memory and it becomesa process, it can be divided into four sections ─ stack, heap,text and data. 

The following image shows a simplified layout of a processinside main memory. 
The process Stack contains the temporary data such asmethod/function parameters, return address and local This is dynamically allocated memory to a process during

This includes the current activity represented by the valueof Program Counter and the contents of the processor's

Stack

This section contains the global and static
variables

Heap

its run time. Text, registers. 

A computer program is a collection of instructions thatperforms a specific task when executed by a computer. 

Process Life Cycle


When a process executes, it passes through different states.These stages may differ in different operating systems, and

In general, a process can have one of the following fivestates at a time. 
Process Life Cycle 
the names of these states are also not standardized. the names of these states are also not standardized. 

New: This is the initial state when a process is first started/created. The process is waiting to be assigned to a processor. Ready processes arewaiting to have the processor allocated to them by the operating system so thatthey can run. Process may come into this state after Start state or while runningit by but interrupted by the scheduler to assign CPU to some other process. 

Once the process has been assigned to a processor by the OS scheduler, theprocess state is set to running and the processor executes its instructions. Process moves into the waiting state if it needs to wait for a resource, such aswaiting for user input, or waiting for a file to become available.

Terminated or Exit

Ready


Once the process finishes its execution, or it is terminated by the operatingsystem, it is moved to the terminated state where it waits to be removed frommain memory.

Running


Once the process has been assigned to a processor by the OS scheduler. 

Waiting


Process Control Block is a data structure that containsinformation of the process related to it. The process control block is also known as a task controlblock, entry of the process table, etc. It is very important for process management as the data
structuring for processes is done in terms of the PCB. 

Structure of the Process Control Block

 
Process Control Block (PCB) The process control stores many data items that are needed for efficient process management. 
Some of these data items are explained with the help of thegiven diagramstructuring for processes is done in terms of the PCB. 

Structure of PCB 


Process State


This specifies the process state i.e. new, ready, running,waiting or terminated. 

Process Number


This shows the number of the particular process. 
This contains the address of the next instruction that needsto be executed in the process. 
PCB continue This specifies the registers that are used by the process.They may include accumulators, index registers, stackpointers, general purpose register.


PCB Continue 

List of Open Files

These are the different files that are associated with the processCPU Scheduling Information
 
The process priority, pointers to scheduling queues etc. is the  CPU scheduling information that is contained in the PCB. This may also include any other scheduling parameters. 

Memory Management Information


The memory management information includes the page tables or the segment tables depending on the memory system used. It also contains the value of the base registers, limit registers etc.
The memory management information includes the page tables 

I/O Status Information 


This information includes the list of I/O devices used by the  process, the list of files etc.
 

Accounting information

 
The time limits, account numbers, amount of CPU used, process numbers etc. are all a part of the PCB accounting information.

User interface


The features of a computer system which allows theuser to interact with it. A user interface, also sometimes called a human-computer interface,comprises both hardware and software components. 

 It handles the interaction between the user and the system. 
 

The types of user interface are as follows 

 
  • command line (cli).
  • graphical user interface (GUI).
  • menu driven(mdi).

Command Line Interface

 
User Operating System Interface Command line interfaces are the oldest of the interfaces discussed here.

It involves the computer responding to commands typed by the operator.This type of interface has the drawback that it requires the operator toremember a range of different commands and is not ideal for novice
command line (cli), graphical user interface (GUI), menu driven(mdi)users.


Graphical User Interface


The graphical user interface is the most popular user interface A GUI uses windows, menus and icons to execute commands.  A mouse is the most common way to navigate through a GUI,although many GUIs allow navigation and execution via a

The advantage of a GUI is the interface visually displays the available functions. Graphical user interfaces (GUI) are sometimes also referred toas WIMP because they use Windows, Icons, Menus and Operators use a pointing device (such as a mouse, touchpad ortrackball) to control a pointer on the screen which then interactswith other on-screen elements.
today. 

keyboard. 
Pointers. 


System Calls


System calls provides an interface to the services made available by an operating System calls are usually made when a process in user mode requires access to a Then it requests the kernel to provide the resource via a system call.  System call is the programmatic way in which a computer program requests a
These calls are generally available as functions written in C and C++
system. 
resource. 

service from the kernel of the OS 





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 After the execution of the system call, the control returns to theuser mode and execution of user processes can be resumed. 

Access to a hardware devices such as a printer, scanner etc.requires a system call.  If a file system requires the creation or deletion of files.Reading and writing from files also require a system call.  Creation and management of new processes. Network connections also require system calls. This includessending and receiving packets.
mode. 

In general, system calls are required in the following situations: In general, system calls are required in the following situations:


Introduction to Linux


Linux is an open-source operating system like other operatingsystems such as Microsoft Windows, Apple Mac OS, iOS, Googleandroid, etc. An operating system is a software that enables the communicationbetween computer hardware and software. It conveys input to get processed by the processor and brings outputto the hardware to display it. This is the basic function of anoperatingsystem. 
to the hardware to display it. This is the basic function of anoperatingsystem.

Evolution of Linux OS


The Linux OS was developed by Linus
Torvalds in 1991, whichsprouted as an idea to improve the UNIX OS.  He suggested improvements but was rejected by UNIX designers.Therefore, he thought of launching an OS, designed in a way thatcould be modified by its users. Nowadays, Linux is the fastest-growing OS. It is used from phones tosupercomputers by almost all major hardware devices.


Multiuser capability


Multiple users can access the same system resources likememory, hard disk, etc. But they have to use different terminals to operate. 

Multitasking


More than one function can be performed simultaneously by dividingthe CPU time intelligently.

Portability


Portability doesn't mean it is smaller in file size or can be carried in pendrives or memory cards. It means that it support different types of hardware. 

Security


It provides security in three ways namely authenticating (by assigningpassword and login ID), authorization (by assigning permission to read, write andexecute) and encryption (converts file into an unreadable format). 

 Live CD/USB: Almost all Linux distros provide live CD/USBso that userscanrun/try it without installing it. 6. Graphical User Interface (X Window system): Linux is command line based OSbut it can be converted to GUI based by installing packages. 
 

Features of Linux 


 Support's customized keyboard

 
As it is used worldwide, hence supports differentlanguages keyboards. 

Application support


It has its own software repository from where users candownload and install many applications. 

File System


Provides hierarchical file system in which files and directories arearranged. 

Open Source


Linux code is freely available to all and is a community based.development p. Live CD/USB: Almost all Linux distros provide live CD/USBso that userscan
The architecture of a Linux System consists of the following layers − 

Architecture of Linux 


Hardware layer


Hardware consists of all peripheral devices (RAM/ HDD/CPU/Printers etc). 

The following illustration shows the architecture of a Linux system − It is the core component of Operating System, interacts directly with hardware,provides low level services to upper layer components. 
Application Layer 
Shell 

Linux kernel is the core part of the operating system. It establishes communicationbetween devices and software. Moreover, it manages system resources. It has four
Kernel 
Hardware 


Responsibilities of Kernel


Device Management


A system has many devices connected to it like CPU, a memory device, sound cards,graphic cards, etc. A kernel stores all the data related to all the devices in the device driver (without thiskernel won't be able to control the devices). Thus kernel knows what a device can do and how to manipulate it to bring out the bestperformance. It also manages communication between all the devices. The kernel has certain rules thathave to be followed by all the devices.
 

Memory management


Another function that kernel has to manage is the memory management. The kernel keeps track of used and unused memory and makes sure that processesshouldn't manipulate data of each other using virtual memory addresses. 

Process management

 
In the process, management kernel assigns enough time and gives priorities to processesbefore handling CPU to other processes. It also deals with security and ownership information. 

Handling system calls


Handling system calls means a programmer can write a query or ask the kernel toperform a task.have to be followed by all the devices. 

Shell/System Libraries

 
An interface to kernel, hiding complexity of kernel's functions from users. The shelltakes commands from the user and executes kernel's functions. System libraries are special programs that help in accessing the kernel's features. A kernel has to be triggered to perform a task.

Application Layer

 
Some examples of end tools are graphic design tools, office suites, browsers,multimedia players, etc.
applications. 

End tools are not required for the operating system but are necessary for a user.  End tools are not required for the operating system but are necessary for a user. 

A file system is the way in which files are named, stored, retrieved as wellas updated on a storage disk or partition. It is the way files are organized on the disk. 

A file system is a logical collection of files on a partition or disk. Linux File System or any file system generally is a layer that is under theoperating system that handles the positioning of your data on the storage;without it, the system cannot knows which file starts from where and endswhere. 
A file system is divided in two segments called User data and Metadata(Filename, size, creation time, accessed time etc)  Linux supports many file systems. Each of these file systems uses its ownmetadata structures to define how data is stored and accessed. 

Introduction to File System 


Major Filesystem types in linux are Ext3, Ext4, VFAT, Swap etc 

Ext3 and Ext4: Ext stand for Extended file system. These are used to create and access logical volume. 

VFAT: It is similar to File Allocation Table(FAT) of Windows and stands forVirtual File Allocation Table. It is used in external medias like Pendrives and all3. Swap: It is used to create swap area in the hard disk, which can be used asvirtual memory. A file system is divided in two segments called User data and Metadata(File

File Types


It refers to the ability of OS to distinguish different types of files such astext, source file, binary files etc.

Ordinary Files: These are the files containing user information. These are text,databases or executable program.

Directory Files: These file contains list of file names and other information related tothese files.

Special Files: These are known as device files. These files represents physical devicelike disks, terminals, printers, networks etc.

Process Environment
Process environment also called process context, contains the address space of a process. 

Menu card just for you !

Select Your favourite topic to learn.

Comments

Trending⚡

Understanding link.click() in JavaScript

Hey! Today i am going to share with you how to use link.click() function in javascript As a JavaScript developer, you may come across the need to programmatically click a link on a web page. The link.click() method is a commonly used way to do this, and it is important to understand how it works and when to use it. What is link.click()? link.click() is a method that can be used to simulate a click on a link element in JavaScript. It is typically used when you want to trigger a link click event programmatically, rather than requiring the user to physically click the link. How to use link.click() Using link.click() is relatively straightforward. First, you need to select the link element you want to click using a DOM selector such as getElementById() or querySelector(). Then, you can call the click() method on the link element to simulate a click. Here is an example: // select the link element const myLink = document.getElementById('my-link'); // simulate a cl...

How to Create Studio Ghibli-Style AI Images on ChatGPT for Free

How to Create Studio Ghibli-Style AI Images on ChatGPT for Free AI-generated art is making waves across the internet, captivating audiences with stunning, ethereal visuals inspired by the iconic animation style of Studio Ghibli . These AI-crafted images, from dreamy landscapes to expressive characters, reflect the timeless magic of Hayao Miyazaki ’s beloved films such as Spirited Away , My Neighbor Totoro , and Howl’s Moving Castle . Thanks to recent advancements in AI technology, particularly OpenAI ’s latest ChatGPT update, users can now create their own Studio Ghibli-inspired illustrations effortlessly by entering simple text prompts. This exciting feature is transforming digital art creation and making it accessible to both professionals and beginners. In this article, we’ll guide you through creating Ghibli-style AI images using ChatGPT and explore free alternatives for users who don’t yet have access to this feature. Ghibli AI generator free Step-by-Step Guide: How to Crea...

Value Model vs Reference Model

Value Model vs Reference Model In programming languages, two different models are used for variables.  These are:  Value Model  A variable contains a value. The name of the variable gives its value.  Reference Model A variable contains (say y) refers to another variable (say x) with a value. The variable ‘y’ is used to access the value of ‘x’ indirectly.  The ‘C’ language is based on value model. However, by using pointers, we can implement the reference model. The pointer is used to access the value of a variable indirectly. Also Read Static and Dynamic Memory Allocation Memory Leak and Dangling Pointer Memory Allocation for 2D Array Dynamic Memory Allocation Pointer Constant and Constant Pointer Pointer Declarations and their Meanings Functions and Pointers Initializing Pointer to Pointer Pointer to Pointer Multiple Indirection Relationship between Array and Pointer Pointer to Array Pointer Arithmetic Types of Pointer Illustrat...

How to write programs in Bhai language

Bhai Language Bhai language is fun Programming language , with this language you can makes jokes in hindi. Bhai language written in typescript. It's very funny , easy and amazing language. Keywords of this language written in Hindi . Starting and ending of the program Start program with keyword " hi bhai " and end with " bye bhai ". It's compulsory to add this keyword before starting and end on the program. You write your programming logic inside this hi bhai and bye bhai . How to declare variables in Bhai language We use " bhai ye hai variable_name" keyword for declaring variables. In javascript we use var keyword for declaring variables but here you have to use " bhai ye hai " keyword. If you are declaring string then use " " double quotes. You can use Boolean variable like sahi and galat for true and false . How to print output in Bhai language You have to use " bol bhai " keyword for ...

ChatGPT Now Allows Free Users to Create Ghibli-Style AI Images – Here’s How

OpenAI has finally expanded its native image generation feature to free ChatGPT users, allowing them to transform images into stunning Studio Ghibli-style artwork . While the company has yet to make an official announcement, multiple tests using free ChatGPT accounts confirm that the feature is now accessible without requiring a paid subscription. Ghibli AI Images Now Available for Free Users Previously, OpenAI restricted its image generation capabilities to ChatGPT Plus, Pro, and Team users. This led free-tier users to seek alternatives like xAI’s Grok and Google’s Gemini . However, these tools often lacked the same level of detail and artistic refinement as OpenAI’s model. Now, with the rollout extending to free users, everyone can experience the magic of Ghibli-style AI transformations. How to Create Ghibli-Style AI Images with ChatGPT If you want to turn your photos into Ghibli-inspired masterpieces, follow these simple steps: Visit ChatGPT – Open the ChatGPT website or...

Quiz tells you what type of wife you want

What Type of Wife are You Looking For? Attend this quiz and know your wife expections Quiz reveals type of wife you expect, lets answer carefully... Personality Questions: 1. What type of personality are you looking for in a wife? Quiet and reserved Outgoing and social Intelligent and witty 2. What type of sense of humor are you looking for in a wife? Dry and sarcastic Witty and clever Playful and silly 3. What type of interests are you looking for in a wife? Intellectual and educational Creative and artistic Athletic and outdoorsy Values Questions: 4. What type of family values are you looking for in a wife? Traditional and conservative Open-minded and progressive Balanced and equal 5. What type of political views...