0% found this document useful (0 votes)
186 views31 pages

Computer Education B.ed

The document provides an overview of operating systems, detailing their functions, types, and modes, as well as the distinction between hardware, software, and firmware. It also covers process management, including process states, transitions, and control mechanisms, alongside practical instructions for installing and configuring Windows 10. Additionally, it addresses deadlock and indefinite postponement in operating systems, outlining necessary conditions for deadlock and strategies for prevention and avoidance.

Uploaded by

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

Computer Education B.ed

The document provides an overview of operating systems, detailing their functions, types, and modes, as well as the distinction between hardware, software, and firmware. It also covers process management, including process states, transitions, and control mechanisms, alongside practical instructions for installing and configuring Windows 10. Additionally, it addresses deadlock and indefinite postponement in operating systems, outlining necessary conditions for deadlock and strategies for prevention and avoidance.

Uploaded by

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

EDUC-1186: COMPUTER APPLICATION

Credit Hours: 3 (2+1)


Unit 1

Introduction to Operating systems


Introduction to Operating Systems

What is an Operating System?

An Operating System (OS) is a software that acts as an intermediary between the user and the
computer hardware. It manages hardware resources, provides common services for computer
programs, and allows users to interact with the system without needing to understand the
complexities of the hardware.

Key Functions of an OS:

1. Resource Management: Allocates CPU, memory, storage, and other hardware resources to
programs.

2. Process Management: Handles the execution of multiple processes, ensuring efficient CPU
utilization.

3. Memory Management: Manages primary memory (RAM) and allocates it to processes.

4. File System Management: Organizes and manages files and directories on storage devices.

5. Device Management: Controls and communicates with hardware devices like printers,
keyboards, and disks.

6. Security and Access Control: Protects data and resources from unauthorized access.

7. User Interface: Provides a way for users to interact with the system (e.g., GUI or command
line).

Types of Operating Systems

1. Batch Operating System:

o Processes are executed in batches.

o No user interaction during execution.

o Example: Early mainframe systems.

2. Time-Sharing Operating System:

o Multiple users share the system simultaneously.

o CPU time is divided among users.


o Example: Unix, Linux.

3. Real-Time Operating System (RTOS):

o Designed for real-time applications.

o Processes must complete within strict time constraints.

o Examples: VxWorks, QNX.

4. Distributed Operating System:

o Manages a group of independent computers as a single system.

o Resources are shared across multiple machines.

o Examples: Google’s Borg, Apache Hadoop.

5. Network Operating System:

o Manages network resources and allows multiple computers to communicate.

o Examples: Windows Server, Novell NetWare.

6. Mobile Operating System:

o Designed for mobile devices like smartphones and tablets.

o Examples: Android, iOS.

7. Embedded Operating System:

o Used in embedded systems like IoT devices, cars, and appliances.

o Examples: FreeRTOS, Embedded Linux.

Operating System Modes

1. User Mode:

o Programs run in user mode with limited access to hardware.

o Prevents unauthorized access to critical system resources.

o If a program tries to access hardware directly, the OS intervenes.

2. Kernel Mode:

o The OS runs in kernel mode with full access to hardware.

o Allows execution of privileged instructions.


o Critical tasks like memory management and process scheduling are performed here.

Hardware, Software, Firmware

1. Hardware

 Definition: Physical components of a computer system.

 Examples: CPU, RAM, Hard Drive, Motherboard, Keyboard, Mouse, etc.

 Role: Provides the infrastructure for software to run.

2. Software

 Definition: A collection of instructions that tell the hardware how to perform tasks.

 Types:

o System Software: Manages hardware and provides a platform for applications (e.g.,
OS, device drivers).

o Application Software: Performs specific tasks for users (e.g., Word processors, web
browsers).

 Role: Enables users to interact with hardware and perform tasks.

3. Firmware

 Definition: A type of software embedded into hardware devices.

 Examples: BIOS (Basic Input/Output System), UEFI (Unified Extensible Firmware Interface).

 Role: Provides low-level control for hardware and acts as a bridge between hardware and
