SlideShare a Scribd company logo
Storage Management

  •   Segmentation




                     1
HOME     PREVIOUS TOPIC NEXT
PREVIOUS QUESTION PAPERS FOR OS
CPP TUTORIALS




                                  2
Recap

In the last class, you have learnt:

• Fragmentation

• Paging concepts




                                      3
Objective

  On completion of this class, you will be able to

  know
• Segmentation




                                                     4
Segmentation
• Memory-management scheme that supports user
  view of memory
• A program is a collection of segments
• A segment is a logical unit such as:
     main program,
     procedure,
     function,
     method,
     object,
     local variables, global variables,
     common block,
     stack,
     symbol table, arrays, etc..            5
User’s View of a Program


    Subroutine      Stack


                     Symbol
                      table
     Sqrt


                  Main
                 Program



     Logical address space


                              6
Logical View of Segmentation

                            1

                            4
      1

              2


  3                         2
              4

                            3




 user space       physical memory space
                                          7
Segmentation
• Each segment has a name and length
• Address specify both the segment name and
  offset
• Instead of using name the segments are
  numbered
• The logical address consists of a tuple:

  – <segment-number,offset>

                                              8
Segmentation Architecture

• Segment table – maps two-dimensional physical
  addresses; each table entry has:

   • base – contains the starting physical address where
     the segments reside in memory

   • limit – specifies the length of the segment

• Use of segment table is illustrated in the next
  slide
                                                           9
Segmentation Hardware (contd..)




                                  10
Segmentation Hardware
• Logical address generated by CPU consists of two
  parts
  – Segment no. ‘s’:-used as a index into segment table

  – Offset ‘d’:- must be between ‘0’ and segment limit

  – A trap is generated if offset exceeds the segment limit

  – Correct offset + segment base = address in physical
    memory

• Segment table is an array of base-limit register pair
                                                              11
Paging Hardware
HARDWARE -- Must map a tuple (segment / offset) into
one-dimensional address
                       Segment Table

                          Limit     Base


             S   D
 CPU
       Logical
       Address                Yes
                     <                     +
                                           Physical   MEMORY
                         No                Address




                                                               12
Example of Segmentation

• Five segments numbered from 0 through 4.
• The segments are stored in physical memory as
  shown in fig.1
• Segment table gives the details of limit and base
  of each segment
  – Ex. Segment 2 is 400 bytes long and begins at
    location 4300
  – A reference to 53 of segment 2 is mapped onto
    location 4300+53=4353
                                                    13
Example of Segmentation
                                               Physical Memory



 Subroutine                                 1400
                  Stack     Segment table          segment 0
                                            2400
               segment 3     limit   base
                                            3200
                             1000    1400
segment 0         Symbol
                   table      400    6300          segment 3
                              400    4300   4300
  Sqrt          segment 4                          segment 2
                             1100    3200
                                            4700
                             1000    4700
                Main                               segment 4
               Program                      5700
segment 1
                                            6300
              segment 2                            segment 1
                                            6700
                             Ex: Segment 2
  Logical address space      = 4300+53=4353
                                                           14
            Figure :1
Segmentation, Paging - Comparison

• Segments are variable-size; Pages are fixed-size

• Segmentation requires more complicated
  hardware for address translation than paging

• Segmentation suffers from external fragmentation

• Paging only yields a small internal fragmentation




                                                  15
Summary

 In this class you have learnt

• Segmentation
  – Pages
  – frames




                                 16
Frequently Asked Questions

• What is segmentation?


• Explain the segmentation hardware with a neat

  diagram




                                                  17
Quiz
1. Memory-management scheme that supports
 user view of memory
 a) Segmentation
 b) Paging scheme
 C) None

2. The logical address consists of a
   a) Page offset
  b) Hole
  c) Tuple
  d) None


                                            18
Other subject materials

•   Web designing
•   Micro processors
•   C++ tutorials
•   java

home
Quiz
3. ____________used as a index into segment
   table
a) Page number

b) Segment no. ‘s’

c) Compaction

d) None




                                              20
Quiz

4. _________must be between 0 and segment
  limit
