0% found this document useful (0 votes)
15 views

Osy Report

Uploaded by

Vikrant Kadam
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)
15 views

Osy Report

Uploaded by

Vikrant Kadam
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/ 11

Report on segmentation in OS

Chapter 1 – INTRODUCTION TO PROJECT

1.1 ABSTRACT

In Operating Systems, Segmentation is a memory management technique in


which the memory is divided into the variable size parts. Each part is known as
a segment which can be allocated to a process. The details about each
segment are stored in a table called a segment table. A process is divided into
Segments. The chunks that a program is divided into which are not
necessarily all of the same sizes are called segments. Segmentation gives the
user’s view of the process which paging does not give. Here the user’s view is
mapped to physical memory.

1.2 RATIONALE
An Operating System is basically a system program that controls the
execution of application programs and acts as an interface between
applications and the computer hardware. It manages the computer system
resources to be used in an efficient manner. This course enables to learn
internal functioning of operating system and will help in identifying
appropriate Operating System for given applications/task. This course is
also a prerequisite for the group of courses included in 'Cloud
Infrastructure Maintenance' Elective group.

1.3 COURSE OUTCOMES ADDRESSED


i. Calculate efficiency of different memory management techniques.

Computer Science & Engineering - 1- R. C. Patel College Of Engineering & Polytechnic


Report on segmentation in OS

Chapter 2 – LITERATURE REVIEW


Segmentation is one of the most common ways to achieve memory
protection. In a computer system using segmentation, an instruction operand
that refers to a memory location includes a value that identifies a segment and
an offset within that segment. A segment has a set of permissions, and a length,
associated with it. If the currently running process is allowed by the permissions
to make the type of reference to memory that it is attempting to make, and the
offset within the segment is within the range specified by the length of the
segment, the reference is permitted; otherwise, a hardware exception is raised.
In addition to the set of permissions and length, a segment also has associated
with it information indicating where the segment is located in memory. It may
also have a flag indicating whether the segment is present in main memory or
not; if the segment is not present in main memory, an exception is raised, and
the operating system will read the segment into memory from secondary
storage. The information indicating where the segment is located in memory
might be the address of the first location in the segment, or might be the
address of a page table for the segment, if the segmentation is implemented
with paging. In the first case, if a reference to a location within a segment is
made, the offset within the segment will be added to address of the first
location in the segment to give the address in memory of the referred-to item;
in the second case, the offset of the segment is translated to a memory address
using the page table.
In most systems in which a segment doesn't have a page table associated with it,
the address of the first location in the segment is an address in main memory; in
those systems,no paging is done. In the Intel 80386 & later, that address can
either be an address in main memory, if paging is not enabled, or an address in a
paged "linear" address space, if paging is enabled.

Computer Science & Engineering - 2- R. C. Patel College Of Engineering & Polytechnic


Report on segmentation in OS

Chapter 3 – PROJECT DETAILS

3.1 ACTUAL METHODOLOGY FOLLOWED

1. Segment Definition
 Segment Types: Define the types of segments in the system, such as:
o Code Segment: Contains executable code.
o Data Segment: Holds global variables and static data.
o Stack Segment: Used for function calls and local variables.
o Heap Segment: Used for dynamic memory allocation.

2. Segment Table
 Structure: Each process has a segment table that contains entries for each
segment. Each entry typically includes:
o Base Address: The starting physical address of the segment in
memory.
o Limit: The length of the segment, which helps in bounds checking.

 Example: A segment table for a process might look like this:


Segment Number Base Address Limit
0 (Code) 1000 500
1 (Data) 1500 300
2 (Stack) 2000 200
3 (Heap) 2200 400

3. Address Translation
When a program accesses a memory address, the logical address consists of a
segment number and an offset. The operating system performs address
translation as follows:
1. Input: Logical address is given in the form of (segment number, offset).
2. Validation: Check if the segment number is valid (i.e., within the range of
the segment table).
3. Bounds Checking: Ensure the offset is within the limit of the segment.
4. Physical Address Calculation:
o If valid, calculate the physical address using:
Physical Address=Base Address+Offset\text{Physical Address} = \
text{Base Address} + \
text{Offset}Physical Address=Base Address+Offset

Computer Science & Engineering - 3- R. C. Patel College Of Engineering & Polytechnic


Report on segmentation in OS

4. Memory Allocation and Management


 Allocation: When a segment is created, the OS allocates memory for it. If
there's enough contiguous space, it assigns a base address and sets the
limit.
 Deallocation: When a segment is no longer needed, the OS deallocates it,
which can lead to external fragmentation.

5. Fragmentation Management
 External Fragmentation: Over time, memory can become fragmented as
segments are allocated and deallocated. The OS needs to implement
strategies to manage this fragmentation, which may include:
o Compaction: Rearranging memory contents to create larger
contiguous blocks.
o Paging: Combining segmentation with paging to reduce external
fragmentation.