software.

Comparison of Hardware, Software, and Firmware

Aspect Hardware Software Firmware

Definition Physical components Instructions for hardware Embedded software in hardware

Examples CPU, RAM, Hard Drive OS, Applications BIOS, UEFI

Role Provides infrastructure Enables task execution Low-level hardware control

Volatility Non-volatile (persistent) Volatile (can be changed) Semi-volatile (updatable)


Unit 2

Process Management

1. Introduction

 A process is a program in execution. It is the basic unit of work in an operating system.

 Processes are managed by the OS, which allocates resources, schedules tasks, and ensures
proper execution.

 Each process has its own address space, which includes code, data, and stack.

2. Definitions of Process

 Process: An instance of a program in execution. It includes the program code, current


activity (program counter, registers), and resources (memory, files, etc.).

 Program: A static entity stored on disk (e.g., an executable file).

 Process vs. Program: A program becomes a process when it is loaded into memory and
executed.

3. Process States

A process can be in one of the following states during its lifecycle:

 New: The process is being created.

 Ready: The process is waiting to be assigned to a processor (CPU).

 Running: The process is being executed by the CPU.

 Waiting/Blocked: The process is waiting for an event (e.g., I/O completion, signal).

 Terminated: The process has finished execution.

4. Process State Transitions

 New → Ready: The OS initializes the process and moves it to the ready queue.

 Ready → Running: The scheduler selects the process for execution.

 Running → Waiting: The process requests an event (e.g., I/O) and is blocked.

 Waiting → Ready: The event the process was waiting for occurs, and it is moved back to the
ready queue.

 Running → Ready: The process is preempted (e.g., time slice expires) and moved back to the
ready queue.

 Running → Terminated: The process completes execution or is terminated by the OS.


5. Process Control Block (PCB)

 The PCB is a data structure maintained by the OS for each process. It contains all the
information needed to manage and control the process.

 Contents of PCB:

o Process ID (PID): Unique identifier for the process.

o Process State: Current state of the process (e.g., running, waiting).

o Program Counter: Address of the next instruction to execute.

o CPU Registers: Contents of the CPU registers (e.g., accumulator, stack pointer).

o CPU Scheduling Information: Priority, scheduling queues, etc.

o Memory Management Information: Base and limit registers, page tables.

o Accounting Information: CPU time used, time limits, etc.

o I/O Status Information: List of open files, I/O devices in use.

6. Operations on Processes

 Process Creation: A new process is created using system calls like fork() (in Unix/Linux)
or CreateProcess() (in Windows).

 Process Termination: A process is terminated using system calls like exit() or due to errors
(e.g., segmentation fault).

 Process Switching: The OS saves the state of the current process (context switching) and
loads the state of the next process.

 Inter-Process Communication (IPC): Processes communicate using mechanisms like pipes,


shared memory, or message queues.

7. Suspend and Resume

 Suspend: A process is moved from memory to disk (swapped out) to free up resources. It
transitions to a suspended state (e.g., "Blocked/Suspend" or "Ready/Suspend").

 Resume: A suspended process is moved back to memory and resumes execution. It


transitions back to the ready or running state.

8. Interrupt Processing

 An interrupt is a signal to the CPU that an event needs immediate attention.

 Types of Interrupts:

o Hardware Interrupts: Generated by hardware devices (e.g., keyboard, timer).


o Software Interrupts: Generated by software (e.g., system calls, exceptions).

 Interrupt Handling:

1. The CPU saves the state of the current process (registers, program counter).

2. The OS identifies the interrupt and invokes the appropriate interrupt handler.

3. After handling the interrupt, the CPU restores the saved state and resumes the
interrupted process.

Summary Table: Process States and Transitions

State Transition Description

New → Ready Process is initialized and added to the ready queue.

Ready → Running Process is scheduled for execution by the CPU.

Running → Waiting Process requests an event (e.g., I/O) and is blocked.

Waiting → Ready Event occurs, and the process is moved back to the ready queue.

Running → Ready Process is preempted (e.g., time slice expires).

