PagingAnd Segmentation
 Involve swapping block of data from secondmemory Memory needs to be allocated to ensure a reasonablesupply of ready pr...
 Paging is a partition memory into small equal fixed-size chunks and divide each process into the samesize chunks Pages...
Process Pages tofree frames Some of the frames in memory are use and some are free. A list of frames is maintained by t...
… Process B consisting of three pages and Process C consisting of fourpages are subsequently loaded. Process B is suspe...
 The five pages of process D are loaded into frames5,6,11, and 12.
 A pages tables contain one entry for each pages of the process. The table easily indexed by the pages number (starting...
 manages the main memory by dividing the memory intoregions/fixed/variable size is called partitioning Two types of par...
Partitioning example :P1P2P4P3P3P1P4P3P2StaticPartitionDynamicPartition01032251504249342010516670 7028ProcessSpaceP1 10P2...
pAGINGCPUp d f dPhysicalmemoryfpLogicaladdressPhysicaladdressPage table Visual address of a process divided into1. page ...
PAGING EXample0 0 1 0 1 11001110000000101011111010110001100001011111010110001100100011011Offsetpage framePhysicalmemoryLo...
Paging hardware Address space 2m Page offset 2n Page number 2m-np dPagenumberPageoffsetm-n nNote :Not losing anyspace ...
SegmentationStep : Address translation from virtual to physicaladdress1. Extract the segment number as the n bits of thel...
SegmentationCPU s d< +limit basesPhysical memorySegmenttableyesTrap, addressing errorPhysicaladdressnoLogicaladdressmains...
Paginglogical addresspage number = 1 [000001]offset = 478 [0111011110]Physical addressResiding frame = 6 [000110]offse...
Segmentationlogical addresspage number = 1 [0001]offset = 752 [001011110000]Physical addressResiding frame = 4 [0010000...
The End..pROjECT: oPERATing sYSTemFrom:FATIN NABILAH BT ABDUL RAMANCHONG LEE MANHAFIZOH BINTI MD ISASITI FATIHAH BT MOHD ...
Memory management
Memory management
Upcoming SlideShare
Loading in …5
×

Memory management

1,264 views

Published on

our project for OPERATING SYSTEM..

Published in: Education, Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,264
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
65
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Memory management

  1. 1. PagingAnd Segmentation
  2. 2.  Involve swapping block of data from secondmemory Memory needs to be allocated to ensure a reasonablesupply of ready processes to consume availableprocessor time Memory management requirements: Relocation Protection Sharing Logical organisation Physical organisationMemory management
  3. 3.  Paging is a partition memory into small equal fixed-size chunks and divide each process into the samesize chunks Pages-The chunks of a process Frame or pages frame-The chunks of a memory Page table: Contains the frame location for each page in theprocess Memory address consist of a page number and offsetwithin the pagePAGING
  4. 4. Process Pages tofree frames Some of the frames in memory are use and some are free. A list of frames is maintained by the OS. Process A stored on disk and it consist of four pages. OS will find the four free frames and loads thefour pages of process A into four frames.
  5. 5. … Process B consisting of three pages and Process C consisting of fourpages are subsequently loaded. Process B is suspended and swapped out to main memory. All the process in main memory will blocked OS need to bring a new process, which is process D that contain fivepages.
  6. 6.  The five pages of process D are loaded into frames5,6,11, and 12.
  7. 7.  A pages tables contain one entry for each pages of the process. The table easily indexed by the pages number (starting at 0) Each pages table entry contains the number of the frame inmain memory that hold the corresponding page. A free frame list, available for pages, is maintained Thus we will se the simple paging is similar to fixed partioning.
  8. 8.  manages the main memory by dividing the memory intoregions/fixed/variable size is called partitioning Two types of partitions1. Static PartitionWhole memory is divided into fixed sized frame2. Dynamic PartitionMemory is divided into variable sized frame according topage sizePartitioning
  9. 9. Partitioning example :P1P2P4P3P3P1P4P3P2StaticPartitionDynamicPartition01032251504249342010516670 7028ProcessSpaceP1 10P2 10P3 14P4 15Total space forthose of partition
  10. 10. pAGINGCPUp d f dPhysicalmemoryfpLogicaladdressPhysicaladdressPage table Visual address of a process divided into1. page number (p) – index to page table2. page offset (d) – offset into page/frame
  11. 11. PAGING EXample0 0 1 0 1 11001110000000101011111010110001100001011111010110001100100011011Offsetpage framePhysicalmemoryLogicalmemory Page size 4 bytes Memory size 32 bytes (8 pages)
  12. 12. Paging hardware Address space 2m Page offset 2n Page number 2m-np dPagenumberPageoffsetm-n nNote :Not losing anyspace !Step : address translation1. Extract the page number as the n nits of the logical address2. Use the page number as an index into process page table tofind the frame number, k3. The starting physical address of the frame is k * 2m , thephysical address of the referenced bytes is that number plusoffset.Physicalmemory2m bytes
  13. 13. SegmentationStep : Address translation from virtual to physicaladdress1. Extract the segment number as the n bits of thelogical address2. Use the segment number as an index into theprocess segment table to find the starting physicaladdress of the segment3. Compare the offset, expressed in the m bits, to thelength of the segment. If offset is “>=“ to thelength, the address is invalid.4. The desired physical address is the sum of thestarting physical address of the segment plusoffset.
  14. 14. SegmentationCPU s d< +limit basesPhysical memorySegmenttableyesTrap, addressing errorPhysicaladdressnoLogicaladdressmainstack
  15. 15. Paginglogical addresspage number = 1 [000001]offset = 478 [0111011110]Physical addressResiding frame = 6 [000110]offset = 478 [0111011110]Physical address= 0001100111011110
  16. 16. Segmentationlogical addresspage number = 1 [0001]offset = 752 [001011110000]Physical addressResiding frame = 4 [0010000000100000]offset = 752 [001011110000]Physical address= 0010000000100000 + 001011110000= 0010001100010000
  17. 17. The End..pROjECT: oPERATing sYSTemFrom:FATIN NABILAH BT ABDUL RAMANCHONG LEE MANHAFIZOH BINTI MD ISASITI FATIHAH BT MOHD SOHAIMILecturer :DR NURUL AZMA ZAKARIA

×