SlideShare una empresa de Scribd logo
1 de 12
Segmentation

CS 537 – Introduction to Operating Systems
Segmentation
• Segmentation is a technique for breaking memory
  up into logical pieces
• Each “piece” is a grouping of related information
   –   data segments for each process
   –   code segments for each process
   –   data segments for the OS
   –   etc.
• Like paging, use virtual addresses and use disk to
  make memory look bigger than it really is
• Segmentation can be implemented with or without
  paging
Segmentation

      P1 data                              P2 code

                     print
                     function
                                     P2 data
   P1 code



OS Code             OS data               OS stack


             logical address space
Addressing Segments
• Let’s first assume no paging in the system
• User generates logical addresses
• These addresses consist of a segment number and
  an offset into the segment
• Use segment number to index into a table
• Table contains the physical address of the start of
  the segment
   – often called the base address
• Add the offset to the base and generate the
  physical address
   – before doing this, check the offset against a limit
   – the limit is the size of the segment
Addressing Segments

                                     limit         base
    S             o

logical address


                                          segment table




                                    yes                   Physical Address
                        o < limit                    +

                        no

                         error
Segmentation Hardware
• Sounds very similar to paging
• Big difference – segments can be variable in size
• As with paging, to be effective hardware must be
  used to translate logical address
• Most systems provide segment registers
• If a reference isn’t found in one of the segment
  registers
   – trap to operating system
   – OS does lookup in segment table and loads new
     segment descriptor into the register
   – return control to the user and resume
• Again, similar to paging
Protection and Sharing
• Like page tables, each process usually gets
  its own segment table
• Unlike page tables, there usually exists a
  global segment table for everyone
  – this, however, is usually used by OS
• Access rights for segment are usually
  included in table entry
• Multiple processes can share a segment
Protection and Sharing

 limit base                   200
0 1000 200                   1200
1 3500 9000
                             2000
    LDT        limit base
                             2300
              0 500   2500   2500
              1 9000 20000   3000

                  GDT        9000
 limit base
0 1000 200
1 300 2000
                             12500
    LDT
Segmentation Issues
• Entire segment is either in memory or on
  disk
• Variable sized segments leads to external
  fragmentation in memory
• Must find a space big enough to place
  segment into
• May need to swap out some segments to
  bring a new segment in
Segmentation with Paging
• Most architectures support segmentation and
  paging
• Basic idea,
   – segments exist in virtual address space
   – base address in segment descriptor table is a virtual
     address
   – use paging mechanism to translate this virtual address
     into a physical address
• Now an entire segment does not have to be in
  memory at one time
   – only the part of the segment that we need will be in
     memory
Linear Address
• The base address gotten from the segment
  descriptor table is concatenated with the
  offset
• This new address is often referred to as a
  linear address
• This is the address that is translated by the
  paging hardware
virtual address from user
      descriptor              offset




             limit   base                     +




             segment table

                 linear address   directory        page        offset
                                                                        page frame
                 PT directory                     page table




directory base

Más contenido relacionado

La actualidad más candente

Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating SystemRaj Mohan
 
Csc4320 chapter 8 2
Csc4320 chapter 8 2Csc4320 chapter 8 2
Csc4320 chapter 8 2bshikhar13
 
Mca ii os u-4 memory management
Mca  ii  os u-4 memory managementMca  ii  os u-4 memory management
Mca ii os u-4 memory managementRai University
 
Computer memory management
Computer memory managementComputer memory management
Computer memory managementKumar
 
Paging,Segmentation & Segment with Paging
Paging,Segmentation & Segment with PagingPaging,Segmentation & Segment with Paging
Paging,Segmentation & Segment with PagingMeghaj Mallick
 
Introduction of Memory Management
Introduction of Memory Management Introduction of Memory Management
Introduction of Memory Management Maitree Patel
 
Memory management
Memory managementMemory management
Memory managementcpjcollege
 
Combined paging and segmentation
Combined paging and segmentationCombined paging and segmentation
Combined paging and segmentationTech_MX
 
34 single partition allocation
34 single partition allocation34 single partition allocation
34 single partition allocationmyrajendra
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentationhamza haseeb
 
Operation System
Operation SystemOperation System
Operation SystemANANTHI1997
 
Memory management
Memory managementMemory management
Memory managementImran Khan
 

