DOC PREVIEW
GSU CSC 4320 - l8

This preview shows page 1-2-3-4-26-27-28-54-55-56-57 out of 57 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 57 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 57 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 57 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 57 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 57 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 57 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 57 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 57 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 57 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 57 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 57 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 57 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CSC 4320/6320 Operating Systems Lecture 8 Main MEMORYChapter 8: Memory ManagementObjectivesBackgroundBase and Limit RegistersHW Address Protection with Base & Limit RegistersBinding of Instructions and Data to MemoryMultistep Processing of a User ProgramLogical vs. Physical Address SpaceMemory-Management Unit (MMU)Dynamic relocation using a relocation registerDynamic LoadingDynamic LinkingSwappingSchematic View of SwappingContiguous AllocationHardware Support for Relocation and Limit RegistersContiguous Allocation (Cont)Dynamic Storage-Allocation ProblemFragmentationPagingAddress Translation SchemePaging HardwarePaging Model of Logical and Physical MemoryPaging ExampleFree FramesImplementation of Page TableAssociative MemoryPaging Hardware With TLBMemory ProtectionValid (v) or Invalid (i) Bit In A Page TableShared PagesShared Pages ExampleStructure of the Page TableHierarchical Page TablesTwo-Level Page-Table SchemeTwo-Level Paging ExampleAddress-Translation SchemeThree-level Paging SchemeHashed Page TablesHashed Page TableInverted Page TableInverted Page Table ArchitectureSegmentationUser’s View of a ProgramLogical View of SegmentationSegmentation ArchitectureSegmentation Architecture (Cont.)Segmentation HardwareExample of SegmentationExample: The Intel PentiumLogical to Physical Address Translation in PentiumIntel Pentium SegmentationPentium Paging ArchitectureLinear Address in LinuxThree-level Paging in LinuxEnd of Lecture 8Saurav KarmakarChapter 8: Memory ManagementBackgroundSwapping Contiguous Memory AllocationPagingStructure of the Page TableSegmentationExample: The Intel PentiumObjectivesTo provide a detailed description of various ways of organizing memory hardwareTo discuss various memory-management techniques, including paging and segmentationTo provide a detailed description of the Intel Pentium, which supports both pure segmentation and segmentation with pagingBackgroundProgram must be brought (from disk) into memory and placed within a process for it to be runMain memory and registers are only storage CPU can access directlyRegister access time is one(or less) CPU clockMain memory access can take many cyclesCache sits between main memory and CPU registersProtection of memory required to ensure correct operationBase and Limit RegistersA pair of base and limit registers define the logical address space of a processHW Address Protection with Base & Limit RegistersBinding of Instructions and Data to MemoryAddress binding of instructions and data to memory addresses can happen at three different stagesCompile time: If memory location known a priori, absolute code can be generated; must recompile code if starting location changesLoad time: Must generate relocatable code if memory location is not known at compile timeExecution time: Binding delayed until run time if the process can be moved during its execution from one memory segment to another. Need hardware support for address maps (e.g., base and limit registers)Multistep Processing of a User ProgramLogical vs. Physical Address SpaceThe concept of a logical address space that is bound to a separate physical address space is central to proper memory managementLogical address – generated by the CPU; also referred to as virtual addressPhysical address – address seen by the memory unitLogical and physical addresses are the same in compile-time and load-time address-binding schemes; logical (virtual) and physical addresses differ in execution-time address-binding schemeMemory-Management Unit (MMU)Hardware device that maps virtual to physical addressIn MMU scheme, the value in the relocation register is added to every address generated by a user process at the time it is sent to memoryThe user program deals with logical addresses; it never sees the real physical addressesDynamic relocation using a relocation registerDynamic LoadingRoutine is not loaded until it is calledBetter memory-space utilization; unused routine is never loadedUseful when large amounts of code are needed to handle infrequently occurring casesNo special support from the operating system is required implemented through program designDynamic LinkingLinking postponed until execution timeSmall piece of code, stub, used to locate the appropriate memory-resident library routineStub replaces itself with the address of the routine, and executes the routineThere are system also known as shared librariesOperating system needed to check if routine is in processes’ memory addressSwappingA process can be swapped temporarily out of memory to a backing store, and then brought back into memory for continued executionBacking store – fast disk large enough to accommodate copies of all memory images for all users; must provide direct access to these memory imagesRoll out, roll in – swapping variant used for priority-based scheduling algorithms; lower-priority process is swapped out so higher-priority process can be loaded and executedMajor part of swap time is transfer time; total transfer time is directly proportional to the amount of memory swappedModified versions of swapping are found on many systems (i.e., UNIX, Linux, and Windows)System maintains a ready queue of ready-to-run processes which have memory images on diskSchematic View of SwappingContiguous AllocationMain memory usually divided into two partitions:Resident operating system, usually held in low memory with interrupt vectorUser processes then held in high memoryRelocation registers used to protect user processes from each other, and from changing operating-system code and dataBase register contains value of smallest physical addressLimit register contains range of logical addresses – each logical address must be less than the limit register MMU maps logical address dynamicallyHardware Support for Relocation and Limit RegistersContiguous Allocation (Cont)Multiple-partition allocationFixed-partition; Variable-partitionHole – block of available memory; holes of various size are scattered throughout memoryWhen a process arrives, it is allocated memory from a hole large enough to accommodate itOperating system maintains information about:a) allocated partitions b) free partitions (hole)OSprocess 5process 8process 2OSprocess 5process 2OSprocess 5process 2OSprocess 5process 9process 2process 9process 10Dynamic


View Full Document

GSU CSC 4320 - l8

Documents in this Course
l4

l4

42 pages

l13

l13

35 pages

l6

l6

76 pages

l7

l7

45 pages

l2

l2

90 pages

l12

l12

35 pages

l11

l11

54 pages

l5

l5

57 pages

Load more
Download l8
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view l8 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view l8 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?