DOC PREVIEW
SJSU CS 147 - Virtual Memory

This preview shows page 1-2-3-4-5-6 out of 18 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 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 18 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 18 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 18 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 18 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 18 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS 147 Virtual Memory Prof. Sin Min LeeVIRTUAL MEMORYWhy Virtual Memory?Initial ProblemsSome TerminologyVirtual Memory FeaturesVirtual Memory DrawbacksHow can programs be separated?Virtual AddressingVirtual Memory InterfaceMMUMapping and ArithmeticDynamic creation of Virtual MemoryPagingBlocks and PagingThe Page TableMultiprogramming and Virtual SpacesENDCS 147CS 147Virtual MemoryVirtual MemoryProf. Sin Min LeeProf. Sin Min LeeAnthony PalladinoVIRTUAL MEMORYVIRTUAL MEMORYWhy Virtual Memory?Why Virtual Memory?When computers were first being developed, memory was very costly and hard to come by.Computers were the size of warehouses, yet often only had memory which amounted to 128 kilobytes.The complication of running out of memory space during run-time began to surface and a solution was needed in order to alleviate this problem.A way to provide nearly limitless cheap memory was sought by programmers.What was developed was virtual memory.Initial ProblemsInitial ProblemsMany early programmers thought it too strange a concept to be pursued, and argued against it.Addressing initially was a problem before a stable process was developed.Many thought that virtual memory would simply be to expensive to implement correctly, as well as use too large a portion of the processors power.It was unclear at first how to mass produce the process for home use.Some TerminologySome TerminologyVirtual Memory- VRAM- Virtual Random Access MemoryPhysical Memory – Actually hardware memoryMMU – Memory management UnitReal Address – Physical address in memoryVirtual address – address of virtual memoryMemory address – address of physical memoryVirtual Memory FeaturesVirtual Memory FeaturesVirtual memory is much larger than real memory.Today’s Primary job for virtual memory is to avoid software conflicts.Conversions are done on the Page tables.MMU Controls the process.The TLB allows for paging to remain fast.Programs are no longer limited by amount of real memory. (much larger problem when computers were first being developed)Virtual Memory DrawbacksVirtual Memory DrawbacksAddressing is more difficultConflicts can terminate programsDisk drive is much slower than memory (thousands to millions of times)How can programs be How can programs be separated?separated?At any given time, only a fraction of a program is running (90/10 Rule)Only parts needed for immediate execution, or that are used repeatedly are loaded.Less accessed parts are left on disk and out of memory in order to save space. (programs can be several gigs these days, much too big for the amount of memory most people have in their computers)Virtual AddressingVirtual AddressingVirtual memory must use a smart memory controller that can convert between the byte and word addressing, between the two memory systems.This was later designed to be done without arithmetic computation, so that the CPU would not lose much processing power.The easiest way to implement this was by keeping everything in powers of two.Virtual Memory is not part of the actual underlying physical memory.Each Program is able to operate in its own virtual address spaceVirtual Memory InterfaceVirtual Memory InterfaceVirtual memory is able to use complex memory organization structures, primarily through the use of the MMU previously mentioned.This can be complicated as different types of memory (such as SRAM and DRAM) use different word sizes. Additionally, RISC processors discussed previously in class have access to more than one memory structure.The MMU is at the root of all virtual memory control.MMUMMUThe MMU is a processor run controller that handles the memory.It serves as a hardware translator, doing conversions The MMU is able to connect memories with different word sizes, as well as virtual and real.As far as the processor knows, there is one large memory, with one set of addresses.Mapping and Arithmetic Mapping and Arithmetic Memory addressing is started from zero, and this is expect, so the MMU does proper adjustments to keep this illusion.This helps in simulating one large contiguous memory.In order to keep the MMU from having to do intense mathematical calculations in order maintain memory structure (such as subtraction), it finds boundaries in powers of two, allowing the lower-order bits to easily be used in the addressing scheme.When a computer is created, the virtual memory is determined. When a user adds or removes physical memory, it may create a hole, or a place where virtual memory cannot be mapped to physical.This can create an error due to discontinuity.Dynamic creation of Virtual Dynamic creation of Virtual MemoryMemoryThe processor can determine the mappings before running, determining what is needed and what is not.The processor then switches to real mode, using only the physical memory.Finally, after mapping is done, the MMU is enabled.PagingPagingPaging was developed as a more efficient replacement for segmentation.Memory is broken into blocks with equal sizes, known as pages.Paging’s efficiency relies on page replacement, which moves the least likely need paged out of physical memory.The page system often relies on a power of two system, again to avoid costly arithmetic calculations.The MMU controls the page table.Blocks and PagingBlocks and PagingPaging is controlled by the Page MapThe Virtual address space is separated into portions known as pages.Physical memory is separated into pieces known as page frames.Pieces are all of equal size.The Page TableThe Page TableThe page table is a structure controlled by the operating system.It contains the mapping of virtual addresses to their physical location in memory.Every process and program is given its own page table.The page table contains all possible page mappings.Multiprogramming and Virtual Multiprogramming and Virtual SpacesSpacesMultiprogramming is designed so that multiple programs can be run at the same time.Early on, this was considered a bad idea, as memory conflicts could arise between the different programs, and both would end in abnormal termination.This could be solved by having programs designed to run intentionally using different memory addresses, but this a great deal more intensive, and requires much programming, while still being risky.To alleviate this problem, memory partitioning was


View Full Document

SJSU CS 147 - Virtual Memory

Documents in this Course
Cache

Cache

24 pages

Memory

Memory

54 pages

Memory

Memory

70 pages

Lecture 1

Lecture 1

53 pages

Cisc

Cisc

18 pages

Quiz 1

Quiz 1

4 pages

LECTURE 2

LECTURE 2

66 pages

RISC

RISC

40 pages

LECTURE 2

LECTURE 2

66 pages

Lecture 2

Lecture 2

67 pages

Lecture1

Lecture1

53 pages

Chapter 5

Chapter 5

14 pages

Memory

Memory

27 pages

Counters

Counters

62 pages

Load more
Download Virtual Memory
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 Virtual Memory 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 Virtual Memory 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?