Overview of Operating system
Overview of Operating system
Overview of Operating system
1. Process Management:
2. Memory Management:
4. Device Management:
6. User Interface:
1. Kernel:
2. Shell:
2. System View:
2. Time-Sharing Systems:
3. Personal Computing:
4. Distributed Systems:
5. Real-Time Systems:
2. Time-Sharing Systems:
Process Control Block (PCB): A data structure in the OS that contains information
about a specific process, such as:
1. Process State: Current state (new, ready, running, waiting, terminated).
2. Process ID: Unique identifier for the process.
3. Program Counter: Address of the next instruction to be executed.
4. CPU Registers: Contents of all process-specific registers.
5. Memory Management Information: Base and limit registers, page tables.
6. I/O Status Information: List of I/O devices allocated.
7. Accounting Information: CPU used, clock time elapsed, time limits.
State Transition Diagram: Represents the various states a process can be in and the
transitions between these states:
Scheduling Queues: Processes are placed in different queues based on their state:
Types of Schedulers:
3. Medium-Term Scheduler:
Benefits of Threads:
Types of Threads:
1. Critical Section: Part of the program where shared resources are accessed.
2. Mutual Exclusion: Ensures that only one process accesses the critical section
at a time.
3. Synchronization Mechanisms:
o Semaphores: Integer variable used for signaling between processes.
o Mutexes: Locks that provide mutual exclusion.
o Monitors: High-level synchronization constructs that provide a
mechanism for threads to safely access shared resources.
CPU I/O Burst Cycle: Processes alternate between CPU bursts (processing) and I/O
bursts (waiting for I/O operations). CPU scheduling decisions are made based on
these cycles.
Scheduling Criteria:
Scheduling Algorithms:
o Each process gets a small unit of CPU time (time quantum) in a cyclic
order.
o Fair and simple but performance depends on the size of the time
quantum.
UNIT – 2
Memory Management
Relocation: Relocation is the process of adjusting addresses used in the code so that
the program can be loaded anywhere in memory. This involves changing the
addresses used in the code to match the actual physical addresses assigned to the
program during loading.
Loading: Loading is the process of bringing the program into memory from
secondary storage for execution. Depending on the OS, this can involve loading the
entire program at once or loading parts of the program as needed.
Linking: Linking combines multiple object files into a single executable file. There are
two types:
1. Static Linking: All the code needed is combined by the linker at compile time.
2. Dynamic Linking: Code is not included until runtime, reducing the executable
file size and allowing for updates without recompiling.
• Page Fault: Occurs when a program tries to access a page that is not currently
in memory, triggering the OS to fetch the page from disk.
Page Replacement Algorithms: When a page fault occurs and there is no free
frame available, the OS must replace one of the pages in memory. Common page
replacement algorithms include:
1. First-In-First-Out (FIFO):
o Replaces the page that has not been used for the longest period.
o Provides good performance but requires hardware support or
additional data structures.
o Replaces the page that will not be used for the longest period in the
future.
o Theoretical best performance but not implementable in practice since it
requires future knowledge.
4. Clock (Second Chance):
UNIT – 3
• I/O Devices: These are peripherals that facilitate the input and output
operations of a computer. They are crucial for user interaction and data
exchange with external devices. Examples include keyboards, mice, monitors,
printers, scanners, and network adapters.
• I/O Controllers: These are hardware components that manage the
communication between the CPU, memory, and I/O devices. They handle data
transfer, error detection and correction, and synchronization of operations. I/O
controllers often include buffer memory to temporarily store data and
manage data flow rates between devices and the CPU.
Device Drivers:
Disk Storage:
• Disk storage is a non-volatile storage medium used for storing data and
programs. It consists of one or more disks (or platters) coated with a magnetic
material. Data is stored magnetically on the disk's surface.
• Disk storage is organized into tracks (concentric circles on a disk) and sectors
(segments of a track). The operating system uses a file system to manage the
storage and retrieval of data on the disk.
File Management
Basic Concepts:
File Operations:
• Create: Allows the creation of a new file. The operating system assigns a
unique file identifier (inode) to the file and initializes its attributes.
• Open: Opens an existing file for reading, writing, or both. The operating
system locates the file on disk and creates a file descriptor to track the file's
status and position.
• Read: Reads data from a file into memory. The operating system manages the
data transfer between the file and the requesting process.
• Write: Writes data from memory to a file. The operating system ensures that
the data is written correctly and updates the file's attributes.
• Close: Closes an open file, freeing up system resources. The operating system
releases the file descriptor associated with the file.
• Delete: Deletes a file from the file system. The operating system removes the
file's entry from the directory and marks the disk space occupied by the file as
available.
Access Methods:
• Sequential Access: Data is read or written sequentially from the beginning of
the file to the end. This access method is efficient for processing data in a
linear manner, such as reading log files.
• Direct Access: Also known as random access, allows data to be read or
written at any point in the file. This access method is more flexible but may be
less efficient for large sequential operations.
File Protection:
Effective I/O device management and file management are critical for the efficient
and secure operation of an operating system. They ensure that users can interact
with the system and their data effectively while maintaining the integrity and security
of the system.
UNIT – 4
Characteristics:
Architecture:
Issues:
Architecture:
Structure:
Characteristics:
Structure:
Scheduling: