1) - Types of Operating Systems?
1) - Types of Operating Systems?
1. Batch Operating System: Executes a sequence of jobs in a batch without user interaction.
2. Time-Sharing Operating System: Allows multiple users to share the same computer resources
simultaneously.
4. Network Operating System: Designed for use on a network of computers, allowing multiple
devices to communicate and share resources.
5. Real-Time Operating System (RTOS): Responds to inputs and events in a predictable and timely
manner, often used in applications that require strict timing constraints.
6. Mobile Operating System: Designed for mobile devices, such as smartphones and tablets,
providing a user-friendly interface and optimized for battery life.
- Windows (Microsoft)
- macOS (Apple)
- Linux (Open-source)
- Android (Google)
- iOS (Apple)
- Chrome OS (Google)
Each type of operating system has its own strengths and weaknesses, and is suited for specific use
cases and applications.
2). Brief History of Operating System?
First-Fit Allocation
• Method: Scans memory from the beginning and allocates the first block
that is large enough.
• Pros:
o Fast allocation (less search time).
o Simple to implement.
• Cons:
o Can lead to many small fragments at the beginning of memory
(external fragmentation).
• Example: If blocks are [100KB, 500KB, 200KB, 300KB] and a 212KB
process arrives, it skips 100KB and allocates in 500KB (first suitable
one).
Best-Fit Allocation
• Method: Searches entire memory and allocates the smallest block that
fits the process.
• Pros:
o Minimizes wasted space (reduces leftover memory).
• Cons:
o Slower due to full search.
o Can create many small unusable fragments.
• Example: With the same blocks, it will allocate 300KB block (best
fitting) for the 212KB process, not 500KB.
Comparison Summary
Virtual Memory
Cache Memory
• Definition: Cache Memory is a small, very fast memory located inside
or near the CPU.
• Purpose: Speeds up access to frequently used data and instructions.
• Location: Located inside the CPU (L1, L2, and L3 cache levels).
• Working:
o Stores copies of data from frequently used main memory
locations.
o CPU first checks Cache before accessing RAM.
• Speed: Faster than RAM (and much faster than Virtual Memory).
Example:
When a CPU needs to perform a calculation, it first looks into Cache Memory
for required data.
Comparison Summary
Speed Slow (Hard Disk/SSD speed) Very fast (faster than RAM)
How It Works:
1. Logical Memory (process) is divided into pages (say 4 KB each).
2. Physical Memory (RAM) is divided into frames of the same size (4 KB).
3. When a process is loaded, its pages are loaded into any available
frames in RAM.
4. The Page Table keeps track of which page is stored in which frame.
Important Terms:
• Page: A fixed-size block of a process.
• Frame: A fixed-size block of physical memory.
• Page Table: A table used by the operating system to map pages to
frames.
Advantages:
• No External Fragmentation: Every frame is the same size.
• Efficient Memory Usage: Memory is used fully without large unusable
holes.
• Easy Swapping: Pages can be easily moved in and out.
Disadvantages:
• Internal Fragmentation: Last page may not fill the entire frame.
• Overhead: Maintaining a page table requires additional memory and
CPU time.
Example:
Imagine a program of size 10 KB. If each page/frame is 4 KB:
• Program is divided into 3 pages:
o Page 1 → 4 KB
o Page 2 → 4 KB
o Page 3 → 2 KB (last page not fully filled).
• These pages are loaded into any 3 free frames in RAM.
Page Table:
Page 0 -> Frame 5
Page 1 -> Frame 12
Page 2 -> Frame 3
Device Description
Cassette Tapes Used for audio recording and storage. Access is linear.
Device Description
Data Tapes used for storing computer data, especially for backup
Cartridges purposes in businesses.
Paper Tapes Early form of data storage where holes punched into paper
(historic) tape represented data.
Key Features:
• Slow access speed (must move sequentially).
• Low cost and high storage capacity (good for backup).
• Good for archival storage — not ideal for frequent read/write
operations.
• Durable when stored properly (especially magnetic tapes).
Advantages:
• Inexpensive for storing large amounts of data.
• Very reliable for long-term storage.
Disadvantages:
• Slow data retrieval (not good for quick random access).
• Wear and tear over time (mechanical parts).
Quick Comparison:
Cost Low
Feature Sequential Access Storage
1. Seek Time
• Definition: Time taken for the read/write head to move to the
correct track on the disk.
• Example: Like moving the arm of a record player to the correct
circle (track) on a vinyl record.
• Typical Value: 2 ms to 10 ms (milliseconds).
2. Rotational Latency
• Definition: After reaching the track, it is the time waiting for
the disk to rotate so that the correct sector comes under the
head.
• Depends on: Disk’s rotation speed (measured in RPM —
Revolutions Per Minute).
• Example: Waiting for a specific word on a spinning wheel to
come in front of you.
• Typical Value: Around 2 ms to 5 ms.
Quick Example:
If:
• Seek Time = 4 ms
• Rotational Latency = 3 ms
• Data Transfer Time = 0.5 ms
Then:
Total Access Time=4+3+0.5=7.5 ms\text{Total Access Time} = 4 + 3 +
0.5 = 7.5 \, \text{ms}Total Access Time=4+3+0.5=7.5ms
Summary Table
Term Meaning Typical Time
Summary:
Feature Description
macOS Finder
My Files / File
Android
Manager apps
Advanced Interactions:
• Set file permissions (who can read/write/execute).
• Map network drives or access cloud storage.
• Use command line for file management (e.g., cd, ls, cp, rm in
Linux).
Example Tasks:
Create a new folder
Move a photo to another directory
Delete old documents
Rename a downloaded file
Search for a file modified last week