La actualidad más candente (20)

Memory+management
Memory+managementMemory+management
Memory+management
 
Memory management
Memory managementMemory management
Memory management
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating System
 
Csc4320 chapter 8 2
Csc4320 chapter 8 2Csc4320 chapter 8 2
Csc4320 chapter 8 2
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Mca ii os u-4 memory management
Mca  ii  os u-4 memory managementMca  ii  os u-4 memory management
Mca ii os u-4 memory management
 
Memory management
Memory managementMemory management
Memory management
 
Computer memory management
Computer memory managementComputer memory management
Computer memory management
 
Paging,Segmentation & Segment with Paging
Paging,Segmentation & Segment with PagingPaging,Segmentation & Segment with Paging
Paging,Segmentation & Segment with Paging
 
Introduction of Memory Management
Introduction of Memory Management Introduction of Memory Management
Introduction of Memory Management
 
Memory management
Memory managementMemory management
Memory management
 
Combined paging and segmentation
Combined paging and segmentationCombined paging and segmentation
Combined paging and segmentation
 
34 single partition allocation
34 single partition allocation34 single partition allocation
34 single partition allocation
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentation
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Memory management
Memory managementMemory management
Memory management
 
OS_Ch9
OS_Ch9OS_Ch9
OS_Ch9
 
Operation System
Operation SystemOperation System
Operation System
 
Memory management
Memory managementMemory management
Memory management
 
Memory management
Memory managementMemory management
Memory management
 

Similar a Segmentation geekssay.com

Similar a Segmentation geekssay.com (20)

Segmentation
SegmentationSegmentation
Segmentation
 
PAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docxPAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docx
 
Os4
Os4Os4
Os4
 
Os4
Os4Os4
Os4
 
os presentation.ppt
os presentation.pptos presentation.ppt
os presentation.ppt
 
Segmentation
SegmentationSegmentation
Segmentation
 
Memory Management Strategies - III.pdf
Memory Management Strategies - III.pdfMemory Management Strategies - III.pdf
Memory Management Strategies - III.pdf
 
10 instruction sets characteristics
10 instruction sets characteristics10 instruction sets characteristics
10 instruction sets characteristics
 
Lecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxLecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptx
 
Ch8 main memory
Ch8   main memoryCh8   main memory
Ch8 main memory
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
 
Anshika 1111.pptx
Anshika 1111.pptxAnshika 1111.pptx
Anshika 1111.pptx
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
 
Main Memory
Main MemoryMain Memory
Main Memory
 
Memory Management.pdf
Memory Management.pdfMemory Management.pdf
Memory Management.pdf
 
Deep Dive into DynamoDB
Deep Dive into DynamoDBDeep Dive into DynamoDB
Deep Dive into DynamoDB
 
10 instruction sets characteristics
10 instruction sets characteristics10 instruction sets characteristics
10 instruction sets characteristics
 
Unit-4 swapping.pptx
Unit-4 swapping.pptxUnit-4 swapping.pptx
Unit-4 swapping.pptx
 
Segmentation in operating systems
Segmentation in operating systemsSegmentation in operating systems
Segmentation in operating systems
 

Más de Hemant Gautam

Make a fool geekssay.com sharing
Make a fool geekssay.com sharingMake a fool geekssay.com sharing
Make a fool geekssay.com sharingHemant Gautam
 
1 men die-younger geekssay.com sharing
1 men die-younger geekssay.com sharing1 men die-younger geekssay.com sharing
1 men die-younger geekssay.com sharingHemant Gautam
 
Shopping cart project geekssay.com
Shopping cart project geekssay.comShopping cart project geekssay.com
Shopping cart project geekssay.comHemant Gautam
 
Atm traffic management geekssay.com
Atm traffic management  geekssay.comAtm traffic management  geekssay.com
Atm traffic management geekssay.comHemant Gautam
 
Disk scheduling geekssay.com
Disk scheduling geekssay.comDisk scheduling geekssay.com
Disk scheduling geekssay.comHemant Gautam
 
Kruskals prims shared by: geekssay.com
Kruskals prims shared by: geekssay.comKruskals prims shared by: geekssay.com
Kruskals prims shared by: geekssay.comHemant Gautam
 
Knapsack Algorithm www.geekssay.com
Knapsack Algorithm www.geekssay.comKnapsack Algorithm www.geekssay.com
Knapsack Algorithm www.geekssay.comHemant Gautam
 
