Practice
Data Structures and Algorithms
Machine Coding Round (LLD)
System Design & Architecture (HLD)
Frontend UI Machine Coding
Resources
Career Advice and Roadmaps
Data Structures and Algorithms
Machine Coding Round (LLD)
System Design & Architecture (HLD)
Backend Development
Frontend Development
Project Ideas for Software Developers
Core Computer Science
Companies
SDE Jobs & Internships
Interview Questions
Compare Companies
IDE
Online IDE
Collaborative IDE

Introduction to Operating Systems (OS) | Core Computer Science

Gaurav Chandak
Gaurav Chandak

What is an Operating System?

An Operating System (OS) is an interface over the computer hardware that lets users interact with the hardware with ease. The OS is a software that allows the user to do file management, device management, computation, etc, and also takes care of resource allocation, memory management, process management, etc.

Applications of an Operating System

The major applications of an operating system are:

  • Process Management
  • Memory Management
  • Device Management
  • File Management
  • Others (Security, Coordination, Accounting, etc)

Let's try to understand more about the major applications.

Process Management

The OS decides which process gets processed when and for how much time through process scheduling. It also helps different processes coordinate when they are working with shared resources and data. It also takes care of handling deadlock scenarios where one process is waiting on the other process to release a resource and vice versa.

Memory Management

The OS tracks the status of each memory location and decides which process is allocated which memory locations, when, and for how long.

Device Management

The OS manages communication with devices through drivers. It tracks the status of each device and decides which process gets to communicate with the device, when, and for how long.

File Management

The OS allows users or programs to create, read, update or delete files and directories. It also keeps track of all the meta details about the files and directories through a file system.

Services provided by an Operating System

An Operating System provides different services to the users and the programs. The common services provided by an operating system are:

  • Program Execution: The OS allows program execution by creating a process for every program that the user wants to execute including the applications that the user uses.
  • Input/Output Operations: The OS handles the input-output operations through device drivers. The drivers help create an abstraction over actual system operations by allowing us to interact with the system using user-friendly devices.
  • File System Management: The OS allows the users to create, read, update or delete files and directories. It also allows setting access controls on the files and directories.
  • Communication: The OS allows communication between different processes through Inter-Process Communication (IPC).
  • Error Detection and Handling: An error can happen in the hardware (CPU, RAM, I/O devices, etc) or any of the software. The OS detects and handles the error so that the user can use the system.
  • Resource Allocation and Management: The OS manages all the resources like memory, CPU, storage, etc, and decides which resource is allocated which resource, when, and for how long.
  • Accounting: The OS accounts and tracks all the activities including the errors happening on the computer.
  • Security and Protection: The OS provides security and protection through different security and access control functionalities to save the data from getting stolen or corrupted by malware.

Kernel, Booting, and System Calls

The kernel is the core part of the operating system. It facilitates interactions between the hardware and the software and has complete control over everything.

On most systems, it is loaded at boot time (when the computer starts). The kernel is usually loaded after certain tests are done by the OS. After the kernel is loaded, it takes care of the rest of the booting.

A system call is an interface through which programs request services from the kernel. The services could be something like creating new processes, scheduling processes, interacting with hardware, etc.

Multiprogramming, Multitasking, and Multiprocessing

Multiprogramming is a technique through which a CPU can execute multiple jobs thereby increasing CPU utilization. This is generally done by keeping multiple jobs in the memory and then using some scheduling algorithm to decide which job is picked when.

Multitasking is an extension of multiprogramming in which more than one job is done at the same time. This is done by switching between tasks based on the user interaction or based on assigned time. The switching is very fast, so we do not see any lag when switching between different applications.

Multiprocessing is a technique in which there are two or more CPUs (processors) within the same computer. This allows us to run different processes on the same computer at the same time. There are certain components shared between the different processors like memory, clock, etc.

7
Gaurav Chandak
Gaurav Chandak
Gaurav is the co-founder of workat.tech and has previously worked at Flipkart and Microsoft. He intends to actively contribute to the future of education through workat.tech.
SDE Bootcamp - Become a software engineer at a product-based company
Practice Data Structures & Algorithms
Learning Resources
Interview Prep Resources
Blog
  • Career Advice and Roadmaps
  • Data Structures & Algorithms
  • Machine Coding Round (LLD)
  • System Design & Architecture
  • Backend Development
  • Frontend Development
  • Awesome Project Ideas
  • Core Computer Science
Practice Questions
  • Machine Coding (LLD) Questions
  • System Design (HLD) Questions
  • Topic-wise DSA Questions
  • Company-wise DSA Questions
  • DSA Sheets (Curated Lists)
  • JavaScript Interview Questions
  • Frontend UI Machine Coding Questions
Online Compilers (IDE)
  • Online Java Compiler
  • Online C++ Compiler
  • Online C Compiler
  • Online Python Compiler
  • Online JavaScript Compiler
Topic-wise Problems
  • Dynamic Programming Interview Questions
  • Linked List Interview Questions
  • Graph Interview Questions
  • Backtracking Interview Questions
  • Arrays Interview Questions
  • Trees Interview Questions
Company-wise Problems
  • Amazon Interview Questions
  • Microsoft Interview Questions
  • Google Interview Questions
  • Flipkart Interview Questions
  • Adobe Interview Questions
  • Facebook Interview Questions
DSA Sheets (Curated Lists)
  • Top Interview Questions
  • FAANG Interview Questions
  • Most Asked Interview Questions
  • 6 month DSA Practice Sheet
  • 3 month DSA Practice Sheet
  • Last minute DSA Practice Sheet