Running →
Process completes execution or is terminated.
Terminated

Running → Suspended Process is swapped out to disk (e.g., due to low memory).

Suspended → Ready Process is swapped back into memory and resumes execution.

Computer Lab Practical


Installation of Windows 10 Professional

1. Installation from CD/DVD

 Requirements:

o Windows 10 Professional installation CD/DVD.

o A computer with a CD/DVD drive.

o Valid product key for Windows 10 Professional.

o Minimum system requirements: 1 GHz processor, 2 GB RAM (64-bit), 20 GB free


hard disk space.
 Steps:

1. Insert the Windows 10 Professional CD/DVD into the drive.

2. Restart the computer and boot from the CD/DVD (may require changing boot order
in BIOS/UEFI).

3. Follow the on-screen instructions:

 Select language, time, and keyboard preferences.

 Click "Install Now."

 Enter the product key when prompted.

 Accept the license terms.

 Choose "Custom: Install Windows only (advanced)" for a fresh installation.

 Select the partition or drive where you want to install Windows.

 Wait for the installation to complete (the system may restart several times).

4. After installation, configure initial settings (region, keyboard layout, user account,
etc.).

2. Installation from Network

 Requirements:

o A network boot server (PXE server) configured with Windows 10 Professional


installation files.

o A computer with PXE-enabled network adapter.

o Valid product key for Windows 10 Professional.

 Steps:

1. Ensure the computer is connected to the network.

2. Restart the computer and boot from the network (PXE boot).

3. The computer will load the installation files from the network server.

4. Follow the on-screen instructions (similar to CD/DVD installation):

 Select language, time, and keyboard preferences.

 Enter the product key.

 Choose the installation type (Custom or Upgrade).


 Select the partition or drive for installation.

 Wait for the installation to complete.

5. Configure initial settings after installation.

Configuring the Windows 10 Environment

1. Control Panel

 Overview:

o The Control Panel is a centralized location for managing system settings and
configurations.

o Accessible via:

 Start Menu > Control Panel.

 Search for "Control Panel" in the taskbar.

 Key Features:

o System and Security: Configure firewall, update settings, and view system
information.

o Network and Internet: Manage network connections, Wi-Fi settings, and sharing
options.

o Hardware and Sound: Configure devices, printers, and sound settings.

o Programs: Install, uninstall, or modify software.

o User Accounts: Manage user accounts and passwords.

o Appearance and Personalization: Customize desktop, taskbar, and folder options.

o Clock and Region: Set time, date, and regional formats.

2. Management Console (MMC - Microsoft Management Console)

 Overview:

o A tool for managing system components and services.

o Accessible via:

 Search for "mmc" in the taskbar and press Enter.


 Key Snap-ins:

o Device Manager: Manage hardware devices and drivers.

o Disk Management: Manage disk partitions and volumes.

o Services: Start, stop, and configure system services.

o Event Viewer: View system logs and error messages.

o Task Scheduler: Schedule automated tasks.

o Local Users and Groups: Manage user accounts and permissions.

3. Installing New Hardware

 Steps:

1. Automatic Installation:

 Connect the hardware device (e.g., USB printer, external drive).

 Windows 10 will automatically detect and install drivers.

 If drivers are not found, Windows will prompt you to insert the driver CD or
download it from the internet.

2. Manual Installation:

 Open Device Manager (right-click Start Menu > Device Manager).

 If the device is not recognized, it may appear under "Other devices" with a
yellow exclamation mark.

 Right-click the device and select "Update Driver."

 Choose "Browse my computer for drivers" if you have the driver files.

 Follow the on-screen instructions to complete the installation.

3. Using Manufacturer’s Software:

 Some hardware comes with installation CDs or downloadable software.

 Run the setup file provided by the manufacturer to install drivers and
utilities.

 Troubleshooting:

o Ensure the hardware is compatible with Windows 10.


o Check for driver updates on the manufacturer’s website.

o Restart the computer after installation.

Unit 3

Dead lock and Indefinite Postponement


Deadlock in Operating Systems