College Monitoring system BY: Geekssay.com
College Monitoring system BY: Geekssay.comCollege Monitoring system BY: Geekssay.com
College Monitoring system BY: Geekssay.comHemant Gautam
 

Más de Hemant Gautam (8)

Make a fool geekssay.com sharing
Make a fool geekssay.com sharingMake a fool geekssay.com sharing
Make a fool geekssay.com sharing
 
1 men die-younger geekssay.com sharing
1 men die-younger geekssay.com sharing1 men die-younger geekssay.com sharing
1 men die-younger geekssay.com sharing
 
Shopping cart project geekssay.com
Shopping cart project geekssay.comShopping cart project geekssay.com
Shopping cart project geekssay.com
 
Atm traffic management geekssay.com
Atm traffic management  geekssay.comAtm traffic management  geekssay.com
Atm traffic management geekssay.com
 
Disk scheduling geekssay.com
Disk scheduling geekssay.comDisk scheduling geekssay.com
Disk scheduling geekssay.com
 
Kruskals prims shared by: geekssay.com
Kruskals prims shared by: geekssay.comKruskals prims shared by: geekssay.com
Kruskals prims shared by: geekssay.com
 
Knapsack Algorithm www.geekssay.com
Knapsack Algorithm www.geekssay.comKnapsack Algorithm www.geekssay.com
Knapsack Algorithm www.geekssay.com
 
College Monitoring system BY: Geekssay.com
College Monitoring system BY: Geekssay.comCollege Monitoring system BY: Geekssay.com
College Monitoring system BY: Geekssay.com
 

Último

Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsManeerUddin
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 

Último (20)

Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture hons
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 

Segmentation geekssay.com

  • 1. Segmentation CS 537 – Introduction to Operating Systems
  • 2. Segmentation • Segmentation is a technique for breaking memory up into logical pieces • Each “piece” is a grouping of related information – data segments for each process – code segments for each process – data segments for the OS – etc. • Like paging, use virtual addresses and use disk to make memory look bigger than it really is • Segmentation can be implemented with or without paging
  • 3. Segmentation P1 data P2 code print function P2 data P1 code OS Code OS data OS stack logical address space
  • 4. Addressing Segments • Let’s first assume no paging in the system • User generates logical addresses • These addresses consist of a segment number and an offset into the segment • Use segment number to index into a table • Table contains the physical address of the start of the segment – often called the base address • Add the offset to the base and generate the physical address – before doing this, check the offset against a limit – the limit is the size of the segment
  • 5. Addressing Segments limit base S o logical address segment table yes Physical Address o < limit + no error
  • 6. Segmentation Hardware • Sounds very similar to paging • Big difference – segments can be variable in size • As with paging, to be effective hardware must be used to translate logical address • Most systems provide segment registers • If a reference isn’t found in one of the segment registers – trap to operating system – OS does lookup in segment table and loads new segment descriptor into the register – return control to the user and resume • Again, similar to paging
  • 7. Protection and Sharing • Like page tables, each process usually gets its own segment table • Unlike page tables, there usually exists a global segment table for everyone – this, however, is usually used by OS • Access rights for segment are usually included in table entry • Multiple processes can share a segment
  • 8. Protection and Sharing limit base 200 0 1000 200 1200 1 3500 9000 2000 LDT limit base 2300 0 500 2500 2500 1 9000 20000 3000 GDT 9000 limit base 0 1000 200 1 300 2000 12500 LDT
  • 9. Segmentation Issues • Entire segment is either in memory or on disk • Variable sized segments leads to external fragmentation in memory • Must find a space big enough to place segment into • May need to swap out some segments to bring a new segment in
  • 10. Segmentation with Paging • Most architectures support segmentation and paging • Basic idea, – segments exist in virtual address space – base address in segment descriptor table is a virtual address – use paging mechanism to translate this virtual address into a physical address • Now an entire segment does not have to be in memory at one time – only the part of the segment that we need will be in memory
  • 11. Linear Address • The base address gotten from the segment descriptor table is concatenated with the offset • This new address is often referred to as a linear address • This is the address that is translated by the paging hardware
  • 12. virtual address from user descriptor offset limit base + segment table linear address directory page offset page frame PT directory page table directory base