An Overview of Operating Systems

Operating Systems: Introduction

An Operating System (OS) is the backbone of any computing device, managing both hardware and software resources to ensure smooth functionality. It acts as an intermediary between users and the system’s underlying complexities, allowing programs to run efficiently while handling resource allocation, security, and process execution. In this blog, we’ll dive deep into its core functions, modes, and the essential concepts of abstraction and arbitration that make multitasking and resource management seamless.

What is an Operating System?

An Operating System manages all the computer’s resources, including hardware and software. It provides an environment in which a user can execute his/her programs conveniently and efficiently by hiding the hardware’s underlying complexities and acting as a Resource Manager.

Functions of Operating Systems

It has access to the computer hardware.
OS acts as an interface between the user programs and the resources.
It facilitates the execution of the programs by providing protection and isolation.
Abstraction, also known as it, conceals the system hardware’s hidden complexity. OS handles resource management, also known as arbitration (Memory/RAM, CPU/GPU, Disk, etc.). What is Abstraction?
Abstraction simply means hiding the working complexity or technical details of the system. The operating system provides a level of abstraction or a layer of abstraction with the help of OSAL. OSAL stands for Operating System Abstraction Layer, a set of application programming interfaces (APIs) that a developer can use to quickly develop an application without considering the type of operating system, hardware, and background complexity of the operating system.

What is Arbitration?

Arbitration in an Operating System is a set of rules that allocate machine resources, such as memory or peripheral devices, to multiple users or programs. It acts as a controller to divide hardware resources into the running processes or apps. Arbitration helps to create a more efficient and adequate multitasking environment in the OS. It also enforces system and security policies to isolate apps from interfering with each other. For example, arbitration can prevent a software crash from affecting other running software.
An operating system uses various memory management techniques such as Paging or Segmentation.

Paging

Paging is a technique that divides memory into fixed-sized blocks. The main memory is divided into blocks known as Frames and the logical memory is divided into blocks known as Pages.

Segmentation

The user program and secondary memory are divided into segments, or blocks of varying sizes.

Modes of Operating System

Operating systems have different operating modes to fulfil the need to run the application or compute a process as per user inputs. These modes define the level of access and privileges granted to execute tasks.

Kernel mode

A kernel is referred to as the heart of an operating system. It interacts with the hardware to compute the processes. A kernel is also the first thing an operating system loads when a machine starts.

Key points to remember: –

Kernel mode is the most privileged mode in an operating system.
In this mode, the operating system kernel has unrestricted access to all resources, including memory and I/O devices.
The kernel can execute any CPU instruction.
Kernel mode is responsible for critical system tasks such as memory management, process scheduling, and handling interrupts.
If a process running in kernel mode encounters an error, it can crash the entire system.

User mode

All the application software runs in this mode, these applications don’t have privileged access to the underlying hardware, to execute them, to do so they have to interact with the Kernel.
E.g: Graphical User Interfaces and Command Line Interfaces.
Also Explore: 12 Exciting Software Development Project Ideas [With Source Code]
Important reminders: User mode is a less privileged mode compared to kernel mode.
Processes running in user mode have limited access to system resources and are restricted from performing sensitive operations directly.
User-mode applications cannot access memory locations or execute instructions that could potentially harm the system.
To access system resources or perform privileged operations, user mode processes must make system calls to the operating system kernel.
If a process running in user mode encounters an error, it is isolated from other processes and cannot affect the entire system.

Conclusion

Operating Systems are essential for optimizing computing resources, ensuring security, and enhancing user experience. By abstracting hardware complexities and implementing arbitration techniques, an OS ensures smooth multitasking, efficient memory management, and secure process execution. Understanding its working principles, from kernel vs. user mode to memory management techniques, helps developers and IT professionals build better systems and applications. As technology advances, operating systems continue to evolve, adapting to new computing needs and innovations.