Deadlock is a critical issue in operating systems where two or more processes


are unable to proceed because each is waiting for the other to release a
resource. This results in a standstill, where none of the processes can continue
execution.

1. Examples of Deadlock

Real-Life Example:

 Traffic Deadlock: Imagine a four-way intersection where four cars arrive


simultaneously, each wanting to go straight. If each car insists on going
forward without yielding, none can move, causing a deadlock.

Computer System Example:

 Resource Deadlock: Process A holds Resource 1 and requests Resource


2, while Process B holds Resource 2 and requests Resource 1. Both
processes wait indefinitely for the other to release the resource.

2. A Related Problem: Indefinite Postponement

 Definition: Indefinite postponement (or starvation) occurs when a


process is perpetually denied access to a resource it needs, even though
the resource is being allocated to other processes.

 Difference from Deadlock: In deadlock, processes are blocked


permanently, while in indefinite postponement, a process may
eventually get the resource after an unpredictable delay.
3. Resource Concepts

 Resources: Anything required by a process to execute, such as CPU,


memory, files, or I/O devices.

 Types of Resources:

o Preemptible: Can be taken away from a process (e.g., CPU).

o Non-preemptible: Cannot be taken away without causing issues


(e.g., a printer).

4. Four Necessary Conditions for Deadlock

For a deadlock to occur, the following four conditions must hold


simultaneously:

1. Mutual Exclusion: Only one process can use a resource at a time.

2. Hold and Wait: A process holds at least one resource and waits for
additional resources held by other processes.

3. No Preemption: Resources cannot be forcibly taken away from a


process; they must be released voluntarily.

4. Circular Wait: A circular chain of processes exists, where each process


waits for a resource held by the next process in the chain.

5. Deadlock Prevention

Deadlock prevention ensures that at least one of the four necessary conditions
for deadlock is never satisfied. Strategies include:

 Eliminate Mutual Exclusion: Allow shared access to resources (not


always feasible).

 Eliminate Hold and Wait: Require processes to request all resources at


once or release all resources before requesting new ones.

 Allow Preemption: Take resources away from processes if needed.


 Break Circular Wait: Impose a total ordering of resource types and
require processes to request resources in increasing order.

6. Deadlock Avoidance and the Banker’s Algorithm

 Deadlock Avoidance: The system dynamically checks whether allocating


a resource will lead to a deadlock. If so, the allocation is denied.

 Banker’s Algorithm:

o A resource allocation algorithm used to avoid deadlock.

o Works by simulating resource allocation and checking for a safe


sequence.

o Safe State: A state where the system can allocate resources in


such a way that all processes can complete without deadlock.

o Steps:

1. Calculate the available resources.

2. Find a process whose resource needs can be satisfied with


the available resources.

3. Assume the process completes and releases its resources.

4. Repeat until all processes are completed (safe state) or no


such sequence exists (unsafe state).

7. Deadlock Detection

 Definition: The system periodically checks for the presence of deadlock.

 Methods:

o Resource Allocation Graph (RAG): A graphical representation of


processes and resources. A cycle in the graph indicates a deadlock.
o Wait-for Graph: A simplified version of RAG where only processes
are represented. A cycle indicates a deadlock.

8. Deadlock Recovery

Once a deadlock is detected, the system must recover. Recovery methods


include:

1. Process Termination:

o Abort all deadlocked processes.

o Abort one process at a time until the deadlock is resolved.

2. Resource Preemption:

o Temporarily take resources from processes and allocate them to


others.

o Requires careful handling to avoid starvation or repeated


deadlocks.

Summary Table

Concept Description

A situation where processes are blocked waiting for


Deadlock
each other’s resources.

Indefinite A process is delayed indefinitely due to resource


Postponement allocation policies.

Mutual Exclusion, Hold and Wait, No Preemption,


Four Conditions
Circular Wait.

Prevention Ensure at least one condition is never met.

Use algorithms like Banker’s to ensure safe resource


Avoidance
allocation.
Concept Description

Detection Use RAG or Wait-for Graph to identify deadlocks.

