• Home
  • /
  • Blog
  • /
  • Structure of Operating System(With Functions & Advantages)

Structure of Operating System(With Functions & Advantages)

functions of os

This post is also available in: हिन्दी (Hindi) العربية (Arabic)

If you go to a country whose native language you don’t know, what would you need to communicate with locals? Of course, an interpreter/translator. The operating system plays the same role between you and the computer. An operating system converts 1s and 0s values into a readable language that you can understand.

There are some very critical functions of OS without which you cannot even start a computer system. 

What is an Operating System?

An Operating System (OS) is an interface between a computer user and computer hardware. An operating system is a collection of software that manages computer hardware and provides services for programs. It performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives, keyboards, mouse, and printers.


Get Instant Access To 

Coding For Kids eBook

A must read for every parent

  • Afghanistan 93
  • Albania 355
  • Algeria 213
  • American Samoa 1-684
  • Andorra 376
  • Angola 244
  • Anguilla 1-264
  • Antarctica 672
  • Antigua & Barbuda 1-268
  • Argentina 54
  • Armenia 374
  • Aruba 297
  • Australia 61
  • Austria 43
  • Azerbaijan 994
  • Bahamas 1-242
  • Bahrain 973
  • Bangladesh 880
  • Barbados 1-246
  • Belarus 375
  • Belgium 32
  • Belize 501
  • Benin 229
  • Bermuda 1-441
  • Bhutan 975
  • Bolivia 591
  • Bosnia 387
  • Botswana 267
  • Bouvet Island 47
  • Brazil 55
  • British Indian Ocean Territory 246
  • British Virgin Islands 1-284
  • Brunei 673
  • Bulgaria 359
  • Burkina Faso 226
  • Burundi 257
  • Cambodia 855
  • Cameroon 237
  • Canada 1
  • Cape Verde 238
  • Caribbean Netherlands 599
  • Cayman Islands 1-345
  • Central African Republic 236
  • Chad 235
  • Chile 56
  • China 86
  • Christmas Island 61
  • Cocos (Keeling) Islands 61
  • Colombia 57
  • Comoros 269
  • Congo - Brazzaville 242
  • Congo - Kinshasa 243
  • Cook Islands 682
  • Costa Rica 506
  • Croatia 385
  • Cuba 53
  • Cyprus 357
  • Czech Republic 420
  • Denmark 45
  • Djibouti 253
  • Dominica 1-767
  • Ecuador 593
  • Egypt 20
  • El Salvador 503
  • Equatorial Guinea 240
  • Eritrea 291
  • Estonia 372
  • Ethiopia 251
  • Falkland Islands 500
  • Faroe Islands 298
  • Fiji 679
  • Finland 358
  • France 33
  • French Guiana 594
  • French Polynesia 689
  • French Southern Territories 262
  • Gabon 241
  • Gambia 220
  • Georgia 995
  • Germany 49
  • Ghana 233
  • Gibraltar 350
  • Greece 30
  • Greenland 299
  • Grenada 1-473
  • Guadeloupe 590
  • Guam 1-671
  • Guatemala 502
  • Guernsey 44
  • Guinea 224
  • Guinea-Bissau 245
  • Guyana 592
  • Haiti 509
  • Heard & McDonald Islands 672
  • Honduras 504
  • Hong Kong 852
  • Hungary 36
  • Iceland 354
  • India 91
  • Indonesia 62
  • Iran 98
  • Iraq 964
  • Ireland 353
  • Isle of Man 44
  • Israel 972
  • Italy 39
  • Jamaica 1-876
  • Japan 81
  • Jersey 44
  • Jordan 962
  • Kazakhstan 7
  • Kenya 254
  • Kiribati 686
  • Kuwait 965
  • Kyrgyzstan 996
  • Laos 856
  • Latvia 371
  • Lebanon 961
  • Lesotho 266
  • Liberia 231
  • Libya 218
  • Liechtenstein 423
  • Lithuania 370
  • Luxembourg 352
  • Macau 853
  • Macedonia 389
  • Madagascar 261
  • Malawi 265
  • Malaysia 60
  • Maldives 960
  • Mali 223
  • Malta 356
  • Marshall Islands 692
  • Martinique 596
  • Mauritania 222
  • Mauritius 230
  • Mayotte 262
  • Mexico 52
  • Micronesia 691
  • Moldova 373
  • Monaco 377
  • Mongolia 976
  • Montenegro 382
  • Montserrat 1-664
  • Morocco 212
  • Mozambique 258
  • Myanmar 95
  • Namibia 264
  • Nauru 674
  • Nepal 977
  • Netherlands 31
  • New Caledonia 687
  • New Zealand 64
  • Nicaragua 505
  • Niger 227
  • Nigeria 234
  • Niue 683
  • Norfolk Island 672
  • North Korea 850
  • Northern Mariana Islands 1-670
  • Norway 47
  • Oman 968
  • Pakistan 92
  • Palau 680
  • Palestine 970
  • Panama 507
  • Papua New Guinea 675
  • Paraguay 595
  • Peru 51
  • Philippines 63
  • Pitcairn Islands 870
  • Poland 48
  • Portugal 351
  • Puerto Rico 1
  • Qatar 974
  • Romania 40
  • Russia 7
  • Rwanda 250
  • Réunion 262
  • Samoa 685
  • San Marino 378
  • Saudi Arabia 966
  • Senegal 221
  • Serbia 381 p
  • Seychelles 248
  • Sierra Leone 232
  • Singapore 65
  • Slovakia 421
  • Slovenia 386
  • Solomon Islands 677
  • Somalia 252
  • South Africa 27
  • South Georgia & South Sandwich Islands 500
  • South Korea 82
  • South Sudan 211
  • Spain 34
  • Sri Lanka 94
  • Sudan 249
  • Suriname 597
  • Svalbard & Jan Mayen 47
  • Swaziland 268
  • Sweden 46
  • Switzerland 41
  • Syria 963
  • Sao Tome and Principe 239
  • Taiwan 886
  • Tajikistan 992
  • Tanzania 255
  • Thailand 66
  • Timor-Leste 670
  • Togo 228
  • Tokelau 690
  • Tonga 676
  • Trinidad & Tobago 1-868
  • Tunisia 216
  • Turkey 90
  • Turkmenistan 993
  • Turks & Caicos Islands 1-649
  • Tuvalu 688
  • U.S. Outlying Islands
  • U.S. Virgin Islands 1-340
  • UK 44
  • US 1
  • Uganda 256
  • Ukraine 380
  • United Arab Emirates 971
  • Uruguay 598
  • Uzbekistan 998
  • Vanuatu 678
  • Vatican City 39-06
  • Venezuela 58
  • Vietnam 84
  • Wallis & Futuna 681
  • Western Sahara 212
  • Yemen 967
  • Zambia 260
  • Zimbabwe 263
