BCA / B.Tech 13 min read

Segmentation in Operating System

Segmentation in Operating System:


In computer memory management, Segmentation is an important technique that efficiently manages memory by dividing a process into its logical parts. The purpose of segmentation is to ensure that different parts of a process (like code, data, stack, etc.) can be stored in different locations in memory and accessed independently. This technique helps to overcome the limitations found in techniques like contiguous allocation and paging.

What is Segmentation?

Segmentation is a memory management scheme in which a process is divided into different logical segments, where each segment has its own name and length. These segments can be stored anywhere in physical memory, but each segment operates independently. For each segment, a Segment Table is created, which stores the base address and the length of that segment.

Segments of a Process:

Each process can be logically divided into the following segments: Code Segment, Data Segment, Stack Segment, and Heap Segment. Each segment can have a different size and length and can be accessed independently.

Types of Segmentation:

1. Pure Segmentation: All segments of a process are logically divided and allocated different physical memory blocks.
2. Segmentation with Paging: A hybrid memory management scheme where both segmentation and paging are used. Each segment is divided into smaller pages. This helps solve the problem of external fragmentation.

Advantages of Segmentation:

  • Logical Division: It divides the process into logical segments, making management more efficient.
  • Avoids External Fragmentation: Since segments can be placed in non-contiguous memory locations, it reduces external fragmentation.
  • Independence from Contiguity: Segments do not need to be in continuous memory blocks.
  • Data Protection: Each segment has its own base address and limit, which helps in providing data security.
  • Support for Modular Programming: It supports modular programming by allowing different modules to be placed in different segments.

Disadvantages of Segmentation:

  • External Fragmentation: Can still occur if segments are of different sizes and there isn't enough continuous free space.
  • Complexity in Management: Managing segment tables for each segment is complex and adds overhead.
  • Limitations on Process Size: It can be difficult to store all segments of a large process if only small memory chunks are available.
  • Determining Length: The length of a segment is predetermined, which reduces flexibility if the segment needs to grow.

Segment Table and Address Translation:

A segment table is created for each process, containing the base address and limit for each segment. The CPU uses this table to translate a logical address (Segment Number, Offset) into a physical address (`Physical Address = Base Address + Offset`).

In this Chapter

Segmentation in Operating System
Distributed System in Operating System
Real-Time System in Operating System
System Calls in Operating System
System Programs in Operating System
Structure of an Operating System
Layered Design of an Operating System Structure
UNIX in Operating System
Virtual Machine in Operating System
Kernel-Based Operating System
Process Concept in Operating System
Interacting Processes in Operating System
Threads in Operating System
Fundamentals of Scheduling in Operating System
Scheduling Criteria in Operating System
Long, Medium, and Short-Term Scheduling
Scheduling Algorithms in Operating System
Structure of a Concurrent System
Critical Region in Operating System
Critical Section in Operating System
Inter-process Communication (IPC) in Operating System
Monitors in Operating System
Semaphores in Operating System
Semaphore Implementation & Uses in Operating System
Logical and Physical Address in Operating System
Swapping in Operating System
Contiguous Allocation in Operating System
Paging in Operating System
Virtual Memory using Segmentation in Operating System
Interprocess Communication Protocol in Operating System
Network Operating System
Design Issues in Distributed File System
Network Structure in Operating System
Structure of a Distributed System
File System and Coordination in Operating System
History of Linux in Operating System
Linux Commands
Programmer Interface & File Manipulation in Linux
Process Control in Linux
Kernel & Signals in Linux
File System in Linux
Blocks and Inodes in Linux
System Editors in Linux
Character Transliteration in Linux
The `ed` Line Editor in Linux
The `vi` Editor and Its Commands
Shell Scripting in Linux
Looping & Decision Making in Linux Shell Scripting
Variables & File Name Expansion in Linux
Arrays in Linux Shell Scripting
Subprograms (Functions) in Linux Shell Scripting
C Interface with Linux
Simple Shell Programs in Linux
BCA Part-1 | Operating Systems | Semester-I | MDSU Exam Paper 2023 (Held in 2024)
What is an Operating System (OS)
Operating System (OS) All Important Questions and Answers in English (MDSU)
BCA || Operating System 2025 Paper || MDSU Exam Paper
BCA | OS(Operating System) 2023 Paper | MDSU Exam Paper
Types of Operating Systems
Goals of an Operating System
Operations of an Operating System
Resource Allocation & Functions in an Operating System
Classes of Operating System
Batch Processing in Operating System
Multiprocessing in Operating System
Time-Sharing in Operating System