Terminate processes or preempt resources to resolve


Recovery
deadlock.

Unit 4
Memory Management (Real Storage)

Introduction to Storage Management

Storage management is a critical aspect of computer systems, ensuring


efficient use of storage resources to meet the demands of applications and
users. It involves organizing, allocating, and managing storage resources such
as memory, disk space, and other storage devices. Effective storage
management ensures optimal performance, reliability, and scalability of
systems.

Storage Organizations

Storage organization refers to how data is structured and stored in a computer


system. There are two main types:

1. Primary Storage (Main Memory):

o Volatile storage (data is lost when power is off).

o Directly accessible by the CPU.

o Examples: RAM, Cache Memory.

2. Secondary Storage:

o Non-volatile storage (data persists even when power is off).

o Not directly accessible by the CPU; data must be transferred to


primary storage first.
o Examples: Hard Disk Drives (HDDs), Solid-State Drives (SSDs),
Optical Disks, Magnetic Tapes.

3. Tertiary Storage:

o Used for archival and backup purposes.

o Slower access compared to primary and secondary storage.

o Examples: Tape Libraries, Cloud Storage.

Storage Management

Storage management involves techniques and strategies to efficiently allocate,


monitor, and optimize storage resources. Key tasks include:

1. Allocation: Assigning storage space to processes or files.

2. Deallocation: Freeing up storage space when no longer needed.

3. Monitoring: Tracking storage usage and performance.

4. Optimization: Improving storage efficiency and performance.

5. Protection: Ensuring data integrity and security.

Storage Hierarchy

The storage hierarchy organizes storage devices based on their speed, cost,
and capacity. It is structured as follows:

1. Registers: Fastest and most expensive; located inside the CPU.

2. Cache Memory: Faster than main memory; used to store frequently


accessed data.

3. Main Memory (RAM): Faster than secondary storage but volatile.

4. Secondary Storage (HDDs/SSDs): Non-volatile and larger capacity than


main memory.
5. Tertiary Storage (Tapes/Cloud): Used for long-term storage and backups.

The hierarchy ensures a balance between speed, cost, and capacity, with faster
storage being more expensive and smaller in size.

Storage Management Strategies

1. Contiguous Storage Allocation:

o Files are stored in consecutive blocks of memory.

o Advantages:

 Simple to implement.

 Fast access due to sequential storage.

o Disadvantages:

 Fragmentation (internal and external).

 Difficult to resize files.

2. Non-Contiguous Storage Allocation:

o Files are stored in non-consecutive blocks of memory.

o Types:

 Linked Allocation: Each block points to the next block.

 Indexed Allocation: An index block stores pointers to all


blocks of a file.

o Advantages:

 No external fragmentation.

 Easy to resize files.

o Disadvantages:

 Slower access due to non-sequential storage.


 Overhead of maintaining pointers or index blocks.

Contiguous vs. Non-Contiguous Storage Allocation

Feature Contiguous Allocation Non-Contiguous Allocation

Storage Layout Consecutive blocks Non-consecutive blocks

External and internal


Fragmentation No external fragmentation
fragmentation

Access Speed Faster Slower

File Resizing Difficult Easier

Implementation Simple Complex

Modern file systems (e.g., FAT,


Examples Early file systems
NTFS)

Key Points to Remember

1. Storage Hierarchy: Balances speed, cost, and capacity.

2. Contiguous Allocation: Simple but prone to fragmentation.

3. Non-Contiguous Allocation: Flexible but slower access.

4. Storage Management: Ensures efficient use of storage resources through


allocation, monitoring, and optimization.

Unit 5

Virtual Memory

Introduction to the Evolution of Storage Organizations

Storage organizations have evolved significantly over time to meet the growing
demands of computing systems. Early systems relied on simple storage
mechanisms, but as applications became more complex, storage organizations
advanced to improve efficiency, scalability, and performance. Key milestones
include:

1. Magnetic Tape Storage: Early systems used sequential access storage


devices like magnetic tapes.

2. Hard Disk Drives (HDDs): Introduced random access storage, enabling