How Old Is Your Child?
  • Less Than 5 Years
  • 5 - 8 Years
  • 9 - 13 Years
  • 14 - 18 Years
  • 18+ Years

Some popular Operating Systems include Linux Operating System, Windows Operating System, VMS, OS/400, AIX, z/OS, etc.

Functions of OS

Following are some of the important functions of an operating system.

Memory Management

Memory Management is the process of controlling and coordinating computer memory, assigning portions known as blocks to various running programs to optimize the overall performance of the system.

It is the most important function of an operating system that manages primary memory. It helps processes to move back and forward between the main memory and execution disk. It helps the OS to keep track of every memory location, irrespective of whether it is allocated to some process or it remains free.

Why is memory management needed?

Following are the reasons for using memory management:

  • It allows you to check how much memory needs to be allocated to processes that decide which processor should get memory at what time.
  • Tracks whenever inventory gets freed or unallocated. According to it will update the status.
  • It allocates the space to application routines.
  • It also makes sure that these applications do not interfere with each other.
  • Helps protect different processes from each other
  • It places the programs in memory so that memory is utilized to its full extent.

To manage the memory efficiently, several techniques called Memory Management Techniques are used. Some of the most commonly used memory management techniques are:

Single Contiguous Allocation

It is the easiest memory management technique. In this method, all types of computer memory except a small portion that is reserved for the OS are available for one application. For example, MS-DOS operating system allocates memory in this way. An embedded system also runs on a single application.

Operating System
Contiguous Memory Allocation

Partitioned Allocation

It divides primary memory into various memory partitions, which are mostly contiguous areas of memory. Every partition stores all the information for a specific task or job. This method consists of allotting a partition to a job when it starts & unallocated it when it ends.

Operating System
Partitioned Allocation

Paged Memory Management

This method divides the computer’s main memory into fixed-size units known as page frames. This hardware memory management unit maps pages into frames which should be allocated on a page basis.

Segmented Memory Management

Segmented memory is the only memory management method that does not provide the user’s program with a linear and contiguous address space.

Segments need hardware support in the form of a segment table. It contains the physical address of the section in memory, size, and other data like access protection bits and status.

Processor Management

In the case of a multiprogramming environment system gets multiple programs for execution and the operating system has to decide which program should be sent to the CPU for execution and for how much time. This process is called process scheduling in which the operating system decides which process needs to get into the CPU for execution and how much time span is required.

Assigning and de-assigning of the process is in charge of the operating system. CPU can execute one single process at a time so its selection is done by the operating system. The operating system uses a separate program to hold the status of the processor to provide information about is it free or busy in process execution. The traffic controller is used to keep the processor’s status information.

If the processor or CPU already has a process that is currently being executed, then the operating system does not let any other process get into the CPU for execution in this condition process sets into a wait condition. Assigning a processor or CPU to a process is called processor allocation. When a CPU executes a process it has to deallocate that process.

The process of completion of a program or process under the execution of CUP is called as deallocation of the processor because the processor transfers the processed information to the user. In this case, the processor gets free from the process and is ready to get a new process for execution. In the case of processor management operating system performs the following activities:

  • It keeps the track of processor status and the processor itself. (The program which is responsible for this task is called as traffic controller)
  • Allocates the processor or CPU to a Process.
  • Deallocates the processor or CPU by a process.

Structure of a Process

Following is the structure of a process. 

  • Stack: The Stack stores temporary data like function parameters, returns addresses, and local variables.
  • Heap: It Allocates memory, which may be processed during its run time.
  • Data: It contains the variable.
  • Text: The text Section includes the current activity, which is represented by the value of the Program Counter.
Operating System
Structure of a Process

Process States

A process state is a condition of the process at a specific instant of time. It also defines the current position of the process. Every process can be in either of the following seven states:

  • New: The new process is created when a specific program calls from secondary memory/ hard disk to primary memory/ RAM.
  • Ready: In a ready state, the process should be loaded into the primary memory, which is ready for execution.
  • Waiting: The process is waiting for the allocation of CPU time and other resources for execution.
  • Executing: The process is an execution state.
  • Blocked: It is a time interval when a process is waiting for an event like I/O operations to complete.
  • Suspended: Suspended state defines the time when a process is ready for execution but has not been placed in the ready queue by OS.
  • Terminated: Terminated state specifies the time when a process is terminated.
functions of os
Process States

After completing every step, all the resources are used by a process, and memory becomes free.

Representation of a Process

Every process is represented in the operating system by a process control block (PCB), which is also called a task control block. Here, are the important components of PCB:

  • Process state: A process can be new, ready, running, waiting, etc.
  • Program counter: The program counter lets you know the address of the next instruction, which should be executed for that process.
  • CPU registers: This component includes accumulators, index and general-purpose registers, and information of condition code.
  • CPU scheduling information: This component includes a process priority, pointers for scheduling queues, and various other scheduling parameters.
  • Accounting and business information: It includes the amount of CPU and time utilities like real-time used, job or process numbers, etc.
  • Memory-management information: This information includes the value of the base and limit registers, the page, or segment tables. This depends on the memory system, which is used by the operating system.
  • I/O status information: This block includes a list of open files, the list of I/O devices that are allocated to the process, etc.

Device Management

Device management in the operating system implies the management of the I/O devices such as a keyboard, magnetic tape, disk, printer, microphone, USB ports, scanner, camcorder, etc. as well as the supporting units like control channels. The basics of I/O devices can fall into 3 categories:

  • Block device: It stores information in fixed-size blocks, each one with its address. e.g., disks.
  • Character device: Delivers or accepts a stream of characters. The individual characters are not addressable. For example printers, keyboards, etc.
  • Network device: For transmitting data packets.

Functions of Device Management in the Operating System

An operating system or the OS manages communication with the devices through their respective drivers. The operating system component provides a uniform interface to access devices of varied physical attributes. For device management in an operating system:

  • Keep tracks of all devices and the program which is responsible to perform this is called the I/O controller.
  • Monitoring the status of each device such as storage drivers, printers, and other peripheral devices.
  • Enforcing preset policies and taking a decision which process gets the device when and for how long.
  • Allocates and efficiently deallocates the device. De-allocating them at two levels: at the process level when the I/O command has been executed and the device is temporarily released, and at the job level, when the job is finished and the device is permanently released.
  • Optimizes the performance of individual devices.

Types of Devices

The OS peripheral devices can be categorized into 3: Dedicated, Shared, and Virtual. The differences among them are the functions of the characteristics of the devices as well as how they are managed by the Device Manager.

  • Dedicated Devices: Such type of devices is dedicated or assigned to only one job at a time until that job releases them. Devices like printers, tape drivers, plotters, etc. demand such allocation scheme since it would be awkward if several users share them at the same point in time. The disadvantage of such kinds of devices is the inefficiency resulting from the allocation of the device to a single user for the entire duration of job execution even though the device is not put to use 100% of the time.
  • Shared Devices: These devices can be allocated to several processes. A disk can be shared among several processes at the same time by interleaving their requests. The interleaving is carefully controlled by the Device Manager and all issues must be resolved based on predetermined policies.
  • Virtual Devices: These devices are the combination of the first two types and they are dedicated devices that are transformed into shared devices. For example, a printer converted into a shareable device via spooling program which re-routes all the print requests to a disk. A print job is not sent straight to the printer, instead, it goes to the disk(spool) until it is fully prepared with all the necessary sequences and formatting, then it goes to the printers. This technique can transform one printer into several virtual printers which leads to better performance and use.