6. Segmentation Fault Handling


 Fault Handling: If a program attempts to access an invalid memory location
(either due to an invalid segment number or an offset exceeding the limit),
a segmentation fault occurs. The OS must handle this gracefully:
o Terminate the process.
o Optionally, provide an error message or dump the process state for
debugging.

7. Protection and Sharing


 Access Control: Each segment can have different access permissions (read,
write, execute), enhancing security.
 Sharing Segments: Multiple processes can share segments (e.g., common
libraries), improving memory utilization.

3.2 ACTUAL RESOURCES REQUIRED


Sr. Quan
Name of Resource/Material Specifications Remarks
No. tity

1.
Intel (Core i5)
Processor 11th Gen 01

2. Primary Memory 4 GB 01

3. Operating System Window 11 01

4 Computer system HP Pro 01

Computer Science & Engineering - 4- R. C. Patel College Of Engineering & Polytechnic


Report on segmentation in OS

Chapter 4 – MICRO-PROJECT OUTPUTS

4.1 OUTPUTS OF THE MICRO-PROJECT

A process is divided into Segments. The chunks that a program is divided


into which are not necessarily all of the same sizes are called segments.
Segmentation gives the user’s view of the process which paging does not
give. Here the user’s view is mapped to physical memory. There are types
of segmentation:
Virtual memory segmentation – Each process is divided into a number of
segments, not all of which are resident at any one point in time.
Simple segmentation – Each process is divided into a number of segments,

Computer Science & Engineering - 5- R. C. Patel College Of Engineering & Polytechnic


Report on segmentation in OS

all of which are loaded into memory at run time, though not necessarily
contiguously.
There is no simple relationship between logical addresses and physical
addresses in segmentation. A table stores the information about all such
segments and is called Segment Table. Segment Table – It maps two-
dimensional Logical address into one-dimensional Physical address. It’s each
table entry has:
1. Base Address: It contains the starting physical address where the
segments reside in memory.
2. Limit: It specifies the length of the segment.

4.2 SKILL DEVELOPED/LEARNING OUT OF THIS MICRO-PROJECT


 We learned about the segmentation in operating system

Computer Science & Engineering - 6- R. C. Patel College Of Engineering & Polytechnic


Report on segmentation in OS

Chapter 5
ADVANTAGES, DISADVANTAGES & APPLICATIONS

5.1 ADVANTAGES

− A No internal fragmentation.

− Average Segment Size is larger than the actual page size.

− Less overhead.

− It is easier to relocate segments than entire address space.

− The segment table is of lesser size as compared to the page table in paging.

5.2 DISADVANTAGES
− It can have external fragmentation.
− It is difficult to allocate contiguous memory to variable sized partition.
− Costly memory management algorithms.
− As processes are loaded and removed from the memory, the free memory
space is broken into little pieces, causing External fragmentation.
− Overhead is associated with keeping a segment table for each activity.

5.3 APPLICATIONS
− Segmentation allows users to partition the user programs into modules.

− It allows to processes to easily share data.

− It allows to extend the address ability of the processor, i.e. segmentation


allows the use of 16 bit registers to give an addressing capability.

Computer Science & Engineering - 7- R. C. Patel College Of Engineering & Polytechnic


Report on segmentation in OS

Chapter 6
CONCLUSIONS, FUTURE SCOPE & REFERENCES

6.1 CONCLUSION
Segmentation in OS is a memory management solution that helps you
minimize internal fragmentation. Still, memory management strategies are not
mutually exclusive. You can use multiple memory management techniques to
optimize your system's performance.

6.2 AREA OF FUTURE IMPROVEMENT


During the swapping of processes the free memory space is broken into small
pieces, which isa major problem in the segmentation technique. Time is required to
fetch instructions or segments. The swapping of segments of unequal sizes is not
easy.so the future improvement is to avoid this disadvantage.

6.3 REFERENCES
[1] https://www.javatpoint.com/os-segmentation

[2] https://www.geeksforgeeks.org/segmentation-in-operating-system/

[3] https://en.wikibooks.org/wiki/Operating_System_Design/Segmentation

[4] https://www.scaler.com/topics/operatingsystem/segmentation-in-os/

Computer Science & Engineering - 8- R. C. Patel College Of Engineering & Polytechnic


Report on segmentation in OS

WEEKLY WORK / PROGRESS REPORT

Details of 16 Engagement Hours of the Student