faster data retrieval.

3. Solid-State Drives (SSDs): Provided even faster access times and


improved reliability.

4. Virtual Storage: Introduced the concept of abstracting physical storage


to provide flexibility and efficiency.

5. Cloud Storage: Enabled distributed and scalable storage solutions over


the internet.

Virtual Storage: Basic Concepts

Virtual storage is a technique that abstracts physical storage resources to


create a logical view of storage for applications and users. Key concepts
include:

1. Virtual Memory:

o Extends the available memory by using secondary storage (e.g.,


disk) as an extension of RAM.

o Allows processes to use more memory than physically available.

2. Paging:

o Divides memory into fixed-size blocks called pages.

o Pages are swapped between RAM and disk as needed.

3. Segmentation:

o Divides memory into variable-sized blocks called segments.

o Each segment represents a logical unit (e.g., function, data


structure).
4. Address Translation:

o Maps virtual addresses (used by processes) to physical addresses


(actual memory locations).

o Managed by the Memory Management Unit (MMU).

5. Benefits of Virtual Storage:

o Efficient memory utilization.

o Isolation between processes.

o Simplified memory management for applications.

Multilevel Storage Organizations

Multilevel storage organizations use a hierarchy of storage devices to balance


speed, cost, and capacity. The levels include:

1. Registers: Fastest and smallest storage, located inside the CPU.

2. Cache Memory: Faster than main memory; stores frequently accessed


data.

3. Main Memory (RAM): Faster than secondary storage but volatile.

4. Secondary Storage (HDDs/SSDs): Non-volatile and larger capacity than


main memory.

5. Tertiary Storage (Tapes/Cloud): Used for long-term storage and backups.

Key Principles:

 Data is moved between levels based on usage patterns.

 Faster storage is more expensive and smaller in size.

 Slower storage is cheaper and larger in capacity.

Block Mapping
Block mapping is a technique used in storage systems to manage data
allocation and retrieval. It involves mapping logical blocks (used by
applications) to physical blocks (on storage devices). Key concepts include:

1. Logical Block Address (LBA):

o A unique identifier for a block of data used by the operating


system or application.

2. Physical Block Address (PBA):

o The actual location of the block on the storage device.

3. Mapping Techniques:

o Direct Mapping: Each logical block maps to a specific physical


block.

o Associative Mapping: Logical blocks can map to any physical block.

o Set-Associative Mapping: A compromise between direct and


associative mapping.

4. Applications:

o Used in file systems, virtual memory, and storage area networks


(SANs).

Segmentation

Segmentation is a memory management technique that divides memory into


variable-sized segments, each representing a logical unit. Key features include:

1. Segment Table:

o Stores information about each segment, such as its base address


and length.

2. Logical Address:

o Consists of a segment number and an offset within the segment.

3. Address Translation:
o The segment number is used to find the base address in the
segment table.

o The offset is added to the base address to get the physical


address.

4. Advantages:

o Supports dynamic memory allocation.

o Facilitates sharing and protection of memory segments.

5. Disadvantages:

o External fragmentation can occur.

o More complex to manage than paging.

Key Points to Remember

1. Evolution of Storage: From magnetic tapes to cloud storage, storage


organizations have evolved to meet increasing demands.

2. Virtual Storage: Abstracts physical storage to provide flexibility and


efficiency.

3. Multilevel Storage: Balances speed, cost, and capacity using a hierarchy


of storage devices.

4. Block Mapping: Maps logical blocks to physical blocks for efficient data
management.

5. Segmentation: Divides memory into variable-sized segments for logical


memory management.

These notes provide a detailed overview of the evolution of storage


organizations, virtual storage concepts, multilevel storage, block mapping, and
segmentation. Let me know if you need further clarification or additional
details!
Unit 6
File System Management

1. Directories and Names

 Directories:
o Also known as folders, directories are containers used to organize
files and other directories.
o They form a hierarchical structure, often represented as a tree.
o Example: /home/user/documents/
 Names:
