Operating system chapter 7
اسلاید 1: 1Memory ManagementChapter 7
اسلاید 2: 2Memory ManagementSubdividing memory to accommodate multiple processesMemory needs to be allocated to ensure a reasonable supply of ready processes to consume available processor time
اسلاید 3: 3Memory Management RequirementsRelocationProgrammer does not know where the program will be placed in memory when it is executedWhile the program is executing, it may be swapped to disk and returned to main memory at a different location (relocated)Memory references must be translated in the code to actual physical memory address
اسلاید 4: 4
اسلاید 5: 5Memory Management RequirementsProtectionProcesses should not be able to reference memory locations in another process without permissionImpossible to check absolute addresses at compile timeMust be checked at rum timeMemory protection requirement must be satisfied by the processor (hardware) rather than the operating system (software)Operating system cannot anticipate all of the memory references a program will make
اسلاید 6: 6Memory Management RequirementsSharingAllow several processes to access the same portion of memoryBetter to allow each process access to the same copy of the program rather than have their own separate copy
اسلاید 7: 7Memory Management RequirementsLogical OrganizationPrograms are written in modulesModules can be written and compiled independentlyDifferent degrees of protection given to modules (read-only, execute-only)Share modules among processes
اسلاید 8: 8Memory Management RequirementsPhysical OrganizationMemory available for a program plus its data may be insufficientOverlaying allows various modules to be assigned the same region of memoryProgrammer does not know how much space will be available
اسلاید 9: 9Fixed PartitioningEqual-size partitionsAny process whose size is less than or equal to the partition size can be loaded into an available partitionIf all partitions are full, the operating system can swap a process out of a partitionA program may not fit in a partition. The programmer must design the program with overlays
اسلاید 10: 10Fixed PartitioningMain memory use is inefficient. Any program, no matter how small, occupies an entire partition. This is called internal fragmentation.
اسلاید 11: 11
اسلاید 12: 12Placement Algorithm with PartitionsEqual-size partitionsBecause all partitions are of equal size, it does not matter which partition is usedUnequal-size partitionsCan assign each process to the smallest partition within which it will fitQueue for each partitionProcesses are assigned in such a way as to minimize wasted memory within a partition
اسلاید 13: 13
اسلاید 14: 14Dynamic PartitioningPartitions are of variable length and numberProcess is allocated exactly as much memory as requiredEventually get holes in the memory. This is called external fragmentationMust use compaction to shift processes so they are contiguous and all free memory is in one block
اسلاید 15: 15
اسلاید 16: 16Dynamic Partitioning Placement AlgorithmOperating system must decide which free block to allocate to a processBest-fit algorithmChooses the block that is closest in size to the requestWorst performer overallSince smallest block is found for process, the smallest amount of fragmentation is leftMemory compaction must be done more often
اسلاید 17: 17Dynamic Partitioning Placement AlgorithmFirst-fit algorithmScans memory form the beginning and chooses the first available block that is large enoughFastestMay have many process loaded in the front end of memory that must be searched over when trying to find a free block
اسلاید 18: 18Dynamic Partitioning Placement AlgorithmNext-fitScans memory from the location of the last placementMore often allocate a block of memory at the end of memory where the largest block is foundThe largest block of memory is broken up into smaller blocksCompaction is required to obtain a large block at the end of memory
اسلاید 19: 19
اسلاید 20: 20Buddy SystemEntire space available is treated as a single block of 2UIf a request of size s such that 2U-1 < s <= 2U, entire block is allocatedOtherwise block is split into two equal buddiesProcess continues until smallest block greater than or equal to s is generated
اسلاید 21: 21
اسلاید 22: 22
اسلاید 23: 23RelocationWhen program loaded into memory the actual (absolute) memory locations are determinedA process may occupy different partitions which means different absolute memory locations during execution (from swapping)Compaction will also cause a program to occupy a different partition which means different absolute memory locations
اسلاید 24: 24AddressesLogicalReference to a memory location independent of the current assignment of data to memoryTranslation must be made to the physical addressRelativeAddress expressed as a location relative to some known pointPhysicalThe absolute address or actual location in main memory
اسلاید 25: 25
اسلاید 26: 26Registers Used during ExecutionBase registerStarting address for the processBounds registerEnding location of the processThese values are set when the process is loaded or when the process is swapped in
اسلاید 27: 27Registers Used during ExecutionThe value of the base register is added to a relative address to produce an absolute addressThe resulting address is compared with the value in the bounds registerIf the address is not within bounds, an interrupt is generated to the operating system
اسلاید 28: 28PagingPartition memory into small equal fixed-size chunks and divide each process into the same size chunksThe chunks of a process are called pages and chunks of memory are called framesOperating system maintains a page table for each processContains the frame location for each page in the processMemory address consist of a page number and offset within the page
اسلاید 29: 29Assignment of Process Pages to Free Frames
اسلاید 30: 30Assignment of Process Pages to Free Frames
اسلاید 31: 31Page Tables for Example
اسلاید 32: 32SegmentationAll segments of all programs do not have to be of the same lengthThere is a maximum segment lengthAddressing consist of two parts - a segment number and an offsetSince segments are not equal, segmentation is similar to dynamic partitioning
اسلاید 33: 33
اسلاید 34: 34
اسلاید 35: 35
نقد و بررسی ها
هیچ نظری برای این پاورپوینت نوشته نشده است.