Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Upcoming SlideShare
Virtual memory ppt
Next
Download to read offline and view in fullscreen.

69

Share

Download to read offline

Paging and Segmentation in Operating System

Download to read offline

Want to know how a 10GB game works on your 2GB RAM ? well, you know where to click ;)

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Paging and Segmentation in Operating System

  1. 1. - Raj Mohan. B
  2. 2. Stores all kind of data and information
  3. 3. 1. Physical Memory- Total memory of the computer. EX: RAM 2. Logical Memory- CPU memory 3. Virtual memory- An imaginary memory area supported by some operating systems (for example, Windows). It is an extension of logical memory
  4. 4.  If the size of the program is greater than the available memory size, then the concept of virtual memory is used  Ever wondered how a 10GB Game like God Of War fits into your 2GB RAM computer?
  5. 5.  Paging is a memory management technique in which the memory is divided into fixed size pages.  Paging is used for faster access to data.  It is a logical concept
  6. 6. STATEMENT 1 STATEMENT 2 STATEMENT 3 STATEMENT 4 STATEMENT 5 STATEMENT 6 STATEMENT 7 Suppose a program X consists of 7 statements. But the memory can hold only 4 statements, then Paging concept is used. PROGRAM X STATEMENT 1 STATEMENT 2 STATEMENT 3 STATEMENT 4 STATEMENT 5 STATEMENT 6 STATEMENT 7
  7. 7.  Frames are physical concept  It is present in the RAM  We cannot see Pages, but we can see Frames
  8. 8.  Converting pages(virtual address) into frames (physical address)  Enables program to be executed  It is performed by the Memory Management Unit (M.M.U.) CPU (WHERE PAGES ARE DIVIDED) MMU Memory 1 Memory 2Virtual address of each page Converts virtual address to physical  If any error error occurs at any physical address, it is quickly retrieved from memory and sent to the CPU
  9. 9. 0 0 0 0 0 1 0 1 1 1 0 1 1 1 0 6-bit page # 10-bit offset # 16-bit logical address 0 0 0 0 1 0 1 1 0 0 0 1 1 0 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 0 Page Table 16-bit Physical address
  10. 10.  LOGICAL ADDRESS PAGE NUMBER (WHICH PAGE IS TO BE SEARCHED IN THE MEMORY) PAGE OFFSET (WHICH BYTE OF DATA IS TO BE READ FROM THAT PAGE) MAXIMUM OF 6 BYTES MAXIMUM OF 10 BYTES  PHYSICAL ADDRESS FRAME NUMBER FRAME OFFSET MAXIMUM OF 6 BYTES MAXIMUM OF 10 BYTES
  11. 11. LOGICAL ADDRESS PAGE P0 P1 P2 P3 P4 P5 P6 P7 MAPPING PHYSICAL ADDRESS P7 P2 P1 P5 FO F1 F2 F3
  12. 12. page frame 0 page frame 1 page frame 2 page frame 3 physical memory offset physical address F3’s Value F3 F2 F0 page table(MMU) offset logical address P=3 CPU P0 P1 P2 P3 P4 P5 P6 P7 F1
  13. 13. The paging process is protected by the concept of insertion of an additional bit called VALID/INVALID BIT Consider a 14 bit address space= 2^14=16383 bytes Let us set an address limit of 10468 If five process are defined within this address space (P0-P4), it is considered as a Valid bit Process P5 has started before 10468, so that alone is considered The remaining processes are considered as Invalid In this way the pages are internally fragmented This is how Paging is protected
  14. 14. • No external Fragmentation • Simple memory management algorithm • Swapping is easy (Equal sized Pages and Page Frames) • Internal fragmentation • Page tables may consume more memory.
  15. 15.  Segmentation is one of the most common ways to achieve memory protection.  Because internal fragmentation of pages takes place, the user’s view of memory is lost  The user will view the memory as a combination of segments  In this type, memory addresses used are not contiguous  Each memory segment is associated with a specific length and a set of permissions.  When a process tries to access the memory it is first checked to see whether it has the required permission to access the particular memory segment and whether it is within the length specified by that particular memory segment.
  16. 16. 1 3 2 4 1 4 2 3 user space physical memory space Free Free
  17. 17.  Segment table - maps two-dimensional user defined address into one- dimensional physical address  base - starting physical address of the segment  limit - length of segment Logical Address space Segment number Offset The maximum length of the offset value is 12 bits
  18. 18. Logical Address 0<d<limit
  19. 19.  The advantage of segmentation is that the protection is associated within the segments  Sharing can be achieved by segments referencing multiple processes  Two processes that need to share access to a single segment would have the same segment name and address in their segment tables
  20. 20.  No internal fragmentation  Segment tables consume less memory than page  Lends itself to sharing data among processes.  Lends itself to protection. Costly memory management algorithm As processes are loaded and removed from memory , the free memory space is broken into little pieces ,causing external fragmentation
  21. 21. In a combined paging/segmentation system a user’s address space is broken up into a number of segments. Each segment is broken up into a number of fixed-sized pages which are equal in length to a main memory frame Segmentation is visible to the programmer Paging is transparent to the programmer
  • HemalDalal3

    Apr. 29, 2021
  • RajeshwariSalunke

    Apr. 26, 2021
  • poornavalliSrinivasa

    Jun. 7, 2020
  • HassamAli12

    Feb. 7, 2020
  • HarshathGowtham

    Nov. 1, 2019
  • VigneshVikky11

    Mar. 31, 2019
  • HarishWaran1

    Mar. 7, 2019
  • ChMadhumithaReddy

    Feb. 5, 2019
  • JongHyunYeo

    Dec. 14, 2018
  • EvaBernice

    Nov. 20, 2018
  • PritiJose

    Oct. 29, 2018
  • pratyubanoth

    Aug. 2, 2018
  • ILANGEERANPARAMANATH

    May. 30, 2018
  • charlieputh10

    May. 3, 2018
  • PavanChennur

    Apr. 22, 2018
  • RupeshSahu16

    Feb. 12, 2018
  • ImtiazAnwar7

    Dec. 19, 2017
  • ShivamRastogi32

    Dec. 18, 2017
  • SachchidanandTiwari2

    Nov. 5, 2017
  • FawohunreFolashade

    Oct. 25, 2017

Want to know how a 10GB game works on your 2GB RAM ? well, you know where to click ;)

Views

Total views

79,799

On Slideshare

0

From embeds

0

Number of embeds

34

Actions

Downloads

3,472

Shares

0

Comments

0

Likes

69

×