o Files and directories are identified by names.
o Naming conventions vary by file system (e.g., case sensitivity,
allowed characters, length restrictions).
o Example: report.txt, image.png.

2. Types of File System Objects

File systems manage different types of objects:

 Files:
o Basic units of storage containing data (e.g., text, images,
executables).
 Directories:
o Special files that store references to other files and directories.
 Symbolic Links (Symlinks):
o Pointers to other files or directories.
 Hard Links:
o Multiple directory entries pointing to the same file data.
 Special Files:
o Represent devices or system resources (e.g., /dev/null in Unix-like
systems).
 Sockets and Pipes:
o Used for inter-process communication.
3. File System Functions

File systems provide core functionalities:

 Storage Management:
o Allocate and deallocate space for files.
 Metadata Management:
o Store and manage file attributes (e.g., size, permissions,
timestamps).
 Access Control:
o Enforce permissions and security policies.
 Data Integrity:
o Ensure data consistency (e.g., journaling, checksums).
 File Operations:
o Create, read, write, delete, and rename files.
 Directory Operations:
o Create, list, and navigate directories.
 Search and Indexing:
o Enable efficient file lookup.

4. Information Types in File Systems

File systems store and manage various types of information:

 File Data:
o The actual content of files.
 Metadata:
o Information about files, such as:

 Name, size, type, permissions, ownership, timestamps


(creation, modification, access).
 File System Metadata:
o Information about the file system itself, such as:

 Free space, block size, inode tables, journaling logs.

5. File System Architecture


File systems are typically organized into layers:

1. Application Layer:
o Interfaces with user applications
(e.g., open(), read(), write() system calls).
2. Logical File System:
o Manages metadata, directories, and file paths.
3. File Organization Module:
o Translates logical file blocks to physical blocks.
4. Basic File System:
o Handles physical block allocation and deallocation.
5. I/O Control:
o Manages device drivers and hardware interactions.
6. Storage Devices:
o Physical media (e.g., HDD, SSD, tape).

6. Types of File Systems

File systems vary based on use cases and operating systems:

 Disk-Based File Systems:


o NTFS (Windows), ext4 (Linux), HFS+ (macOS).
 Network File Systems:
o NFS (Network File System), SMB (Server Message Block).
 Flash-Based File Systems:
o Optimized for SSDs and USB drives (e.g., F2FS, exFAT).
 Database File Systems:
o Store files in a database (e.g., WinFS).
 Distributed File Systems:
o Span multiple servers (e.g., Hadoop HDFS, GlusterFS).

7. Key Concepts in File System Design

 Hierarchy:
o Tree-like structure for organizing files and directories.
 Mounting:
o Attaching a file system to a directory in another file system.
 Journaling:
o Logging changes to ensure recovery after crashes.
 Fragmentation:
o Files stored in non-contiguous blocks (e.g., external vs. internal
fragmentation).
 Permissions and Security:
o Access control lists (ACLs), user/group permissions.
MCQ, s
Unit 1: Introduction to Operating Systems

1. What is the primary function of an Operating System (OS)?

o a) To manage hardware resources

o b) To provide a user interface

o c) To execute application software

o d) All of the above


Answer: d) All of the above

2. Which of the following is NOT a type of Operating System?

o a) Batch Operating System

o b) Time-Sharing Operating System

o c) Real-Time Operating System

o d) Database Operating System


Answer: d) Database Operating System

3. Which mode allows the OS to have full access to hardware?

o a) User Mode

o b) Kernel Mode

o c) Safe Mode

o d) Debug Mode
Answer: b) Kernel Mode

4. What is the role of firmware in a computer system?

o a) To manage hardware resources

o b) To provide low-level control for hardware

o c) To execute application software

o d) To provide a user interface


Answer: b) To provide low-level control for hardware

Unit 2: Process Management


5. What is a Process Control Block (PCB)?

o a) A block of memory allocated to a process

o b) A data structure that contains information about a process

o c) A type of CPU register

o d) A file that stores process data


Answer: b) A data structure that contains information about a process

6. Which of the following is NOT a process state?

o a) New

o b) Ready

o c) Running

