L37 - CS61C Machine Structures Lecture 37 - Input/Output...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
CS61C L37 Input / Output Wawrzynek, Fall 2007 © UCB 11/26/2007 John Wawrzynek (www.cs.berkeley.edu/~johnw) www-inst.eecs.berkeley.edu/~cs61c/ CS61C – Machine Structures Lecture 37 - Input/Output 1 CS61C L37 Input / Output Wawrzynek, Fall 2007 © UCB Review: Virtual Memory Memory managed in conjunction with disk. Treat main memory as cache: • Included protection as bonus, now critical • Use Page Table of mappings for each process vs. tag/data in cache • TLB is cache of Virtual Physical addr trans Spatial Locality means Working Set of Pages is all that must be in memory for process to run fairly well Virtual Memory allows protected sharing of memory between processes 2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS61C L37 Input / Output Wawrzynek, Fall 2007 © UCB What if the data is on disk? We load the page off the disk into a free block of memory, using a DMA transfer (Direct Memory Access – special hardware support to avoid processor) • Meantime we switch to some other process waiting to be run When the DMA is complete, we get an interrupt and update the process's page table • So when we switch back to the task, the desired data will be in memory 3 CS61C L37 Input / Output Wawrzynek, Fall 2007 © UCB What if we don ʼ t have enough memory? We chose some other page belonging to a program and transfer it onto the disk if it is dirty • If clean (disk copy is up-to-date), just overwrite that data in memory • We chose the page to evict based on replacement policy (e.g., LRU) And update that program's page table to re±ect the fact that its memory moved somewhere else If continuously swapping between disk and memory, called Thrashing 4
Background image of page 2
CS61C L36 Virtual Memory II Wawrzynek, Fall 2007 © UCB Peer Instruction A. Locality is important yet different for cache and virtual memory (VM): temporal locality for caches but spatial locality for VM B. Cache management is done by hardware (HW), page table management by the operating system (OS), but TLB management is either by HW or OS C. VM helps both with security and cost ABC 0: FFF 1: FF T 2: F T F 3: F TT 4: T FF 5: T F T 6: TT F 7: TTT 5 CS61C L37 Input / Output Wawrzynek, Fall 2007 © UCB Recall : 5 components of any Computer Processor (active) Computer Control (“brain”) Datapath (“brawn”) Memory (passive) (where programs, data live when running) Devices Input Output Keyboard, Mouse Display , Printer Disk, Network Earlier Lectures Current Lectures 6
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS61C L37 Input / Output Wawrzynek, Fall 2007 © UCB Motivation for Input/Output I/O is how humans interact with computers I/O is how computers interconnect (Internet/www) I/O is how computers sense and control the environment.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 14

L37 - CS61C Machine Structures Lecture 37 - Input/Output...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online