0% found this document useful (0 votes)
401 views73 pages

Personal Notes Gate Smashers

Uploaded by

baijayantis56
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
401 views73 pages

Personal Notes Gate Smashers

Uploaded by

baijayantis56
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 73

26 February 2025 10:26

Gate Smashers Page 1


Gate Smashers Page 2
Introduction to OS
26 February 2025 21:01

Gate Smashers Page 3


Batch OS
26 February 2025 21:22

Gate Smashers Page 4


Multiprogramming and Multitasking
26 February 2025 21:29

Gate Smashers Page 5


Types of OS
26 February 2025 21:36

Gate Smashers Page 6


Process states
26 February 2025 21:42

Gate Smashers Page 7


Gate Smashers Page 8
Imp linux commands
27 March 2025 05:41

Gate Smashers Page 9


System Calls and Types
27 March 2025 06:47

Gate Smashers Page 10


Fork System call with Example
27 March 2025 11:10

Gate Smashers Page 11


Questions on fork system call
27 March 2025 12:06

Gate Smashers Page 12


User mode and Kernel mode
28 March 2025 05:39

Gate Smashers Page 13


Process vs Threads
28 March 2025 06:05

Gate Smashers Page 14


User Level vs Kernel Level Thread
28 March 2025 06:05

Gate Smashers Page 15


Process scheduling algorithms
28 March 2025 06:28

Gate Smashers Page 16


What is Arrival, Burst, Completion, Turnaround, Waiting and Response
time in CPU scheduling
28 March 2025 17:30

Gate Smashers Page 17


First Come First Serve (FCFS)
28 March 2025 17:39

Gate Smashers Page 18


Shortest Job First
29 March 2025 06:15

Gate Smashers Page 19


Shortest remaining Time First
29 March 2025 06:29

Gate Smashers Page 20


Question on SJF
29 March 2025 07:51

Gate Smashers Page 21


Round Robin CPU Scheduling
29 March 2025 08:22

Gate Smashers Page 22


Pre-emptive priority scheduling algorithm
29 March 2025 08:41

Gate Smashers Page 23


Example of Mixed Burst time
29 March 2025 09:03

Gate Smashers Page 24


Multi-Level Queue scheduling
29 March 2025 11:02

Gate Smashers Page 25


Multi-Level feedback Queue Scheduling
29 March 2025 11:07

Gate Smashers Page 26


Process Synchronization - 1
29 March 2025 15:38

Gate Smashers Page 27


Producer consumer problem | Process Synchronization - 2
30 March 2025 12:12

Gate Smashers Page 28


Gate Smashers Page 29
Printer-Spooler Problem
30 March 2025 20:49

Gate Smashers Page 30


Gate Smashers Page 31
Critical Section problem
31 March 2025 11:57

Gate Smashers Page 32


Gate Smashers Page 33
LOCK variable in OS
31 March 2025 12:36

Gate Smashers Page 34


Test and set instruction
31 March 2025 15:44

Gate Smashers Page 35


Turn variable
31 March 2025 16:05

Gate Smashers Page 36


Semaphores
01 April 2025 00:16

Gate Smashers Page 37


What is Binary Semaphore
01 April 2025 00:56

Gate Smashers Page 38


Practice Question on Binary Semaphore in OS
05 April 2025 07:52

Gate Smashers Page 39


Solution of Readers-Writers Problem using Binary Semaphore
05 April 2025 08:06

Gate Smashers Page 40


Gate Smashers Page 41
What is paging ?
21 April 2025 09:22

Gate Smashers Page 42


Page Table Entries
23 March 2025 09:26

Gate Smashers Page 43


What is Thrashing ?
21 April 2025 10:44

Gate Smashers Page 44


Segmentation vs Paging
21 April 2025 10:44

Gate Smashers Page 45


Overlay
23 March 2025 10:45

Gate Smashers Page 46


Translation lookaside buffer
23 March 2025 10:45

Gate Smashers Page 47


Page Replacement Intro - FIFO
23 March 2025 10:46

Gate Smashers Page 48


Belady's Anomaly in FIFO
23 March 2025 10:46

Gate Smashers Page 49


Optimal Page Replacement Algo
23 March 2025 10:47

Gate Smashers Page 50


Least recently used page replacement algo
23 March 2025 10:47

Gate Smashers Page 51


Most recently used page replacement algorithm
23 March 2025 10:47

Gate Smashers Page 52


Hard Disk Architecture in OS
23 March 2025 10:48

Gate Smashers Page 53


Disk Access Time with Example
23 March 2025 10:48

Gate Smashers Page 54


Disk Scheduling Algorithm
23 March 2025 10:49

Gate Smashers Page 55


FCFS in Disk Scheduling
23 March 2025 10:49

Gate Smashers Page 56


Gate Smashers Page 57
SSTF in Disk Scheduling
23 March 2025 10:49

Gate Smashers Page 58


Gate Smashers Page 59
Scan Algorithm in Disk Scheduling
23 March 2025 10:50

Gate Smashers Page 60


LOOK Algorithm in Disk Scheduling
23 March 2025 10:50

Gate Smashers Page 61


C-Scan Algo in Disk Scheduling
23 March 2025 10:50

Gate Smashers Page 62


C-LOOK Algo in Disk Scheduling
23 March 2025 10:51

Gate Smashers Page 63


File System in OS
23 March 2025 10:51

Gate Smashers Page 64


File Attributes and Operations in OS
23 March 2025 10:52

Gate Smashers Page 65


Allocation Methods in OS
23 March 2025 10:52

Gate Smashers Page 66


Contiguous Allocation in OS
23 March 2025 10:53

Gate Smashers Page 67


Linked List Allocation in File allocation with example
23 March 2025 10:53

Gate Smashers Page 68


