PRACTICAL 1: Practice of various Linux/ Unix commands like man, cp, mv, ln, rm, unlink, mkdir,
rmdir, etc.
1. man – View Manual Pages
Show help for any command
man ls
man cp
man mkdir
2. cp – Copy Files & Directories:
a) Copy a file:
cp [Link] [Link]
b) Copy a directory (use -r)
cp -r folder1 folder2
c) Copy a file to another directory
cp [Link] /home/user/Documents/
3. mv – Move or Rename File
a) Rename a file
mv [Link] [Link]
b) Move file to directory
mv [Link] /home/user/Desktop/
c) Move multiple files
mv [Link] [Link] /home/user/Documents/
4. ln – Create Links (Hard/Soft)
a) Hard link:
ln [Link] [Link]
b) Soft/Symbolic link:
ln -s /path/to/[Link] [Link]
5. rm – Remove Files/Directories
a) Remove a file
rm [Link]
b) Remove multiple files
rm [Link] [Link]
c) Remove a directory (recursively)
Note: Careful: this permanently deletes files
rm -r foldername
6. unlink – Remove a File
Note: Works only for files, not directories.
unlink [Link]
7. mkdir – Create Directories
a) Create a directory
mkdir myfolder
b) Create Nested directories
mkdir -p folder1/folder2/folder3
8. rmdir – Remove EMPTY Directories
a) Only deletes if directory is empty.
rmdir emptyfolder
b) Try creating and deleting:
mkdir test
rmdir test
Practical 2: Format and Install Windows Operating System.
Step 1: Create a Bootable Windows USB
Option 1: Use Microsoft Media Creation Tool
1. Download tool from Microsoft website
2. Insert USB (8 GB)
3. Run the tool → Choose Create installation media
4. Select:
o Language
o Edition (Windows 10/11)
o Architecture (64-bit)
5. Select USB Flash Drive
6. The tool will format USB and create bootable media.
Option 2: Use Rufus (If you already have ISO)
1. Download Rufus
2. Insert USB
3. Open Rufus → Select:
o Device: your USB
o Boot Selection: Windows ISO
o Partition Scheme: GPT (for UEFI systems)
o File System: NTFS
4. Click Start
Step 2: Boot from USB
1. Insert the bootable USB into the computer
2. Restart the PC
3. Enter Boot Menu / BIOS by pressing:
o F12
o F2
o Delete
o ESC
(Depends on manufacturer)
4. Select USB Boot
5. Windows Setup will start
Step 3: Install Windows (Formatting Drive)
1. Choose Language, Time, Keyboard → Next
2. Click Install Now
3. If asked for Product Key → Enter it (or click I don't have a key)
4. Select your Windows Edition
5. Select Custom: Install Windows Only (Advanced)
6. You will see partitions:
To Format:
• Select the partition where previous Windows exists
• Click Format
To Clean Install:
• Delete all partitions:
o System
o Recovery
o Primary
(⚠ Make sure your data is backed up)
You will now see Unallocated Space.
7. Select Unallocated Space → Next
8. Installation will begin (takes 10–20 minutes)
9. System will restart automatically
Step 4: Setup Windows After Install
1. Choose Region
2. Choose Keyboard layout
3. Connect to WiFi (optional)
4. Sign in with Microsoft account or create offline account
5. Set Windows preferences (privacy settings)
6. Desktop will appear
Step 5: Install Drivers
Go to:
• Device Manager → Check if any drivers missing
• Install:
o Display driver (NVIDIA/AMD/Intel)
o Wifi/LAN driver
o Audio driver
o Chipset driver
Most modern systems auto-install via Windows Update.
Step 6: Install Essential Software
• Chrome/Edge
• MS Office
• Antivirus (Windows Defender is enough)
• Drivers & Utilities
Practical 3: Use Task Manager to monitor and terminate processes. Understand process priorities.
1. Open Task Manager
You can open Task Manager in multiple ways:
• Press Ctrl + Shift + Esc
• OR Press Ctrl + Alt + Delete → Task Manager
• OR Right-click on Taskbar → Task Manager
2. Monitor Processes in Task Manager
Go to the “Processes” tab
Here you can see:
• Apps (running programs)
• Background processes
• Windows processes
Columns you can monitor
• CPU (%) – how much processor each app is using
• Memory (RAM)
• Disk usage
• Network usage
• GPU usage
You can sort by any column by clicking the header.
Example:
Click “CPU” → highest CPU-using process will appear on top.
3. Check Detailed Information (Performance Tab)
Click the Performance tab to monitor:
• CPU usage graph
• Memory usage
• Disk activity
• WiFi/Ethernet usage
• GPU activity
This is useful for diagnosing system slowdowns.
4. View More Details of a Process
In Processes tab → Right-click any process → click Go to details
This opens the Details tab where you get:
• PID (Process ID)
• Exact executable name
• Status
• Priority settings
• CPU, memory details
5. How to Terminate (End) a Process
Method 1: From Processes Tab
1. Select the app
2. Click End task (bottom-right)
Method 2: From Details Tab
1. Right-click on the process
2. Click End task
3. For advanced killing click End process tree
o This ends the process AND its related child processes
⚠ Warning: Ending system processes may cause Windows to crash or reboot.
6. Process Priorities (Important Topic)
Every Windows process has a priority level that controls how much CPU time it gets.
Priority Levels (Low → High):
1. Low
2. Below Normal
3. Normal (default)
4. Above Normal
5. High
6. Real-time (⚠ dangerous)
7. How to Change Process Priority
1. Open Task Manager
2. Go to Details tab
3. Right-click a process
4. Select Set priority
5. Choose one of the levels (Normal / High / Low etc.)
Practical 4: Simulate the following CPU scheduling algorithms. a) FCFS b) SJF c) Round Robin d)
Priority.
Given Processes
Let’s assume the following processes:
Process Burst Time Arrival Time Priority
P1 8 0 3
P2 4 1 1
P3 9 2 4
P4 5 3 2
(a) FCFS – First Come First Serve
✔ Process executed in order of arrival time
✔ Non-preemptive
Execution Order
P1 → P2 → P3 → P4
Gantt Chart
0 8 12 21 26
| P1 | P2 | P3 | P4 |
Waiting Time Calculation
• WT(P1) = 0 − 0 = 0
• WT(P2) = 8 − 1 = 7
• WT(P3) = 12 − 2 = 10
• WT(P4) = 21 − 3 = 18
Average Waiting Time
(0 + 7 + 10 + 18) / 4 = 8.75 ms
(b) SJF – Shortest Job First (Non-preemptive)
✔ Select process with shortest burst time
✔ Arrival time considered
Ready Queue Based on Time & Burst
• At t=0 → P1
• At t=1 → P2 arrives (shortest → pick P2)
• After P2, available P1 & P4 → pick P4
• Next P1 → then P3
Execution Order
P1 → P2 → P4 → P3
Gantt Chart
0 8 12 17 26
| P1 | P2 | P4 | P3 |
Waiting Time
• WT(P1) = 0
• WT(P2) = 8 − 1 = 7
• WT(P4) = 12 − 3 = 9
• WT(P3) = 17 − 2 = 15
Average Waiting Time
(0 + 7 + 9 + 15) / 4 = 7.75 ms
(c) Round Robin (Time Quantum = 3 ms)
Execution Order
P1 (3), P2 (3), P3 (3), P4 (3),
P1 (3), P2 (1), P3 (3), P4 (2),
P1 (2), P3 (3), P3 (3)
Completion Times
• CT(P1) = 22
• CT(P2) = 13
• CT(P3) = 33
• CT(P4) = 20
Waiting Times
WT = CT − Arrival − Burst
• WT(P1) = 22 − 0 − 8 = 14
• WT(P2) = 13 − 1 − 4 = 8
• WT(P3) = 33 − 2 − 9 = 22
• WT(P4) = 20 − 3 − 5 = 12
Average Waiting Time
(14 + 8 + 22 + 12) / 4 = 14 ms
(d) Priority Scheduling (Lower number = Higher Priority)
Priorities: P2 (1) < P4 (2) < P1 (3) < P3 (4)
✔ Non-preemptive priority scheduling
✔ Choose highest priority (smallest number)
Execution Order
P1 starts (only process at t=0)
→ then P2
→ P4
→ P3
Gantt Chart
0 8 12 17 26
| P1 | P2 | P4 | P3 |
Waiting Times
• WT(P1) = 0
• WT(P2) = 8 − 1 = 7
• WT(P4) = 12 − 3 = 9
• WT(P3) = 17 − 2 = 15
Average Waiting Time
(0 + 7 + 9 + 15) / 4 = 7.75 ms
Summary Table
Algorithm Avg Waiting Time
FCFS 8.75 ms
SJF 7.75 ms
Round Robin (Q=3) 14 ms
Priority 7.75 ms
Practical 5: Simulate all page replacement algorithms a)FIFO b) LRU c) OPTIMAL
Reference string: 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2
Number of frames: 3
FIFO (First-In First-Out): Replace the page that has been in memory the longest (simple queue).
Step Ref Frame1 Frame2 Frame3 Fault?
1 7 7 Yes
2 0 7 0 Yes
3 1 7 0 1 Yes
4 2 2 0 1 Yes
5 0 2 0 1 No
6 3 2 3 1 Yes
7 0 2 3 0 Yes
8 4 4 3 0 Yes
9 2 4 2 0 Yes
10 3 4 2 3 Yes
11 0 0 2 3 Yes
12 3 0 2 3 No
13 2 0 2 3 No
Total Page Faults (FIFO): 10
LRU (Least Recently Used)
Replace the page which was not used for the longest time (uses recent history).
Step Ref Frame1 Frame2 Frame3 Fault?
1 7 7 Yes
2 0 7 0 Yes
3 1 7 0 1 Yes
4 2 2 0 1 Yes
5 0 2 0 1 No
6 3 2 0 3 Yes
Step Ref Frame1 Frame2 Frame3 Fault?
7 0 2 0 3 No
8 4 4 0 3 Yes
9 2 4 0 2 Yes
10 3 4 3 2 Yes
11 0 0 3 2 Yes
12 3 0 3 2 No
13 2 0 3 2 No
Total Page Faults (LRU): 9
OPTIMAL (Belady’s optimal algorithm)
Replace the page that will not be used for the longest period in the future. (Requires future
knowledge — used as a theoretical best)
Step Ref Frame1 Frame2 Frame3 Fault?
1 7 7 Yes
2 0 7 0 Yes
3 1 7 0 1 Yes
4 2 2 0 1 Yes
5 0 2 0 1 No
6 3 2 0 3 Yes
7 0 2 0 3 No
8 4 2 4 3 Yes
9 2 2 4 3 No
10 3 2 4 3 No
11 0 2 0 3 Yes
12 3 2 0 3 No
13 2 2 0 3 No
Total Page Faults (OPTIMAL): 7