Operatin System Complete Notes
Operatin System Complete Notes
A program that acts as an intermediary between a user of a computer and the computer hardware
or
An Operating System (OS) is a software that manages and handles hardware and software resources of a
computing device.
Operating system goals:
• Responsible for managing and controlling all the activities and sharing of computer resources among
different running applications.
• A low-level Software that includes all the basic functions like processor management, memory
management, file management, etc.
• It mainly acts a government for your system that has different departments to manage different
resources.
Some examples of operating systems are UNIX, Mach, MS-DOS, MS-Windows, Windows/NT, Chicago, OS/2,
MacOS, VMS, MVS, and VM
• Operating system Controls and coordinates use of hardware among various applications and users
• Application programs – define the ways in which the system resources are used to solve the computing
problems of the users Word processors, compilers, web browsers, database systems, video games
1. An Operating System performs all the basic tasks like managing files, processes, and memory.
2. Thus operating system acts as the manager of all the resources, i.e. resource manager. Thus, the
operating system becomes an interface between the user and the machine.
3. It is one of the most required software that is present in the device.
4. Operating System is a type of software that works as an interface between the system program and the
hardware.
5. There are several types of Operating Systems many of which are mentioned below.
There are several types of Operating Systems which are mentioned below.
2. Multi-Programming System
3. Multi-Processing System
1. This type of operating system does not interact with the computer directly.
2. There is an operator which takes similar jobs having the same requirements and groups them into
batches.
3. It is the responsibility of the operator to sort jobs with similar needs.
4. Batch Operating System is designed to manage and execute a large number of jobs efficiently by
processing them in groups.
• It is sometimes costly.
• The other jobs will have to wait for an unknown time if any job fails.
• It is difficult to accurately predict the exact time required for a job to complete while it is in the queue.
Multiprogramming Operating Systems can be simply illustrated as more than one program is present in the main
memory and any one of them can be kept in execution. This is basically used for better utilization of resources.
Advantages of Multi-Programming Operating System
• There is not any facility for user interaction of system resources with the system.
Multi-Processing Operating System is a type of Operating System in which more than one CPU is used for the
execution of resources. It betters the throughput of the System.
• As it has several processors, so, if one processor fails, we can proceed with another processor.
• Due to the multiple CPU, it can be more complex and somehow difficult to understand.
4. Multi-Tasking Operating System
Multitasking Operating System is simply a multiprogramming Operating System with having facility of a Round-
Robin Scheduling Algorithm. It can run multiple programs simultaneously.
1. Each task is given some time to execute so that all the tasks work smoothly.
2. Each user gets the time of the CPU as they use a single system. These systems are also known as
Multitasking Systems.
3. The task can be from a single user or different users also. The time that each task gets to execute is called
quantum. After this time interval is over OS switches over to the next task.
Advantages of Time-Sharing OS
Disadvantages of Time-Sharing OS
• Reliability problem.
• One must have to take care of the security and integrity of user programs and data.
1. These types of operating system are a recent advancement in the world of computer technology and are
being widely accepted all over the world.
2. Various autonomous interconnected computers communicate with each other using a shared
communication network. Independent systems possess their own memory unit and CPU.
3. These are referred to as loosely coupled systems or distributed systems. These systems’ processors differ
in size and function.
4. The major benefit of working with these types of the operating system is that it is always possible that one
user can access the files or software which are not actually present on his system but some other system
connected within this network i.e., remote access is enabled within the devices connected in that
network.
2. Peer-to-Peer Systems
1. Client/Server Systems: Client-Server System is the most basic communication method where the client sends
input to the server and the server replies to the client with an output.
2. Peer-to-Peer Systems: Nodes are an important part of a system. In this, each node performs its task on its local
memory and shares data through the supporting medium, this node can work as a server or as a client for a system.
1. These systems run on a server and provide the capability to manage data, users, groups, security,
applications, and other networking functions.
2. These types of operating systems allow shared access to files, printers, security, applications, and other
networking functions over a small private network.
3. One more important aspect of Network Operating Systems is that all the users are well aware of the
underlying configuration, of all other users within the network, their individual connections, etc. and that’s
why these computers are popularly known as tightly coupled systems.
• Server access is possible remotely from different locations and types of systems.
Examples of Network Operating Systems are Microsoft Windows Server 2003, Microsoft Windows Server 2008,
UNIX, Linux, Mac OS X, Novell NetWare, BSD, etc.
These types of OSs serve real-time systems. The time interval required to process and respond to inputs is very
small. This time interval is called response time. Real-time systems are used when there are time requirements
that are very strict like missile systems, air traffic control systems, robots, etc.
• Hard Real-Time Systems: Hard Real-Time OSs are meant for applications where time constraints are very
strict and even the shortest possible delay is not acceptable.
• Soft Real-Time Systems: These OSs are for applications where time-constraint is less strict.
Advantages of RTOS
• Maximum Consumption: Maximum utilization of devices and systems, thus more output from all the
resources.
Disadvantages of RTOS
• Use heavy system resources: Sometimes the system resources are not so good and they are expensive as
well.
• Complex Algorithms: The algorithms are very complex and difficult for the designer to write on.
Examples of Real-Time Operating Systems are Scientific experiments, medical imaging systems, industrial control
systems, weapon systems, robots, air traffic control systems, etc.
A Mobile Operating System is a software interface designed to manage hardware components and assist
users in utilizing their mobile devices, such as smartphones and tablets, similar to how personal
computers were used in the past.
Android Operating System
1. Android is a mobile operating system based on a modified version of the Linux kernel and other open-
source software, designed primarily for touchscreen mobile devices such as smartphones and tablets.
Android is developed by a partnership of developers known as the Open Handset Alliance and commercially
sponsored by Google.
2. It was disclosed in November 2007, with the first commercial Android device, the HTC Dream, launched in
September 2008.
3. It is free and open-source software. Its source code is Android Open-Source Project (AOSP), primarily
licensed under the Apache License.
A kernel is responsible for accessing computer resources such as RAM and I/O devices
History
1. The iOS was first released in 2007 for the first-generation iPhone and has since been updated to support
more Apple devices, including the iPod Touch and iPad.
2. Apple's App Store had over 2.1 million iOS apps as of March 2018, with 1 million unique to iPads.
3. Over 130 billion times, these mobile applications have been downloaded.
4. Apple releases a new major version of iOS every year.
5. The current version of iOS for iPhone is iOS 18.2, which was released on December 11, 2024.
Chapter 2
Operating Systems Structures
➢ An operating system is a structure that allows the user application programs to interact with the system
hardware.
➢ Since the operating system is such a complex structure, it should be created with utmost care so it can
be used and modified easily.
➢ An easy way to do this is to create the operating system in parts.
➢ Each of these parts should be well defined with clear inputs, outputs and functions.
1. Simple Structure
2. Monolith Structure
3. Micro-Kernel Structure
4. Layered Structure
Simple Structure
1. There are many operating systems that have a rather simple structure.
2. These started as small systems and rapidly expanded much further than their scope.
3. A common example of this is MS-DOS.
4. It was designed simply for a specific users.
5. There was no indication that it would become so popular.
Advantages
Following are advantages of a simple operating system structure.
• Easy Development - In simple operation system, being very few interfaces, development is easy
especially when only limited functionalities are to be delivered.
• Better Performance - Such a system, as have few layers and directly interacts with hardware, can provide
a better performance as compared to other types of operating systems.
Disadvantages
Following are disadvantages of a simple operating system structure.
• Frequent System Failures - Being poorly designed, such a system is not robust. If one program fails,
entries operating system crashes. Thus, system failures are quite frequent in simple operating systems.
• Poor Maintainability - As all layers of operating systems are tightly coupled, change in one layer can
impact other layers heavily and making code unmanageable over a period of time.
Monolith Structure
1. In monolith structured operating system, a central piece of code called kernel is responsible for all major
operations of an operating system. Such operations include file management, memory management,
device management and so on.
2. The kernel is the main component of an operating system and it provides all the services of an operating
system to the application programs and system programs.
3. The kernel has access to the all the resources and it acts as an interface with application programs and
the underlying hardware.
4. A monolithic kernel structure promotes timesharing, multiprogramming model and was used in old
banking systems.
Advantages
• Easy Development - As kernel is the only layer to develop with all major functionalities, it is easier to
design and develop.
• Performance - As Kernel is responsible for memory management, other operations and have direct
access to the hardware, it performs better.
Disadvantages
Following are disadvantages of a monolith operating system structure.
• Crash Prone - As Kernel is responsible for all functions, if one function fails entire operating system fails.
• Difficult to enhance - It is very difficult to add a new service without impacting other services of a
monolith operating system.
Micro-Kernel Structure
1. As in case monolith structure, there was single kernel, in micro-kernel, we have multiple kernels each
one specialized in particular service.
2. Each microkernel is developed independent to the other one and makes system more stable.
3. If one kernel fails the operating system will keep working with other kernel's functionalities.
Advantages
• Reliable and Stable - As multiple kernels are working simultaneously, chances of failure of operating
system are very less. If one functionality is down, operating system can still provide other functionalities
using stable kernels.
• Maintainability - Being small sized kernels, code size is maintainable. One can enhance a microkernel
code base without impacting other microkernel code base.
Disadvantages
• Performance Degradation - Multi kernel, multi-modular communication may reduce the performance as
compared to monolith architecture.
Layered Structure
1. One way to achieve modularity in the operating system is the layered approach.
2. In this, the bottom layer is the hardware and the topmost layer is the user interface.
3. An image demonstrating the layered approach is as follows:
4. As seen from the image, each upper layer is built on the bottom layer. All the layers hide some
structures, operations etc from their upper layers.
5. One problem with the layered structure is that each layer needs to be carefully defined. This is necessary
because the upper layers can only use the functionalities of the layers below them.
Advantages
• High Customizable - Being layered, each layer implementation can be customized easily. A new
functionality can be added without impacting other modules as well.
• Verifiable - Being modular, each layer can be verified and debugged easily.
Disadvantages
• Less Performant - A layered structured operating system is less performant as compared to basic
structured operating system.
• Complex designing - Each layer is to planned carefully as each layer communicates with lower layer only
and a good design process is required to create a layered operating system.
What is a User Interface?
1. User Interface (UI) defines the way humans interact with the information systems.
2. In Layman’s terms, User Interface (UI) is a series of pages, screens, buttons, forms, and other
visual elements that are used to interact with the device.
3. Every app and every website have a user interface.
4. User Interface (UI) Design is the creation of graphics, illustrations, and the use of photographic
artwork to enhance the display and layout of a digital product within its various device views.
Interface elements consist of following Components
➢ input controls (buttons, drop-down menus, data fields),
➢ navigational components (search fields, slider, icons, tags),
➢ informational components (progress bars, notifications, message boxes).
File Management
1. A file system is organized into directories for efficient or easy navigation and usage.
2. These directories may contain other directories and other files.
3. An Operating System carries out the following file management activities.
4. It keeps track of where information is stored, user access settings, the status of every file, and
more.
5. These facilities are collectively known as the file system.
Resource Management
Resource management is the important function of operating system refers to how the OS
handles input and output operations between the computer and external devices, such as keyboards,
mice, printers, hard drives, and monitors.
Security
The operating system uses password protection to protect user data and similar other techniques. it also
prevents unauthorized access to programs and user data.
Deadlock Prevention:
Deadlock is a condition where two or more processes try to access the critical section at the same time
but fail to access it simultaneously or get stuck while accessing the critical section.
Deadlock prevention and avoidance are strategies used in computer systems to ensure that different
processes can run smoothly without getting stuck waiting for each other forever.
Example:
Think of it like a traffic system where cars (processes) must move through intersections (resources)
without getting into a gridlock.
Necessary Conditions for Deadlock
• Mutual Exclusion: a situation where only one process can access a resource at a time.
• Hold and Wait: A process is holding a resource and waiting for additional resources
• No Preemption: A resource can only be released voluntarily by the process holding it
• Circular Wait: A set of processes are waiting for each other in a circular pattern
Example
we write our computer programs in a text file and when we execute this program, it becomes a process
which performs all the tasks mentioned in the program.
Explanation
When a program is loaded into the memory and it becomes a process, it can be divided into four sections
─ stack, heap, text and data.
The following image shows a simplified layout of a process inside main memory −
1 Stack
The process Stack contains the temporary data such as method/function parameters,
return address and local variables.
2 Heap
This is dynamically allocated memory to a process during its run time.
3 Text
This includes the current activity represented by the value of Program Counter and the
contents of the processor's registers.
4 Data
This section contains the global and static variables.
1. Start:
This is the initial state when a process is first started/created.
2. Read:
The process is waiting to be assigned to a processor. Ready processes are waiting to have the
processor allocated to them by the operating system so that they can run. Process may come into this
state after Start state or while running it by but interrupted by the scheduler to assign CPU to some
other process.
3.Running:
Once the process has been assigned to a processor by the OS scheduler, the process state is set
to running and the processor executes its instructions.
4.Waiting:
Process moves into the waiting state if it needs to wait for a resource, such as waiting for
user input, or waiting for a file to become available.
5.Terminated or Exit:
Once the process finishes its execution, or it is terminated by the operating system, it is
moved to the terminated state where it waits to be removed from main memory.
Process Control Block (PCB)
A Process Control Block is a data structure maintained by the Operating System for every process. The
PCB is identified by an integer process ID (PID). A PCB keeps all the information needed to keep track of
a process as listed below in the table –
The architecture of a PCB is completely dependent on Operating System and may contain different
information in different operating systems. Here is a simplified diagram of a PCB
1. Process State: The current state of the process i.e., whether it is ready, running, waiting, or
whatever.
3. Process ID: Unique identification for each of the process in the operating system.
5. Program Counter: Program Counter is a pointer to the address of the next instruction to be
executed for this process.
6. CPU registers: Various CPU registers where process need to be stored for execution for running
state.
7. CPU Scheduling Information: Process priority and other scheduling information which is
required to schedule the process.
8. Memory management information: This includes the information of page table, memory
limits, Segment table depending on memory used by the operating system.
9. Accounting information: This includes the amount of CPU used for process execution, time
limits, execution ID etc.
10. I/O status information: This includes a list of I/O devices allocated to the process. The PCB is
maintained for a process throughout its lifetime, and is deleted once the process terminates.
The PCB is maintained for a process throughout its lifetime, and is deleted once the process terminates.
1. Process Creation
The first operation that a process undergoes when it enters a system is process creation.
It involves formation of a process and is associated with “New” state of the process.
Process creation occurs due to any of the following events:
• System initialization − When the computer is started, a number of system processes and
background processes are created.
• User request − A user may start executing a program leading to creation of a process.
• Child process system call − A running process may create a child process by process creation
system call.
• Batch system − The batch system may initiate batch jobs
2. Process scheduling\dispatching
Scheduling or dispatching refers to the event where the OS puts the process from ready to running state.
It is done by the system when there are free resources or there is a process of higher priority than the
ongoing process.
3. Process Blocking
• Block mode is a mode where the system waits for input-output.
• In process blocking operation, the system puts the process in the waiting state.
• When a task is blocked, it is unable to execute until the task prior to it has finished using the
shared resource.
• Examples of shared resources are the CPU, network and network interfaces, memory, and disk.
4. Process Termination
Ending a process is known as process termination. There are many events that may lead to process
termination, some of them are:
1. One process terminating the other process.
2. A problem in the hardware.
3. The process is fully executed, implying that the OS is finished.
4. An operating system might terminate itself due to service errors.
The procedure can be easily broken down into numerous different threads.
Example: Multiple tabs in a browser, for example, can be considered threads. MS Word employs many
threads to prepare the text in one thread, receive input in another thread, and so on.
Why Do We Need Thread?
• Creating a new thread in a current process requires significantly less time than creating a new
process.
• Threads can share common data without needing to communicate with each other.
• When working with threads, context switching is faster.
• Terminating a thread requires less time than terminating a process.
Types of Threads
1. User-Level Thread
• The user-level thread is ignored by the operating system.
• User threads are simple to implement and are done so by the user.
• The entire process is blocked if a user executes a user-level operation of thread blocking.
• The kernel-level thread is completely unaware of the user-level thread.
• User-level threads are managed as single-threaded processes by the kernel-level thread.
2. Kernel-Level Thread
• The operating system is recognized by the kernel thread.
• Each thread and process in the kernel-level thread has its own thread control block as well as
process control block in the system.
• The operating system implements the kernel-level thread.
• The kernel is aware of all threads and controls them.
• The kernel-level thread provides a system call for user-space thread creation and management.
Kernel threads are more complex to build than user threads.
• The kernel thread’s context switch time is longer.
• The execution of the Banky thread can continue in case a kernel thread performs a blocking
operation.
INTRODUCTION TO WINDOWS 10
Windows 10 is a popular operating system developed by Microsoft, released in July 2015. It
combines features from previous versions of Windows while introducing new tools and
enhancements to improve usability, security, and performance.
Installation Requirements
Before installing Windows 10, your system needs to meet certain minimum hardware requirements:
• Processor: 1 GHz or faster processor or System on a Chip (SoC)
• RAM:
o 1 GB for 32-bit
o 2 GB for 64-bit
• Hard Disk Space:
o 16 GB for 32-bit OS
o 20 GB for 64-bit OS
• Graphics Card: DirectX 9 or later with WDDM 1.0 driver
• Display: 800x600 resolution or higher
• Internet Connection: Internet connectivity is necessary to perform updates and
download and take advantage of some features.
How to Create a Bootable USB / DVD / CD
Creating a bootable USB or DVD/CD is essential for installing Windows 10. Here’s how you can
do it:
Rufus Software
Rufus is a free and open-source utility used to create bootable USB drives. Here’s how to use it:
1. Download Rufus:
o Visit the Rufus official website and download the latest version.
2. Prepare the USB Drive:
o Insert a USB drive (at least 8 GB) into your computer. Ensure that any important
data is backed up, as the USB will be formatted.
3. Run Rufus:
o Open Rufus. It will automatically detect your USB drive.
4. Select the ISO File:
o Under "Boot selection," click on the "Select" button to choose the Windows 10
ISO file.
5. Configure Rufus Settings:
o Partition Scheme: Choose "MBR" for BIOS or "GPT" for UEFI.
o File System: NTFS is typically selected.
6. Create the Bootable USB:
o Click "Start." Rufus will format the USB drive and copy the Windows 10 files,
making it bootable.
Step-By-Step Installation Process
Once you have a bootable USB or DVD, follow these steps to install Windows 10:
Sound Card
• Sound Card Installation:
o Insert the sound card into an available slot on the motherboard.
o Boot up the computer and install drivers from the manufacturer's website.
o Use the Windows Settings (System > Sound) to configure audio output and input
devices.
Software Installation
Software Installation is typically done via installation wizards or directly from the Microsoft Store:
• Download the Software: Obtain the software installer from the internet, a CD/DVD, or
the Microsoft Store.
• Run the Installer: Double-click the installer file and follow the on-screen prompts to
install the software.
• Follow Instructions: Accept license agreements, choose installation locations, and
configure any necessary settings during installation.
• Complete Installation: Finish the installation and restart your computer if prompted.
User Creation
Windows 10 allows multiple user accounts on one computer, each with its own settings and files.
Dual Desktop
Windows 10 supports virtual desktops, allowing you to organize your workspace by creating multiple
desktops:
Network Settings
Join Workgroup
Workgroups are used for small networks without a centralized domain controller:
• Join a Workgroup:
o Right-click "This PC" and select "Properties."
o Click "Change settings" next to the computer name.
o In the "System Properties" window, click "Change."
o Select "Workgroup," enter the workgroup name, and click "OK."
• Mouse Settings:
o Go to Settings > Devices > Mouse.
o Adjust pointer speed, switch primary buttons, and customize scroll behavior.
• Keyboard Settings:
o Go to Settings > Devices > Typing.
o Configure autocorrect, text suggestions, and other typing options.
• Add a Language:
o Go to Settings > Time & Language > Language.
o Click "Add a language" and search for "Urdu."
• Switch Keyboard Layout:
o Use the language bar on the Taskbar or press Alt + Shift to switch between
keyboard layouts.
Installing & Configuring Printers & Scanners
To install and configure printers and scanners in Windows 10:
• Install a printer:
o Go to Settings > Devices > Printers & scanners.
o Click "Add a printer or scanner," select your device, and follow the prompts.
• Configure Scanner:
o Use the same menu to add a scanner.
o Once installed, use Windows Fax and Scan or other scanning software to operate
the scanner.
NETWORK CONNECTIVITY (NETWORKING)
Printer Sharing
Printer sharing allows multiple computers in a Workgroup to use a single printer.
Steps to Share a printer:
13. Open Devices and Printers:
o Go to Settings > Devices > Printers & scanners.
o Select the printer you want to share, click on it, and then click "Manage."
• Client:
o A client is a computer or device that accesses services or resources on a server.
o Clients run desktop operating systems like Windows 10, macOS, or Linux.
o They are typically used for everyday tasks like browsing the web, running
office applications, and connecting to servers for email, file sharing, and
other services.
• Server:
o A server is a powerful computer designed to provide services to multiple
clients over a network.
o Servers run specialized server operating systems like Windows Server 2016.
o They manage resources and services such as databases, file storage, web
hosting, print services, and more.
o Servers are designed to handle heavy workloads and operate 24/7,
ensuring availability and reliability for connected clients.
Key Differences:
• Role: Clients consume services, while servers provide them.
• Operating System: Clients typically run desktop OS, servers run server OS.
• Hardware: Servers usually have more robust hardware to support multiple
simultaneous connections and high-performance demands.
• Management: Servers require more complex management and configuration
compared to client machines.
6.1 Roles & Services in Windows Server 2016
Windows Server 2016 offers a variety of roles and services that can be configured to meet
the needs of different environments. Here are some of the key roles:
Print & Document Services
Print & Document Services allow administrators to manage printers and print servers across
an organization.
• Print Server: Manages printers and queues, enabling centralized management
of print jobs.
• Distributed Scan Server: Enables sharing and managing of scanners on the network.
• Internet Printing: Allows users to connect and print to printers via the web.
Benefits:
• Centralized management of printers and print queues.
• Enhanced control over print resources, including permissions and access.
• Web-based printing allows remote users to print documents.
6.1.2 Active Directory
Directory (AD) is a directory service that provides centralized management of users,
computers, and other resources within a network.
• Domain Services: The core component, managing users, groups, and computers
within a domain.
• Group Policy: Allows administrators to control settings and permissions across all
users and computers in the domain.
• LDAP Protocol: AD uses the Lightweight Directory Access Protocol (LDAP) to
manage and access directory information.
Key Features:
• Centralized authentication and authorization for network resources.
• Group Policy management to enforce security settings and configurations.
• Support for complex directory hierarchies and organizational units.
Benefits:
• Simplifies network navigation by allowing users to use memorable domain names
instead of IP addresses.
• Essential for Active Directory, which relies heavily on DNS for locating
domain controllers.
• Supports scalability and redundancy with DNS zone replication.
Benefits:
• Provides backward compatibility with older network environments that
still use NetBIOS.
• Helps in managing and resolving names in networks where DNS is not
fully implemented.
While DNS has largely replaced WINS in modern networks, WINS may still be required
in certain legacy systems or mixed environments.