Indexed File Allocation in OS
23 March 2025 10:53

Gate Smashers Page 69


Linker and Loader with Example
28 March 2025 11:40

Gate Smashers Page 70


Extra Questions
21 April 2025 22:21

1. Process vs Thread
A process is an independent program in execution with its own memory space,
system resources, and state information. A thread is a lightweight execution
unit within a process that shares the process's resources (memory and files)
but has its own registers and stack. Multiple threads in a process can run
concurrently, improving performance through parallelism while using fewer
system resources than multiple processes.
2. Process States vs PCB
Process states refer to the various conditions a process can be in:
• New: Process being created
• Ready: Process waiting to be assigned to a processor
• Running: Process executing instructions
• Blocked/Waiting: Process waiting for an event/resource
• Terminated: Process finished execution
The Process Control Block (PCB) is a data structure maintained by the OS that
contains all information about a process, including:
• Process ID
• Process state
• Program counter
• CPU registers
• CPU scheduling information
• Memory management information
• I/O status information
• Accounting information
3. Mutex vs Binary Semaphore
A Mutex (mutual exclusion) is a locking mechanism used to synchronize access
to a resource. Only one thread can acquire the mutex at a time, and only the
owner can release it.
A Binary Semaphore can also be used for mutual exclusion but is more flexible
as it can be signaled by any thread, not just the one that acquired it. While
functionally similar to a mutex in many cases, binary semaphores are designed
for signaling between threads rather than resource ownership.
4. Monolithic vs Microkernel
A Monolithic Kernel includes all OS services in the kernel space, providing
direct communication between different services. Examples include Linux and
older Unix systems. It offers better performance but is larger and less modular.
A Microkernel contains only essential services (like memory management and
IPC) in kernel space, while other services run in user space. It's more reliable
and maintainable, but performance may be slower due to increased
communication overhead. Examples include QNX and MINIX.

Gate Smashers Page 71


communication overhead. Examples include QNX and MINIX.
5. System Call
A System Call is an interface that allows user-level programs to request
services from the operating system's kernel. Examples include file operations
(open, read, write), process control (fork, exec), and device management.
System calls transition the CPU from user mode to kernel mode to perform
privileged operations.
6. Virtual Memory
Virtual Memory is a memory management technique that creates an illusion
of a very large main memory by using both RAM and secondary storage. It
allows programs to use more memory than physically available and provides
memory protection between processes. It works through techniques like
paging and segmentation.
7. chmod Command
The chmod command in Unix/Linux systems changes the permissions of files
and directories. It uses either symbolic notation (u=user, g=group, o=others
with +, -, = operators) or octal notation (4=read, 2=write, 1=execute) to set
who can read, write, or execute files.
Example: chmod 755 file.txt gives read, write, execute permissions to the
owner and read, execute permissions to group and others.
8. Demand Paging
Demand Paging is a virtual memory management technique where pages are
loaded into physical memory only when requested by a process, not in
advance. This reduces memory usage and startup time. When a program
accesses a page not in memory, a page fault occurs, and the OS loads the
required page from disk.
9. Paging vs Segmentation
Paging divides physical and virtual memory into fixed-size blocks called
pages/frames. It's simpler to implement and manage but can lead to internal
fragmentation.
Segmentation divides memory into variable-sized segments based on logical
units of the program (like functions, data, stack). It matches program's logical
view but can lead to external fragmentation.
10. Internal vs External Fragmentation
Internal Fragmentation occurs when memory is allocated in fixed blocks, and
the allocated block is larger than needed. The unused space within an
allocated block is wasted (common in paging).
External Fragmentation occurs when free memory is available in small, non-
contiguous blocks that cannot satisfy allocation requests, even though the
total free memory might be sufficient (common in segmentation and
contiguous memory allocation).
11. Preemptive vs Non-preemptive Scheduling
Preemptive Scheduling allows the operating system to interrupt a running
process and move it to the ready state to execute another process. It's more
Gate Smashers Page 72
process and move it to the ready state to execute another process. It's more
responsive but has higher context-switching overhead.
Non-preemptive Scheduling lets a process run until it blocks or voluntarily
yields the CPU. It's simpler and has less overhead but can lead to poor
response times if a process hogs the CPU.
12. Deadlock
A Deadlock is a situation where two or more processes are unable to proceed
because each is waiting for resources held by others. Four necessary conditions
for deadlock:
• Mutual Exclusion: Resources cannot be shared
• Hold and Wait: Processes hold resources while waiting for others
• No Preemption: Resources cannot be forcibly taken from processes
• Circular Wait: A circular chain of processes, each waiting for a resource
held by the next
13. Multiprogramming vs Multitasking
Multiprogramming keeps multiple programs loaded in memory, switching
between them to maximize CPU utilization. It focuses on keeping the CPU busy
rather than user interaction.
Multitasking extends multiprogramming by rapidly switching the CPU between
multiple tasks, creating the illusion of parallel execution. It focuses on
responsive user interaction and is concerned with minimizing response time.
14. Spatial Locality vs Temporal Locality
Spatial Locality refers to the tendency of a program to access memory
locations near recently accessed locations (like array elements in sequence).
Temporal Locality refers to the tendency to reuse recently accessed items in
the near future (like loop variables).
Both principles are exploited in caching strategies to improve performance.
15. Malware Types
• Virus: Malicious code that attaches to other programs and spreads when
the host program is executed
• Worm: Self-replicating malware that spreads across networks without
requiring user action
• Trojan: Malware disguised as legitimate software but performs malicious
actions
• Malware: General term for any malicious software designed to harm
systems
• Spyware: Software that collects information about users without their
knowledge

From <https://claude.ai/chat/28463ecf-ca64-435b-ba8d-6e52ac215fd3>

Gate Smashers Page 73

You might also like