File Management

File management is one of the basic and important features of an operating system. The operating system is used to manage files of a computer system. All the files with different extensions are managed by the operating system.

A file is a collection of specific information stored in the memory of a computer system. File management is defined as the process of manipulating files in a computer system, its management includes the process of creating, modifying, and deleting the files.

The following are some of the tasks performed by file management of operating system of any computer system:

  1. It helps to create new files in the computer system and placing them at specific locations.
  2. It helps in easily and quickly locating these files in a computer system.
  3. It makes the process of sharing the files among different users very easy and user-friendly.
  4. It helps to stores the files in separate folders known as directories. These directories help users to search files quickly or to manage the files according to their types of uses.
  5. It helps the user to modify the data of files or to modify the name of the file in the directories.

The file management of function in an operating system (OS) is based on the following concepts:

  • File Attributes: It specifies the characteristics of the files such as type, date of last modification, size, location on disk, etc. file attributes help the user to understand the value and location of files. File attributes are one most important features. It is used to describe all the information regarding a particular file.
  • File Operations: It specifies the task that can be performed on a file such as opening and closing of a file.
  • File Access permission: It specifies the access permissions related to a file such as read and write.
  • File Systems: It specifies the logical method of file storage in a computer system. Some of the commonly used file systems include FAT and NTFS.


Security refers to providing a protection system to computer system resources such as CPU, memory, disk, software programs, and most importantly data/information stored in the computer system. If a computer program is run by an unauthorized user, then he/she may cause severe damage to the computer or data stored in it. So a computer system must be protected against unauthorized access, malicious access to system memory, viruses, worms, etc. 

  • Authentication
  • One Time passwords
  • Program Threats
  • System Threats


Authentication refers to identifying each user of the system and associating the executing programs with those users. It is the responsibility of the Operating System to create a protection system that ensures that a user who is running a particular program is authentic. Operating Systems generally identifies/authenticates users using the following three ways −

  • Username / Password − User need to enter a registered username and password with Operating system to login into the system.
  • User card/key − User need to punch card in card slot, or enter key generated by key generator in option provided by operating system to login into the system.
  • User attribute – fingerprint/ eye retina pattern/ signature − User need to pass his/her attribute via designated input device used by operating system to login into the system.

One Time passwords

One-time passwords provide additional security along with normal authentication. In the One-Time Password system, a unique password is required every time user tries to login into the system. Once a one-time password is used, then it cannot be used again. One-time passwords are implemented in various ways.

  • Random numbers − Users are provided cards having numbers printed along with corresponding alphabets. System asks for numbers corresponding to few alphabets randomly chosen.
  • Secret key − User are provided a hardware device which can create a secret id mapped with user id. System asks for such secret id which is to be generated every time prior to login.
  • Network password − Some commercial applications send one-time passwords to user on registered mobile/ email which is required to be entered prior to login.

Program Threats

The operating system’s processes and kernel do the designated task as instructed. If a user program made these processes do malicious tasks, then it is known as Program Threats. One of the common examples of a program threat is a program installed in a computer that can store and send user credentials via network to some hacker. Following is the list of some well-known program threats.

  • Trojan Horse − Such program traps user login credentials and stores them to send to malicious user who can later on login to computer and can access system resources.
  • Trap Door − If a program which is designed to work as required, have a security hole in its code and perform illegal action without knowledge of user then it is called to have a trap door.
  • Logic Bomb − Logic bomb is a situation when a program misbehaves only when certain conditions met otherwise it works as a genuine program. It is harder to detect.
  • Virus − Virus as name suggest can replicate themselves on computer system. They are highly dangerous and can modify/delete user files, crash systems. A virus is generatlly a small code embedded in a program. As user accesses the program, the virus starts getting embedded in other files/ programs and can make system unusable for user

System Threats

System threats refer to misuse of system services and network connections to put users in trouble. System threats can be used to launch program threats on a complete network called a program attack. System threats create such an environment that operating system resources/ user files are misused. Following is the list of some well-known system threats.

  • Worm − Worm is a process which can choked down a system performance by using system resources to extreme levels. A Worm process generates its multiple copies where each copy uses system resources, prevents all other processes to get required resources. Worms processes can even shut down an entire network.
  • Port Scanning − Port scanning is a mechanism or means by which a hacker can detects system vulnerabilities to make an attack on the system.
  • Denial of Service − Denial of service attacks normally prevents user to make legitimate use of the system. For example, a user may not be able to use internet if denial of service attacks browser’s content settings.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}