a) External fragmentation
b) Offset ‘d’
c) Compaction
d) None




                                            21

More Related Content

What's hot

Advanced processor Principles
Advanced processor PrinciplesAdvanced processor Principles
Advanced processor Principles
Vinit Raut
 
Memory management
Memory managementMemory management
Memory management
Vishal Singh
 
Swapping | Computer Science
Swapping | Computer ScienceSwapping | Computer Science
Swapping | Computer Science
Transweb Global Inc
 
12 process control blocks
12 process control blocks12 process control blocks
12 process control blocks
myrajendra
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
Kamal Acharya
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
priyadeosarkar91
 
Terminologies Used In Big data Environments,G.Sumithra,II-M.sc(computer scien...
Terminologies Used In Big data Environments,G.Sumithra,II-M.sc(computer scien...Terminologies Used In Big data Environments,G.Sumithra,II-M.sc(computer scien...
Terminologies Used In Big data Environments,G.Sumithra,II-M.sc(computer scien...
sumithragunasekaran
 
Multiprocessor Systems
Multiprocessor SystemsMultiprocessor Systems
Multiprocessor Systems
vampugani
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating system
tittuajay
 
Memory management
Memory managementMemory management
Memory management
Mohammad Sadiq
 
Multiprocessor architecture
Multiprocessor architectureMultiprocessor architecture
Multiprocessor architecture
Arpan Baishya
 
Operating System Overview
Operating System OverviewOperating System Overview
Operating System Overview
Anas Ebrahim
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
RITULDE
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
Wayne Jones Jnr
 
Memory management
Memory managementMemory management
Memory management
cpjcollege
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
rprajat007
 
Unit 3
Unit 3Unit 3
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecture
venkateswarlu G
 
operating system structure
operating system structureoperating system structure
operating system structure
Waseem Ud Din Farooqui
 
Chapter 3 - Processes
Chapter 3 - ProcessesChapter 3 - Processes
Chapter 3 - Processes
Wayne Jones Jnr
 

What's hot (20)

Advanced processor Principles
Advanced processor PrinciplesAdvanced processor Principles
Advanced processor Principles
 
Memory management
Memory managementMemory management
Memory management
 
Swapping | Computer Science
Swapping | Computer ScienceSwapping | Computer Science
Swapping | Computer Science
 
12 process control blocks
12 process control blocks12 process control blocks
12 process control blocks
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
 
Terminologies Used In Big data Environments,G.Sumithra,II-M.sc(computer scien...
Terminologies Used In Big data Environments,G.Sumithra,II-M.sc(computer scien...Terminologies Used In Big data Environments,G.Sumithra,II-M.sc(computer scien...
Terminologies Used In Big data Environments,G.Sumithra,II-M.sc(computer scien...
 
Multiprocessor Systems
Multiprocessor SystemsMultiprocessor Systems
Multiprocessor Systems
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating system
 
Memory management
Memory managementMemory management
Memory management
 
Multiprocessor architecture
Multiprocessor architectureMultiprocessor architecture
Multiprocessor architecture
 
Operating System Overview
Operating System OverviewOperating System Overview
Operating System Overview
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
 
Memory management
Memory managementMemory management
Memory management
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Unit 3
Unit 3Unit 3
Unit 3
 
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecture
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Chapter 3 - Processes
Chapter 3 - ProcessesChapter 3 - Processes
Chapter 3 - Processes
 

Viewers also liked

Segmentation in Operating Systems.
Segmentation in Operating Systems.Segmentation in Operating Systems.
Segmentation in Operating Systems.
Muhammad SiRaj Munir
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating System
Raj Mohan
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
Piyush Rochwani
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
sgpraju
 
Thrashing allocation frames.43
Thrashing allocation frames.43Thrashing allocation frames.43
Thrashing allocation frames.43
myrajendra
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
Wayne Jones Jnr
 
File system
File systemFile system
File system
Harleen Johal
 
38 paged segmentation
38 paged segmentation38 paged segmentation
38 paged segmentation
myrajendra
 
File management53(1)
File management53(1)File management53(1)
File management53(1)
myrajendra
 
35. multiplepartitionallocation
35. multiplepartitionallocation35. multiplepartitionallocation
35. multiplepartitionallocation
myrajendra
 
36 fragmentaio nnd pageconcepts
36 fragmentaio nnd pageconcepts36 fragmentaio nnd pageconcepts
36 fragmentaio nnd pageconcepts
myrajendra
 
40 demand paging
40 demand paging40 demand paging
40 demand paging
myrajendra
 
39 virtual memory
39 virtual memory39 virtual memory
39 virtual memory
myrajendra
 
Paging
PagingPaging
Paging
guest53a712
 
Combined paging and segmentation
Combined paging and segmentationCombined paging and segmentation
Combined paging and segmentation
Tech_MX
 
File management
File managementFile management
File management
Mohd Arif
 
File system.
File system.File system.
File system.
elyza12
 
File management
File managementFile management
File management
Vishal Singh
 
Memory management
Memory managementMemory management
Memory management
Rajni Sirohi
 
Memory management
Memory managementMemory management

Viewers also liked (20)

Segmentation in Operating Systems.
Segmentation in Operating Systems.Segmentation in Operating Systems.
Segmentation in Operating Systems.
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating System
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 
Thrashing allocation frames.43
Thrashing allocation frames.43Thrashing allocation frames.43
Thrashing allocation frames.43
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 
File system
File systemFile system
File system
 
38 paged segmentation
38 paged segmentation38 paged segmentation
38 paged segmentation
 
File management53(1)
File management53(1)File management53(1)
File management53(1)
 
35. multiplepartitionallocation
35. multiplepartitionallocation35. multiplepartitionallocation
35. multiplepartitionallocation
 
36 fragmentaio nnd pageconcepts
36 fragmentaio nnd pageconcepts36 fragmentaio nnd pageconcepts
36 fragmentaio nnd pageconcepts
 
40 demand paging
40 demand paging40 demand paging
40 demand paging
 
39 virtual memory
39 virtual memory39 virtual memory
39 virtual memory
 
Paging
PagingPaging
Paging
 
Combined paging and segmentation
Combined paging and segmentationCombined paging and segmentation
Combined paging and segmentation
 
File management
File managementFile management
File management
 
File system.
File system.File system.
File system.
 
File management
File managementFile management
File management
 
Memory management
Memory managementMemory management
Memory management
 
Memory management
Memory managementMemory management
Memory management
 

Similar to 37 segmentation

Segmentation in operating systems
Segmentation in operating systemsSegmentation in operating systems
Segmentation in operating systems
Dr. Jasmine Beulah Gnanadurai
 
Segmentation geekssay.com
Segmentation  geekssay.comSegmentation  geekssay.com
Segmentation geekssay.com
Hemant Gautam
 
Memory Management Strategies - III.pdf
Memory Management Strategies - III.pdfMemory Management Strategies - III.pdf
Memory Management Strategies - III.pdf
Harika Pudugosula
 
34 single partition allocation
34 single partition allocation34 single partition allocation
34 single partition allocation
myrajendra
 
Segmentation
SegmentationSegmentation
Segmentation
Pradyumna Doddala
 
Os presentation
Os presentationOs presentation
Os presentation
zeeshanyousaf117750
 
Things you should know about Oracle truncate
Things you should know about Oracle truncateThings you should know about Oracle truncate
Things you should know about Oracle truncate
Kazuhiro Takahashi
 
Os4
Os4Os4
Os4
Os4Os4
Control dataset partitioning and cache to optimize performances in Spark
Control dataset partitioning and cache to optimize performances in SparkControl dataset partitioning and cache to optimize performances in Spark
Control dataset partitioning and cache to optimize performances in Spark
ChristophePraud2
 
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
Hsien-Hsin Sean Lee, Ph.D.
 
Segmentation
SegmentationSegmentation
Segmentation
Md. Tanvir Hossain
 
ppt on Segmentation in operationg system
ppt on Segmentation in operationg systemppt on Segmentation in operationg system
ppt on Segmentation in operationg system
suraj sharma
 
Operating system 34 contiguous allocation
Operating system 34 contiguous allocationOperating system 34 contiguous allocation
Operating system 34 contiguous allocation
Vaibhav Khanna
 
Caching in
Caching inCaching in
Caching in
RichardWarburton
 
os presentation.ppt
os presentation.pptos presentation.ppt
os presentation.ppt
MuhammadMudassar85
 
Paging & segmentation; advantages and disadvantage
Paging & segmentation; advantages and disadvantagePaging & segmentation; advantages and disadvantage
Paging & segmentation; advantages and disadvantage
sohinibanerjee121
 
Apache Spark At Scale in the Cloud
Apache Spark At Scale in the CloudApache Spark At Scale in the Cloud
Apache Spark At Scale in the Cloud
Rose Toomey
 
Apache Spark At Scale in the Cloud
Apache Spark At Scale in the CloudApache Spark At Scale in the Cloud
Apache Spark At Scale in the Cloud
Databricks
 
Memory Management
Memory ManagementMemory Management
Memory Management
DEDE IRYAWAN
 

Similar to 37 segmentation (20)

Segmentation in operating systems
Segmentation in operating systemsSegmentation in operating systems
Segmentation in operating systems
 
Segmentation geekssay.com
Segmentation  geekssay.comSegmentation  geekssay.com
Segmentation geekssay.com
 
Memory Management Strategies - III.pdf
Memory Management Strategies - III.pdfMemory Management Strategies - III.pdf
Memory Management Strategies - III.pdf
 
34 single partition allocation
34 single partition allocation34 single partition allocation
34 single partition allocation
 
Segmentation
SegmentationSegmentation
Segmentation
 
Os presentation
Os presentationOs presentation
Os presentation
 
Things you should know about Oracle truncate
Things you should know about Oracle truncateThings you should know about Oracle truncate
Things you should know about Oracle truncate
 
Os4
Os4Os4
Os4
 
Os4
Os4Os4
Os4
 
Control dataset partitioning and cache to optimize performances in Spark
Control dataset partitioning and cache to optimize performances in SparkControl dataset partitioning and cache to optimize performances in Spark
Control dataset partitioning and cache to optimize performances in Spark
 
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
 
Segmentation
SegmentationSegmentation
Segmentation
 
ppt on Segmentation in operationg system
ppt on Segmentation in operationg systemppt on Segmentation in operationg system
ppt on Segmentation in operationg system
 
Operating system 34 contiguous allocation
Operating system 34 contiguous allocationOperating system 34 contiguous allocation
Operating system 34 contiguous allocation
 
Caching in
Caching inCaching in
Caching in
 
os presentation.ppt
os presentation.pptos presentation.ppt
os presentation.ppt
 
Paging & segmentation; advantages and disadvantage
Paging & segmentation; advantages and disadvantagePaging & segmentation; advantages and disadvantage
Paging & segmentation; advantages and disadvantage
 
Apache Spark At Scale in the Cloud
Apache Spark At Scale in the CloudApache Spark At Scale in the Cloud
Apache Spark At Scale in the Cloud
 
Apache Spark At Scale in the Cloud
Apache Spark At Scale in the CloudApache Spark At Scale in the Cloud
Apache Spark At Scale in the Cloud
 
Memory Management
Memory ManagementMemory Management
Memory Management
 

More from myrajendra

Fundamentals
FundamentalsFundamentals
Fundamentals
myrajendra
 
Data type
Data typeData type
Data type
myrajendra
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
myrajendra
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
myrajendra
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
myrajendra
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
myrajendra
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
myrajendra
 
Dao example
Dao exampleDao example
Dao example
myrajendra
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
myrajendra
 
Internal
InternalInternal
Internal
myrajendra
 
3. elements
3. elements3. elements
3. elements
myrajendra
 
2. attributes
2. attributes2. attributes
2. attributes
myrajendra
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
myrajendra
 
Headings
HeadingsHeadings
Headings
myrajendra
 
Forms
FormsForms
Forms
myrajendra
 
Css
CssCss
Views
ViewsViews
Views
myrajendra
 
Views
ViewsViews
Views
myrajendra
 
Views
ViewsViews
Views
myrajendra
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
myrajendra
 

More from myrajendra (20)

Fundamentals
FundamentalsFundamentals
Fundamentals
 
Data type
Data typeData type
Data type
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Dao example
Dao exampleDao example
Dao example
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Internal
InternalInternal
Internal
 
3. elements
3. elements3. elements
3. elements
 
2. attributes
2. attributes2. attributes
2. attributes
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Headings
HeadingsHeadings
Headings
 
Forms
FormsForms
Forms
 
Css
CssCss
Css
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 

37 segmentation

  • 1. Storage Management • Segmentation 1
  • 2. HOME PREVIOUS TOPIC NEXT PREVIOUS QUESTION PAPERS FOR OS CPP TUTORIALS 2
  • 3. Recap In the last class, you have learnt: • Fragmentation • Paging concepts 3
  • 4. Objective On completion of this class, you will be able to know • Segmentation 4
  • 5. Segmentation • Memory-management scheme that supports user view of memory • A program is a collection of segments • A segment is a logical unit such as: main program, procedure, function, method, object, local variables, global variables, common block, stack, symbol table, arrays, etc.. 5
  • 6. User’s View of a Program Subroutine Stack Symbol table Sqrt Main Program Logical address space 6
  • 7. Logical View of Segmentation 1 4 1 2 3 2 4 3 user space physical memory space 7
  • 8. Segmentation • Each segment has a name and length • Address specify both the segment name and offset • Instead of using name the segments are numbered • The logical address consists of a tuple: – <segment-number,offset> 8
  • 9. Segmentation Architecture • Segment table – maps two-dimensional physical addresses; each table entry has: • base – contains the starting physical address where the segments reside in memory • limit – specifies the length of the segment • Use of segment table is illustrated in the next slide 9
  • 11. Segmentation Hardware • Logical address generated by CPU consists of two parts – Segment no. ‘s’:-used as a index into segment table – Offset ‘d’:- must be between ‘0’ and segment limit – A trap is generated if offset exceeds the segment limit – Correct offset + segment base = address in physical memory • Segment table is an array of base-limit register pair 11
  • 12. Paging Hardware HARDWARE -- Must map a tuple (segment / offset) into one-dimensional address Segment Table Limit Base S D CPU Logical Address Yes < + Physical MEMORY No Address 12
  • 13. Example of Segmentation • Five segments numbered from 0 through 4. • The segments are stored in physical memory as shown in fig.1 • Segment table gives the details of limit and base of each segment – Ex. Segment 2 is 400 bytes long and begins at location 4300 – A reference to 53 of segment 2 is mapped onto location 4300+53=4353 13
  • 14. Example of Segmentation Physical Memory Subroutine 1400 Stack Segment table segment 0 2400 segment 3 limit base 3200 1000 1400 segment 0 Symbol table 400 6300 segment 3 400 4300 4300 Sqrt segment 4 segment 2 1100 3200 4700 1000 4700 Main segment 4 Program 5700 segment 1 6300 segment 2 segment 1 6700 Ex: Segment 2 Logical address space = 4300+53=4353 14 Figure :1
  • 15. Segmentation, Paging - Comparison • Segments are variable-size; Pages are fixed-size • Segmentation requires more complicated hardware for address translation than paging • Segmentation suffers from external fragmentation • Paging only yields a small internal fragmentation 15
  • 16. Summary In this class you have learnt • Segmentation – Pages – frames 16
  • 17. Frequently Asked Questions • What is segmentation? • Explain the segmentation hardware with a neat diagram 17
  • 18. Quiz 1. Memory-management scheme that supports user view of memory a) Segmentation b) Paging scheme C) None 2. The logical address consists of a a) Page offset b) Hole c) Tuple d) None 18
  • 19. Other subject materials • Web designing • Micro processors • C++ tutorials • java home
  • 20. Quiz 3. ____________used as a index into segment table a) Page number b) Segment no. ‘s’ c) Compaction d) None 20
  • 21. Quiz 4. _________must be between 0 and segment limit a) External fragmentation b) Offset ‘d’ c) Compaction d) None 21