o d) Idle
Answer: d) Idle

7. What happens during a context switch?

o a) The CPU switches from user mode to kernel mode

o b) The OS saves the state of the current process and loads the state of the next
process

o c) The process is terminated

o d) The process is moved from memory to disk


Answer: b) The OS saves the state of the current process and loads the state of the
next process

8. Which of the following is a method of Inter-Process Communication (IPC)?

o a) Pipes

o b) Shared Memory

o c) Message Queues

o d) All of the above


Answer: d) All of the above

Unit 3: Deadlock and Indefinite Postponement

9. Which of the following is NOT a necessary condition for deadlock?

o a) Mutual Exclusion
o b) Hold and Wait

o c) Preemption

o d) Circular Wait
Answer: c) Preemption

10. What is the main purpose of the Banker's Algorithm?

o a) To detect deadlock

o b) To prevent deadlock

o c) To avoid deadlock

o d) To recover from deadlock


Answer: c) To avoid deadlock

11. Which of the following is a method for deadlock recovery?

o a) Process Termination

o b) Resource Preemption

o c) Both a and b

o d) None of the above


Answer: c) Both a and b

12. What is the difference between deadlock and indefinite postponement?

o a) Deadlock is temporary, while indefinite postponement is permanent

o b) Deadlock is permanent, while indefinite postponement is temporary

o c) Deadlock involves resource allocation, while indefinite postponement does not

o d) There is no difference
Answer: b) Deadlock is permanent, while indefinite postponement is temporary

Unit 4: Memory Management

13. Which of the following is an example of primary storage?

o a) Hard Disk Drive (HDD)

o b) Solid-State Drive (SSD)

o c) RAM
o d) Magnetic Tape
Answer: c) RAM

14. What is the main disadvantage of contiguous storage allocation?

o a) External fragmentation

o b) Internal fragmentation

o c) Both a and b

o d) None of the above


Answer: c) Both a and b

15. Which of the following is NOT a level in the storage hierarchy?

o a) Registers

o b) Cache Memory

o c) Main Memory

o d) Cloud Storage
Answer: d) Cloud Storage

16. What is the purpose of the Memory Management Unit (MMU)?

o a) To manage CPU registers

o b) To translate virtual addresses to physical addresses

o c) To allocate memory to processes

o d) To manage disk storage


Answer: b) To translate virtual addresses to physical addresses

Unit 5: Virtual Memory

17. What is the main purpose of virtual memory?

o a) To extend the available memory by using secondary storage

o b) To increase the speed of the CPU

o c) To manage disk storage

o d) To allocate memory to processes


Answer: a) To extend the available memory by using secondary storage

18. Which of the following is a technique used in virtual memory management?


o a) Paging

o b) Segmentation

o c) Both a and b

o d) None of the above


Answer: c) Both a and b

19. What is the main advantage of segmentation over paging?

o a) Faster access time

o b) No external fragmentation

o c) Supports dynamic memory allocation

o d) Easier to implement
Answer: c) Supports dynamic memory allocation

20. Which of the following is NOT a type of block mapping?

o a) Direct Mapping

o b) Associative Mapping

o c) Set-Associative Mapping

o d) Sequential Mapping
Answer: d) Sequential Mapping

Unit 6: File System Management

21. Which of the following is NOT a type of file system object?

o a) Files

o b) Directories

o c) Symbolic Links

o d) CPU Registers
Answer: d) CPU Registers

22. What is the main purpose of journaling in a file system?

o a) To improve file access speed

o b) To ensure data integrity and recovery after crashes

o c) To manage disk fragmentation


o d) To allocate memory to processes
Answer: b) To ensure data integrity and recovery after crashes

23. Which of the following is an example of a disk-based file system?

o a) NTFS

o b) NFS

o c) F2FS

o d) HDFS
Answer: a) NTFS

24. What is the main purpose of mounting in a file system?

o a) To attach a file system to a directory in another file system

o b) To create a new file system

o c) To delete a file system

o d) To format a file system


Answer: a) To attach a file system to a directory in another file system

You might also like