POWERED BY
📚 ReferMe: Your Academic Companion
A Student-Centric Platform by Pixen
🔹 About ReferMe
ReferMe, by Pixen, offers curated academic resources to help students study
smarter and succeed faster.
✅ Class Notes
✅ Previous Year Question Papers (PYQs)
✅ Updated Syllabus
✅ Quick Revision Material
✅ Practical Codes
🔹 About Pixen
Pixen is a tech company helping students and startups turn ideas into reality.
Alongside ReferMe, we also offer:
✅ Final Year Projects
✅ Custom Websites
✅ Machine learning
✅ Web Applications
✅ E‑Commerce Stores
✅ Landing Pages
https://referme.tech/ https://www.pixen.live
Powered by
hule Pune Un
ai P ive
ib
tr r
vi
sit
Sa
y
Information Technology - Third Year
OPERATING SYSTEM- UNIT I
OVERVIEW OF OPERATING SYSTEM
Operating System Objectives and Functions, The Evolution of
Operating Systems, Developments Leading to Modern Operating
Systems, Virtual Machines, Introduction to Linux OS, BASH Shell
scripting: Basic shell commands.
More Stuff Inside → Click here
Powered by
More Stuff Inside → Click here
Powered by
Q.1. Explain the role of operating system as resource manager.
Definition:
An operating system (OS) is system software that manages hardware
and software resources in a computer system and provides services for
computer programs.
Explanation:
As a resource manager, the OS ensures efficient and fair allocation and
usage of hardware and software resources. These resources include:
CPU (Processor)
Memory (RAM)
Input/Output devices (Keyboard, Mouse, Printer, etc.)
Storage (Hard drives, SSDs)
Files and Directories
Network Interfaces
Roles of OS as Resource Manager:
Resource How OS Manages It
Schedules processes using algorithms (e.g., Round Robin,
CPU
FCFS), provides multitasking.
Allocates and deallocates memory to processes, uses virtual
Memory (RAM)
memory and paging.
Manages file systems (e.g., FAT, NTFS), provides read/write
Storage
access.
More Stuff Inside → Click here
Powered by
Resource How OS Manages It
Controls and coordinates input/output operations using
I/O Devices
drivers and buffers.
Creates, manages, and terminates processes. Handles
Processes
synchronization and communication.
Example:
When you run a program like a media player, the OS:
Allocates CPU time to decode audio/video.
Allocates RAM to load the file and buffer playback.
Manages access to the speaker.
Reads the video file from the disk.
Q.2. Explain the significance of the following shell commands with
examples:
1. ls – List Directory Contents
Purpose:
Displays the files and directories in the current working directory.
Syntax:
ls [options] [directory]
More Stuff Inside → Click here
Powered by
Common Examples:
Lists all files and folders in the current directory.
ls
Lists in long format (permissions, owner, size, date).
ls -l
Lists all files including hidden ones (starting with a dot .).
ls -a
2. uniq – Filter Duplicate Lines
Purpose:
Removes duplicate lines from sorted input.
Syntax:
uniq [options] [input-file] [output-file]
Example:
Sorts the file and removes duplicate lines.
sort names.txt | uniq
More Stuff Inside → Click here
Powered by
Prefixes each line with the number of occurrences.
uniq -c sorted.txt
3. tail – Display End of File
Purpose:
Displays the last few lines of a file.
Syntax:
tail [options] [file]
Examples:
Shows the last 10 lines of log.txt by default.
tail -n 10 log.txt
4. touch – Create Empty File or Update Timestamp
Purpose:
Creates a new empty file or updates the timestamp of an existing file.
Syntax:
touch [file-name]
More Stuff Inside → Click here
Powered by
Examples:
Creates newfile.txt if it doesn't exist.
touch newfile.tx
5. grep – Search Text Using Patterns
Purpose:
Searches for lines matching a pattern (regular expression) in files.
Syntax:
grep [options] 'pattern' [file]
Examples:
Finds all lines containing the word "error" in log.txt.
grep "error" log.txt
Conclusion:
These shell commands (ls, uniq, tail, touch, grep) are powerful tools in
Linux/Unix environments that allow users to manage files, view logs, filter
data, and automate tasks efficiently. Combined with the OS's role as a
resource manager, they provide a strong foundation for interacting with
and managing system resources.
More Stuff Inside → Click here
Powered by
Q.3. Describe the differences between a monolithic kernel and a
microkernel.
Definition of Kernel:
A kernel is the core component of an operating system that manages
system resources and allows communication between hardware and
software.
Monolithic Kernel:
A monolithic kernel is a single large process running entirely in a single
address space (kernel space). It includes core functionalities like:
Process management
Memory management
File system
Device drivers
System calls
All these are tightly integrated into one large module.
Diagram
More Stuff Inside → Click here
Powered by
Advantages:
Faster execution due to no context switching.
Direct communication between components.
Disadvantages:
Difficult to maintain and update.
A bug in one part (e.g., driver) can crash the entire system.
Microkernel:
A microkernel includes only the essential components in kernel space:
Inter-process communication (IPC)
Low-level memory management
Basic scheduling
All other services (file system, device drivers, etc.) run in user space as
separate processes.
Advantages:
More secure and stable.
Easier to modify and debug.
Disadvantages:
Slower due to increased context switching and IPC overhead.
More Stuff Inside → Click here
Powered by
Diagram:
Comparison Table:
Feature Monolithic Kernel Microkernel
Size Large Small
Speed Faster (no IPC) Slower (uses IPC)
Inside kernel (file system,
Services In user space
drivers, etc.)
Low – one failure can crash
Reliability High – isolated services
the system
Security Less secure More secure (services isolated)
QNX, Minix, early versions of
Example OS Linux, Unix
Mac OS X
More Stuff Inside → Click here
Powered by
Q.3. Describe the differences between a monolithic kernel and a
microkernel.
Virtual Machine (VM):
A Virtual Machine is an emulation of a computer system that runs on a
physical machine (host) and behaves like a separate computer (guest). It
has its own OS, memory, CPU, and storage.
Types of Virtual Machines:
1. System VM – Emulates a complete physical machine.
Example: VMware, VirtualBox, KVM
2. Process VM – Runs a single program in an isolated environment.
Example: Java Virtual Machine (JVM)
Implementation of VMs:
Hypervisor (Virtual Machine Monitor):
Software that creates and runs virtual machines.
Type 1 Hypervisor (Bare-metal):
Runs directly on hardware.
Example: VMware ESXi, Microsoft Hyper-V
Type 2 Hypervisor (Hosted):
Runs on a host OS.
Example: Oracle VirtualBox, VMware Workstation
More Stuff Inside → Click here
Powered by
Type 1 Hypervisor: Type 2 Hypervisor:
Benefits of Virtual Machines:
Isolation : One VM doesn’t affect others or the host.
Security : Malicious code in a VM can’t harm the host system.
Testing and Development : Safe to test apps or OSes in isolated
environments.
Resource Utilization : Multiple VMs can run on one machine,
maximizing hardware use.
Portability : VMs can be moved easily between systems.
Examples:
System VM:
Using VirtualBox to install Ubuntu inside Windows.
Process VM:
JVM allows running Java code on any OS (Write Once, Run Anywhere).
More Stuff Inside → Click here
Powered by
Q.4. Define Operating System and Explain its Basic Functions.
Definition:
An Operating System (OS) is system software that acts as an
intermediary between the user and the computer hardware. It provides a
user interface and controls the execution of programs to manage
hardware resources efficiently.
Basic Functions of Operating System:
1. Process Management
Creates, schedules, and terminates processes. Handles multitasking and
synchronization.
2. Memory Management
Allocates and deallocates memory space. Manages virtual memory and
paging.
3. File System Management
Organizes, stores, and manages data in files and directories.
4. Device Management
Controls input/output devices using drivers.
5. Security and Access Control
Ensures protection of data and resources from unauthorized access.
More Stuff Inside → Click here
Powered by
6. User Interface
Provides CLI (Command Line Interface) or GUI (Graphical User
Interface).
7. Job Scheduling
Prioritizes and schedules jobs based on policies.
Q.5. What is Multiprogramming, Multitasking, and Multiprocessing?
Explain with Example.
1. Multiprogramming:
Multiprogramming is the ability of an OS to load multiple programs into
memory and execute them concurrently, though only one runs at a time.
Example:
If Program A is waiting for I/O (like disk read), CPU executes Program B.
This increases CPU utilization.
2. Multitasking:
Multitasking allows a user to run multiple tasks (processes) at the same
time using CPU time-slicing.
Example:
A user can listen to music, browse the internet, and write a document
simultaneously.
More Stuff Inside → Click here
Powered by
3. Multiprocessing:
Multiprocessing is the use of two or more CPUs within a single computer
system to execute processes in parallel.
Example:
In a dual-core processor, two tasks can be executed truly simultaneously,
like rendering a video while scanning a file.
Comparison Table:
Feature Multiprogramming Multitasking Multiprocessing
CPU Count Single Single Multiple
Yes (with time
Concurrency Yes (sequential) Yes (parallel)
slicing)
Windows OS, Multi-core
Example Batch systems
Linux servers
More Stuff Inside → Click here
Powered by
Q.6. Discuss the following commands with examples.
1. pwd – Print Working Directory
Purpose:
Displays the current working directory path in the terminal.
Syntax:
pwd
Examples:
$ pwd
/home/siddhant/projects
2. ps – Process Status
Purpose:
Displays information about currently running processes.
Syntax:
ps [options]
Example: Shows all processes running on the system.
ps -ef
More Stuff Inside → Click here
Powered by
1. fork() – Create a New Process (System Call)
Purpose:
Used in C/C++ to create a new child process. It is a system call, not a
shell command.
Syntax:
pid_t pid = fork();
Behavior:
Returns 0 in child process.
Returns > 0 (child PID) in parent process.
Returns 1 if fork fails.
Examples: (C Code)
#include <stdio.h>
#include <unistd.h>
int main() {
pid_t pid = fork();
if (pid == 0)
printf("Child process\n");
else
printf("Parent process\n");
return 0;
}
More Stuff Inside → Click here