Regarding Completion of the Project
Timing Sign
Week
Date Duration Work/Activity Performed of
No. From To
in Hours Guide
20-08-24 10:00 11:00 1
1. Project-Selection
11:00 12:00 1 Problem Identification & Concept
2. 20-08-24
Discussion
3:00 4:00 1
3. 23-08-24 Project Planning & Scheduling
4:00 5:00 1
4. 23-08-24 Literature Survey- I
10:00 11:00 1
5. 27-08-24 Requirement Analysis
11:00 12:00 1
6. 27-08-24 Design-I:-UML Diagram
3:00 4:00 1
7. 30-08-24 Design-II:- UML Diagram
30-08-24 4:00 5:00 1
8. Preparation of Activity-Diagram
02-09-24 10:00 11:00 1 Extracting & Understanding Features
9.
I
02-09-24 11:00 12:00 1 Extracting & Understanding
10.
Characteristics II
06-09-24 3:00 4:00 1
11. Testing
06-09-24 4:00 5:00 1
12. Results
09-09-24 10:00 11:00 1
13. Documentation
09-09-24 11:00 12:00 1
14. Presentation Preparation

Name & Signature of Project Guide

Mrs.M.J.Gurjar

Computer Science & Engineering - 9- R. C. Patel College Of Engineering & Polytechnic


Report on segmentation in OS

Micro-Project Evaluation Sheet


Academic Year: 2024-2025 Semester: 5th

Program: computer Science & Engineering Course Code: 22516

Course and Code: Operating System (22516)

Title of the Micro-Project: Report on Segmentation in OS

Course Outcome Achieved:


A. Execute process commands for performing process management operations.
B. Apply scheduling algorithms to calculate turnaround time and average waiting time.

Major Learning Outcomes achieved by students by doing the project:


A. Practical Outcomes:
i. None

B. Unit Outcomes (in Cognitive domain):


i. Describe the working of specified memory management function.
ii. Explain characteristic of the given memory management techniques.

C. Outcomes in Affective Domain:


i. Calculate efficiency of different memory management techniques.

Comments / Suggestions about team work / leadership / inter-personal communication:


___________________________________________________________________________
Part A – Part B – Total
Process Assessment Product Assessment
Project Project Project Report Individual
Enrollment No. Student Name Propo- Methodology / Working Presentation
sal Model / Viva
(2M) (2M) (2M) (4M) (10M)
2218080114 Dhangar Rohit Ravindra
2218080113 Desale Divyesh Dhananjay
2218080135 Patil Durgesh Nilesh
2218080105 Bhavsar Mayur Vishnu
2218080127 Mali Gaurav Anil

Name & Signature of Project Guide

Mrs.M.J.Gurjar

Computer Science & Engineering - 10- R. C. Patel College Of Engineering & Polytechnic
Report on segmentation in OS

Micro-Project Feedback Sheet


Evaluation as per Suggested Rubric for Assessment of Micro Project
✔ (Please tick in appropriate cell for each characteristic)
S Characteristic Poor Average Good Excellent
N to be assessed ( Marks 1-3 ) ( Marks 4-5 ) ( Marks 6-8 ) ( Marks 9-10 )
Relate to Related to Take care of Take care of
Relevance to
1 very few LOs some LOs at-least one CO more than one CO
the Course
Not more than two At-least 5 relevant At –least 7 relevant About 10 relevant
Literature
sources, very old sources, at least 2 sources, most latest sources, most latest
2 Survey / Info. reference latest
Collection
Completion of Completed less Completed around Completed around Completed more
Target as per than 50% 50 to 60% 60 to 80% than 80 %
3
Project
Proposal
Sample Size small, Sufficient and Sufficient and Enough data collected
data neither appropriate sample, appropriate sample, by sufficient &
organized nor enough data enough data appropriate sample
Analysis of Data presented well generated but not generated which is size. Proper inferences
4 and organized & not organized and drawn by organizing
presented well. No or presented well but and presenting data
Representation
poor inferences drawn poor inferences drawn through tables, charts
and graphs

Incomplete Just assembled/ Well assembled/ Well assembled/


fabrication/assembly fabricated and parts are fabricated with proper fabricated with proper
Quality of not functioning well. Not functioning parts. In functioning parts. In
Prototype / in proper shape, proper shape, within proper shape, within
dimensions beyond tolerance dimensions and tolerance dimensions
5 Model / tolerance limit. good finish/ appearance. and good finish/
Software Appearance/finish is But no creativity in appearance. Creativity in
shabby design & use of material design & use of material

Very short, poor Nearly sufficient and Detailed, correct and Very detailed, correct,
quality sketches, correct details about clear description of clear description of
details about methods, material, methods, materials, methods, materials,
precautions and
Report methods, material, precautions and precautions and
6 precaution & conclu
conclusion, but clarity is
Conclusions. Sufficient conclusions. Enough
Preparation not there in present-
sions omitted, some ation. But not enough Graphic Description. tables, charts and
details are wrong graphic description sketches

Major information is Includes major Includes major Well organized,


not included, information but not information and well includes major
7 Presentation information is not well organized and not organized but not information ,well
well organized presented well presented well presented
Could not reply to Replied to Replied properly to Replied most of the
considerable number considerable number considerable number questions properly
9 Defense of question of questions but not of question
very properly

Name & Signature of Project Guide

Mrs.M.J.Gurjar

Computer Science & Engineering - 11- R. C. Patel College Of Engineering & Polytechnic

You might also like