File Systems, Course Wrap Up
|
|
- Alan Chambers
- 5 years ago
- Views:
Transcription
1 File Systems, Course Wrap Up CSE 410 Winter 2017 Instructor: Justin Hsia Slides adapted from CSE451 material by Gribble, Lazowska, Levy, and Zahorjan Teaching Assistants: Kathryn Chan, Kevin Bi, Ryan Wong, Waylon Huang, Xinyu Sui
2 Administrivia Course evaluation: Final Exam: Tue, Mar. 2:30pm in MGH 241 Review Session: Sun, Mar. 1:30pm in SAV 264 Cumulative (midterm clobber policy applies) TWO double sided handwritten cheat sheets Recommended that you reuse/remake your midterm cheat sheet 2
3 Topics Secondary Storage Disks File Systems Files, directories, and disk blocks 3
4 Interface Layers App. Code Std. Runtime Library OS Disk Procedure Calls Device-type Dependent Commands Whatever Syscalls 4
5 Primary Roles of the OS (File System) 1) Hide hardware specific interface 2) Allocate disk blocks 3) Check permissions 4) Understand directory file structure 5) Maintain metadata 6) Performance 7) Flexibility OS Disk / root etc 5
6 File System Concept The implementation of the abstraction for secondary storage Specific chunks of memory put together form a file Logical organization of files into directories and the directory hierarchy Sharing of data between processes, people and machines Access control, consistency, 6
7 Files A file is a collection of data with some properties Attributes: size, owner, last read/write time, protection, On Linux, use ls -l to view Files may also have types 1) Understood by file system e.g. device, directory, symbolic link 2) Understood by other parts of the OS or by runtime libraries e.g. executable, dll, source code, object code, text file, Type can be encoded in the file s name or contents Windows encodes in file extension (e.g..exe,.dll,.jpg,.mp3) UNIX encodes within file (e.g. magic numbers or initial characters) 7
8 Basic Operations Unix create(name) open(name, mode) read(fd, buf, len) write(fd, buf, len) sync(fd) seek(fd, pos) close(fd) unlink(name) rename(old, new) Windows CreateFile(name, CREATE) CreateFile(name, OPEN) ReadFile(handle, ) WriteFile(handle, ) FlushFileBuffers(handle, ) SetFilePointer(handle, ) CloseHandle(handle, ) DeleteFile(name) CopyFile(name) MoveFile(name) 8
9 Directories Directories provide: A way for users to organize their files A convenient file name space for both users and file systems Most file systems support multi level directories Naming hierarchies (/, /usr, /usr/local, /usr/local/bin, ) Most file systems support the notion of current directory Absolute: fully qualified starting from root of file system bash$ cd /usr/local Relative: specified with respect to current directory bash$ cd /usr/local (absolute) bash$ cd bin (relative, equivalent to cd /usr/local/bin) 9
10 Directory Internals A directory is typically just a file that happens to contain special metadata Directory = list of (name of file, file attributes) Attributes include such things as: Size, protection, location on disk, creation time, access time, The directory list is usually unordered (effectively random) In UNIX, the ls command sorts the results for you 10
11 Path Name Translation Let s say you want to open /one/two/three fd = open( /one/two/three, O_RDWR); What goes on inside the file system? 1) Open directory / (well known, can always find) 2) Search the directory for one and get location 3) Open directory one, search for two and get location 4) Open directory two, search for three and get location 5) Open file three Permissions are checked at each step OS caches prefix lookups to enhance performance 11
12 File Protection File system must implement some kind of protection Control who can access a file (user) Control how they can access it (e.g. read, write, or exec) More generally: Generalize files to objects (the what ) Generalize users to principals (the who, user or program) Generalize read/write to actions (the how, or operations) A protection system dictates whether a given action performed by a given principal on a given object should be allowed 12
13 UNIX: inodes Unique representation of each file Format: User number Group number Protection bits Times (file last read, file last written, inode last written) File code: specifies if the i node represents a directory, an ordinary user file, or a special file (typically an I/O device) Size: length of file in bytes Block list: locates contents of file (in the file contents area) Link count: number of directories referencing this i node 13
14 UNIX: The Tree File System A directory is a flat file of fixed size entries Each entry consists of an inode number and a file name inode number File name 216 my_file 4 another_file 93 oh_my_god 144 a_directory 14
15 UNIX 7: Block List of the inode Points to blocks in the file contents area Must be able to represent very small and very large files How? Each inode contains up to 13 block pointers First 10 are direct pointers (pointers to 512B blocks of file data) Then, single, double, and triple indirect pointers
16 Putting It All Together The file system is just a huge data structure superblock inode for / directory / (table of entries) inode for usr/ inode for bigfile.bin directory usr/ (table of entries) inode for var/ directory var/ (table of entries) inode free list file block free list indirection block data blocks indirection block data blocks Indirection block data blocks 16
17 File System Consistency Both inodes and file blocks are cached in memory The sync command forces memory resident disk information to be written to disk System does a sync every few seconds A crash or power failure between syncs can leave an inconsistent disk You could reduce the frequency of problems by reducing caching, but performance would suffer bigtime 17
18 Course Wrap Up End to end Review What happens after you write your source code? How code becomes a program (Lecture 28) How your computer executes your code Victory lap and high level concepts ( points) More useful for 5 years from now than next week s final Question time 18
19 C: The Low Level High Level Language C is a hands off language that exposes more of hardware (especially memory) Weakly typed language that stresses data as bits Anything can be represented with a number! Unconstrained pointers can hold address of anything And no bounds checking buffer overflow possible! Efficient by leaving everything up to the programmer C is good for two things: being beautiful and creating catastrophic 0days in memory management. ( is broken 81e5f33a24e1)
20 C Data Types C Primitive types Fixed sizes and alignments Characters (char), Integers (short, int, long), Floating Point (float, double) C Data Structures Arrays contiguous chunks of memory Multidimensional arrays = still one continuous chunk, but row major Multi level arrays = array of pointers to other arrays Structs structured group of variables Struct fields are ordered according to declaration order Internal fragmentation: space between members to satisfy member alignment requirements (aligned for each primitive element) External fragmentation: space after last member to satisfy overall struct alignment requirement (largest primitive member)
21 C and Memory Using C allowed us to examine how we store and access data in memory Endianness (only applies to memory) Is the first byte (lowest address) the least significant (little endian) or most significant (big endian) of your data? Array indices and struct fields result in calculating proper addresses to access Consequences of your code: Affects performance (locality) Affects security But to understand these effects better, we had to dive deeper
22 How Code Becomes a Program text text C source code Compiler (gcc Og -S) Assembly files Assembler (gcc -c or as) binary Object files Linker (gcc or ld) Static libraries binary Executable program Loader (the OS) Hardware 22
23 Instruction Set Architecture Source code Different applications or algorithms C Language Program A Compiler Perform optimizations, generate instructions GCC Architecture Instruction set x86 64 Hardware Different implementations Intel Pentium 4 Intel Core 2 Intel Core i7 Program B Your program Clang CISC RISC ARMv8 (AArch64/A64) AMD Opteron AMD Athlon ARM Cortex A53 Apple A7 23
24 Assembly Programmer s View PC CPU Registers Condition Codes Addresses Data Instructions Memory Stack Heap Data Programmer visible state PC: the Program Counter (%rip in x86 64) Address of next instruction Named registers Together in register file Heavily used program data Condition codes Store status information about most recent arithmetic operation Code Memory Byte addressable array Huge virtual address space Private, all to yourself Used for conditional branching 24
25 Program s View CPU Memory %rip Registers Condition Codes 2 N 1 High addresses Stack local variables; procedure context Dynamic Data (Heap) variables allocated with new or malloc Static Data static variables (global variables in C) Literals Large constants (e.g., example ) Low addresses 0 Instructions 25
26 Program s View Instructions Data movement mov, movz, movz push, pop Arithmetic add, sub, imul Control flow cmp, test jmp, je, jgt,... call, ret 2 N 1 High addresses Operand types Literal: $8 Register: %rdi, %al Memory: D(Rb,Ri,S) = D+Rb+Ri*S lea: not a memory access! Low addresses 0 Memory Stack Dynamic Data (Heap) Static Data Literals Instructions local variables; procedure context variables allocated with new or malloc static variables (global variables in C) Large constants (e.g., example ) 26
27 Program s View Procedures Essential abstraction Recursion Stack discipline Stack frame per call Local variables Calling convention How to pass arguments 2 N 1 High addresses Diane s Silk Dress Costs $89 How to return data Return address Caller saved / callee saved registers Memory Stack Dynamic Data (Heap) Static Data Literals local variables; procedure context variables allocated with new or malloc static variables (global variables in C) Large constants (e.g., example ) Low addresses 0 Instructions 27
28 But remember it s all an illusion! CPU Memory %rip Registers Condition Codes 2 N 1 High addresses Stack local variables; procedure context Context switches Don t really have CPU to yourself Dynamic Data (Heap) variables allocated with new or malloc Virtual Memory Don t really have 2 64 bytes of memory all to yourself Allows for indirection (remap physical pages, sharing ) Low addresses 0 Static Data Literals Instructions static variables (global variables in C) Large constants (e.g., example ) 28
29 But remember it s all an illusion! %rip %rip CPU Process 3 CPU Process 2 Registers Condition Codes Registers Condition Codes 2 N 1 High addresses 2 N 1 High addresses Memory Stack Dynamic Data (Heap) Dynamic DataStatic Data (Heap) Literals Static Data Instructions Low Literals 0 addresses Memory Stack fork Creates copy of the process execve Replace with new program wait Wait for child to die (to reap it and prevent zombies) Low addresses 0 Instructions %rip CPU Process 1 Registers Condition Codes 2 N 1 High addresses Low addresses 0 Memory Stack Dynamic Data (Heap) Static Data Literals Instructions Hardware 29
30 Virtual Memory CPU Chip TLB 2 PTE VPN 3 CPU VA 1 MMU PA 4 Cache/ Memory Data 5 Address Translation Every memory access must first be converted from virtual to physical Indirection: just change the address mapping when switching processes Luckily, TLB (and page size) makes it pretty fast 30
31 But Memory is Also a Lie! Memory CPU %rip Registers Condition Codes L1 Cache L2 Cache L3 Cache Main Memory DRAM Illusion of one flat array of bytes But caches invisibly make accesses to physical addresses faster! Caches Associativity tradeoff with miss rate and access time Block size tradeoff with spatial and temporal locality Cache size tradeoff with miss rate and cost 31
32 Memory Hierarchy <1 ns registers 5 10 s Smaller, faster, costlier per byte 5 10 ns 1 ns on chip L1 cache (SRAM) off chip L2 cache (SRAM) 1 2 min Larger, slower, cheaper per byte 100 ns 150,000 ns SSD main memory (DRAM) local secondary storage min 31 days 10,000,000 ns (10 ms) Disk (local disks) 66 months = 1.3 years ms remote secondary storage (distributed file systems, web servers) 1 15 years 32
33 Operating Systems Applications OS Hardware The OS is everything you don t need to write in order to run your application OS Structure determined by privilege levels of modules Hybrid between monolithic and microkernel structures A threads is a sequential execution stream within a process The unit of scheduling different/less state information than process The file system provides an abstraction of related pieces of data and an interface to data on secondary storage 33
34 Victory Lap A victory lap is an extra trip around the track By the exhausted victors (that s us) Review course goals The following slides are copied directly from Lecture 1 They should make much more sense now!
35 Little Theme 1: Representation All digital systems represent everything as 0s and 1s The 0 and 1 are really two different voltage ranges in the wires Or magnetic positions on a disc, or hole depths on a DVD, or even DNA Everything includes: Numbers integers and floating point Characters the building blocks of strings Instructions the directives to the CPU that make up a program Pointers addresses of data objects stored away in memory Encodings are stored throughout a computer system In registers, caches, memories, disks, etc. They all need addresses (a way to locate) Find a new place to put a new item Reclaim the place in memory when data no longer needed 35
36 Little Theme 2: Translation There is a big gap between how we think about programs and data and the 0s and 1s of computers Need languages to describe what we mean These languages need to be translated one level at a time We know Java as a programming language Have to work our way down to the 0s and 1s of computers Try not to lose anything in translation! We ll encounter C language, assembly language, and machine code (for the x86 family of CPU architectures) 36
37 Little Theme 3: Control Flow How do computers orchestrate everything they are doing? Within one program: How do we implement if/else, loops, switches? What do we have to keep track of when we call a procedure, and then another, and then another, and so on? How do we know what to do upon return? Across programs and operating systems: Multiple user programs Operating system has to orchestrate them all Each gets a share of computing cycles They may need to share system resources (memory, I/O, disks) Yielding and taking control of the processor Voluntary or by force? 37
38 Course Perspective CSE410 will make you a better programmer Purpose is to show how software really works Understanding the underlying system makes you more effective Better debugging Better basis for evaluating performance How multiple activities work in concert (e.g. OS and user programs) Not just a course for hardware enthusiasts! What every programmer needs to know (plus many more details) Stuff everybody learns and uses and forgets not knowing CSE410 presents a world view that will empower you The intellectual and software tools to understand the trillions+ of 1s and 0s that are flying around when your program runs 38
39 Can You Now Explain These to a Friend? Which of the following did you actually find the most interesting to learn about? ( a) What is a GFLOP and why is it used in computer benchmarks? b) How and why does running many programs for a long time eat into your memory (RAM)? c) What is stack overflow and how does it happen? d) Why does your computer slow down when you run out of disk space? e) What was the flaw behind the original Internet worm and the Heartbleed bug? f) What is the meaning behind the different CPU specifications? (e.g. # of cores, # and size of cache, supported memory types) 39
40 The First Comic
41 Thanks for a great quarter! Huge thanks to your awesome TAs! Kathryn Kevin Ryan Xinyu Waylon Thanks to course content creators: Randy Bryant David O Halloran Hal Perkins Best of luck in the future! Always possible to keep learning outside of courses
42 Ask Me Anything
43
Course Wrap-Up CSE 351 Spring
Course Wrap-Up CSE 351 Spring 2018 https://xkcd.com/1760/ Administrivia Please fill out the course evaluation! Evaluations close this Sunday at 11:59pm Not viewable until after grades are submitted 90%+
More informationCSE 451: Operating Systems Winter Module 15 File Systems
CSE 451: Operating Systems Winter 2017 Module 15 File Systems Mark Zbikowski mzbik@cs.washington.edu Allen Center 476 2013 Gribble, Lazowska, Levy, Zahorjan Interface Layers App. Code Std. Runtime Library
More informationMotivation: I/O is Important. CS 537 Lecture 12 File System Interface. File systems
Motivation: I/O is Important CS 537 Lecture 12 File System Interface Michael Swift Applications have two essential components: Processing ( I/O ) Input/Output What applications have no input? no output?
More informationWe made it! Java: Assembly language: OS: Machine code: Computer system:
We made it! C: car *c = malloc(sizeof(car)); c->miles = 100; c->gals = 17; float mpg = get_mpg(c); free(c); Assembly language: Machine code: get_mpg: pushq movq... popq ret %rbp %rsp, %rbp %rbp 0111010000011000
More informationCSE 120 Principles of Operating Systems
CSE 120 Principles of Operating Systems Spring 2018 Lecture 12: File Systems Geoffrey M. Voelker File Systems First we ll discuss properties of physical disks Structure Performance Then how file systems
More informationCSE 120 Principles of Operating Systems
CSE 120 Principles of Operating Systems Fall 2016 Lecture 12: File Systems Geoffrey M. Voelker File Systems First we ll discuss properties of physical disks Structure Performance Scheduling Then we ll
More informationIntroduction to Computer Systems
Introduction to Computer Systems Today:! Welcome to EECS 213! Lecture topics and assignments Next time:! Bits & bytes! and some Boolean algebra Fabián E. Bustamante, 2007 Welcome to Intro. to Computer
More informationStructs & Alignment. CSE 351 Autumn Instructor: Justin Hsia
Structs & Alignment CSE 351 Autumn 2018 Instructor: Justin Hsia Teaching Assistants: Akshat Aggarwal An Wang Andrew Hu Brian Dai Britt Henderson James Shin Kevin Bi Kory Watson Riley Germundson Sophie
More informationIntroduction to Computer Systems
Introduction to Computer Systems Today: Welcome to EECS 213 Lecture topics and assignments Next time: Bits & bytes and some Boolean algebra Fabián E. Bustamante, Spring 2010 Welcome to Intro. to Computer
More informationWorkloads. CS 537 Lecture 16 File Systems Internals. Goals. Allocation Strategies. Michael Swift
Workloads CS 537 Lecture 16 File Systems Internals Michael Swift Motivation: Workloads influence design of file system File characteristics (measurements of UNIX and NT) Most files are small (about 8KB)
More informationIntroduction to Computer Systems
CS-213 Introduction to Computer Systems Yan Chen Topics: Staff, text, and policies Lecture topics and assignments Lab rationale CS 213 F 06 Teaching staff Instructor TA Prof. Yan Chen (Thu 2-4pm, Tech
More informationStructs and Alignment
Structs and Alignment CSE 410 Winter 2017 Instructor: Justin Hsia Teaching Assistants: Kathryn Chan, Kevin Bi, Ryan Wong, Waylon Huang, Xinyu Sui Self Driving Cars Will Make Organ Shortages Even Worse
More informationIntroduction to C. Why C? Difference between Python and C C compiler stages Basic syntax in C
Final Review CS304 Introduction to C Why C? Difference between Python and C C compiler stages Basic syntax in C Pointers What is a pointer? declaration, &, dereference... Pointer & dynamic memory allocation
More informationRoadmap. Java: Assembly language: OS: Machine code: Computer system:
Roadmap C: car *c = malloc(sizeof(car)); c->miles = 100; c->gals = 17; float mpg = get_mpg(c); free(c); Assembly language: Machine code: Computer system: get_mpg: pushq movq... popq ret %rbp %rsp, %rbp
More informationCS 318 Principles of Operating Systems
CS 318 Principles of Operating Systems Fall 2017 Lecture 15: File Systems Ryan Huang Administrivia Next Tuesday project hacking day, no class 10/26/17 CS 318 Lecture 15 File Systems 2 File System Fun File
More informationMemory, Data, & Addressing I
Memory, Data, & Addressing I CSE 351 Autumn 2017 Instructor: Justin Hsia Teaching Assistants: Lucas Wotton Michael Zhang Parker DeWilde Ryan Wong Sam Gehman Sam Wolfson Savanna Yee Vinny Palaniappan http://xkcd.com/953/
More informationVirtual Memory I. CSE 351 Spring Instructor: Ruth Anderson
Virtual Memory I CSE 35 Spring 27 Instructor: Ruth Anderson Teaching Assistants: Dylan Johnson Kevin Bi Linxing Preston Jiang Cody Ohlsen Yufang Sun Joshua Curtis Administrivia Midterms Graded If you did
More informationChris Riesbeck, Fall Introduction to Computer Systems
Chris Riesbeck, Fall 2011 Introduction to Computer Systems Welcome to Intro. to Computer Systems Everything you need to know http://www.cs.northwestern.edu/academics/courses/213/ Instructor: Chris Riesbeck
More informationKathryn Chan, Kevin Bi, Ryan Wong, Waylon Huang, Xinyu Sui
Caches II CSE 4 Winter 27 Instructor: Justin Hsia Teaching Assistants: Kathryn Chan, Kevin Bi, Ryan Wong, Waylon Huang, Xinyu Sui IBM s hub for wearables could shorten your hospital stay Researchers at
More informationL14: Structs and Alignment. Structs and Alignment. CSE 351 Spring Instructor: Ruth Anderson
Structs and Alignment CSE 351 Spring 2017 Instructor: Ruth Anderson Teaching Assistants: Dylan Johnson Kevin Bi Linxing Preston Jiang Cody Ohlsen Yufang Sun Joshua Curtis Administrivia Lab 2 due TONIGHT
More informationVirtual Memory. CS61, Lecture 15. Prof. Stephen Chong October 20, 2011
Virtual Memory CS6, Lecture 5 Prof. Stephen Chong October 2, 2 Announcements Midterm review session: Monday Oct 24 5:3pm to 7pm, 6 Oxford St. room 33 Large and small group interaction 2 Wall of Flame Rob
More informationCarnegie Mellon. 16 th Lecture, Mar. 20, Instructors: Todd C. Mowry & Anthony Rowe
Virtual Memory: Concepts 5 23 / 8 23: Introduction to Computer Systems 6 th Lecture, Mar. 2, 22 Instructors: Todd C. Mowry & Anthony Rowe Today Address spaces VM as a tool lfor caching VM as a tool for
More informationComputer Systems CSE 410 Autumn Disks and File Systems
Computer Systems CSE 410 Autumn 2013 22 Disks and File Systems Slides adapted from CSE 451 material by Gribble, Lazowska, Levy, and Zahorjan 31 May 2012 Disks and File Systems 1 Topics Secondary Storage
More informationCS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2018 Lecture 23
CS24: INTRODUCTION TO COMPUTING SYSTEMS Spring 208 Lecture 23 LAST TIME: VIRTUAL MEMORY Began to focus on how to virtualize memory Instead of directly addressing physical memory, introduce a level of indirection
More informationVirtual Memory I. CSE 351 Winter Instructor: Mark Wyse
http://rebrn.com/re/bad-chrome-6282/ Virtual Memory I CSE 35 Winter 28 Instructor: Mark Wyse Teaching Assistants: Kevin Bi Parker DeWilde Emily Furst Sarah House Waylon Huang Vinny Palaniappan Administrative
More informationCS 61C: Great Ideas in Computer Architecture. Virtual Memory
CS 61C: Great Ideas in Computer Architecture Virtual Memory Instructor: Justin Hsia 7/30/2012 Summer 2012 Lecture #24 1 Review of Last Lecture (1/2) Multiple instruction issue increases max speedup, but
More informationComputer Systems Architecture I. CSE 560M Lecture 3 Prof. Patrick Crowley
Computer Systems Architecture I CSE 560M Lecture 3 Prof. Patrick Crowley Plan for Today Announcements Readings are extremely important! No class meeting next Monday Questions Commentaries A few remaining
More information198:231 Intro to Computer Organization. 198:231 Introduction to Computer Organization Lecture 14
98:23 Intro to Computer Organization Lecture 4 Virtual Memory 98:23 Introduction to Computer Organization Lecture 4 Instructor: Nicole Hynes nicole.hynes@rutgers.edu Credits: Several slides courtesy of
More informationCS 61C: Great Ideas in Computer Architecture. Direct Mapped Caches
CS 61C: Great Ideas in Computer Architecture Direct Mapped Caches Instructor: Justin Hsia 7/05/2012 Summer 2012 Lecture #11 1 Review of Last Lecture Floating point (single and double precision) approximates
More informationCS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017
CS 471 Operating Systems Yue Cheng George Mason University Fall 2017 Introduction o Instructor of Section 002 Dr. Yue Cheng (web: cs.gmu.edu/~yuecheng) Email: yuecheng@gmu.edu Office: 5324 Engineering
More informationA software view. Computer Systems. The Compilation system. How it works. 1. Preprocesser. 1. Preprocessor (cpp)
A software view User Interface Computer Systems MTSU CSCI 3240 Spring 2016 Dr. Hyrum D. Carroll Materials from CMU and Dr. Butler How it works hello.c #include int main() { printf( hello, world\n
More informationCS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2015 Lecture 23
CS24: INTRODUCTION TO COMPUTING SYSTEMS Spring 205 Lecture 23 LAST TIME: VIRTUAL MEMORY! Began to focus on how to virtualize memory! Instead of directly addressing physical memory, introduce a level of
More informationThe Stack & Procedures
The Stack & Procedures CSE 351 Autumn 2017 Instructor: Justin Hsia Teaching Assistants: Lucas Wotton Michael Zhang Parker DeWilde Ryan Wong Sam Gehman Sam Wolfson Savanna Yee Vinny Palaniappan http://xkcd.com/648/
More informationAgenda. CS 61C: Great Ideas in Computer Architecture. Virtual Memory II. Goals of Virtual Memory. Memory Hierarchy Requirements
CS 61C: Great Ideas in Computer Architecture Virtual II Guest Lecturer: Justin Hsia Agenda Review of Last Lecture Goals of Virtual Page Tables Translation Lookaside Buffer (TLB) Administrivia VM Performance
More information18-447: Computer Architecture Lecture 16: Virtual Memory
18-447: Computer Architecture Lecture 16: Virtual Memory Justin Meza Carnegie Mellon University (with material from Onur Mutlu, Michael Papamichael, and Vivek Seshadri) 1 Notes HW 2 and Lab 2 grades will
More informationVirtual Memory II. CSE 351 Autumn Instructor: Justin Hsia
Virtual Memory II CSE 35 Autumn 26 Instructor: Justin Hsia Teaching Assistants: Chris Ma Hunter Zahn John Kaltenbach Kevin Bi Sachin Mehta Suraj Bhat Thomas Neuman Waylon Huang Xi Liu Yufang Sun https://xkcd.com/495/
More informationComputer Systems A Programmer s Perspective 1 (Beta Draft)
Computer Systems A Programmer s Perspective 1 (Beta Draft) Randal E. Bryant David R. O Hallaron August 1, 2001 1 Copyright c 2001, R. E. Bryant, D. R. O Hallaron. All rights reserved. 2 Contents Preface
More informationCS 261 Fall Mike Lam, Professor. Virtual Memory
CS 261 Fall 2016 Mike Lam, Professor Virtual Memory Topics Operating systems Address spaces Virtual memory Address translation Memory allocation Lingering questions What happens when you call malloc()?
More informationCS162 Operating Systems and Systems Programming Lecture 12. Address Translation. Page 1
CS162 Operating Systems and Systems Programming Lecture 12 Translation March 10, 2008 Prof. Anthony D. Joseph http://inst.eecs.berkeley.edu/~cs162 Review: Important Aspects of Memory Multiplexing Controlled
More informationCS252 S05. Main memory management. Memory hardware. The scale of things. Memory hardware (cont.) Bottleneck
Main memory management CMSC 411 Computer Systems Architecture Lecture 16 Memory Hierarchy 3 (Main Memory & Memory) Questions: How big should main memory be? How to handle reads and writes? How to find
More informationMemory Hierarchy. Mehran Rezaei
Memory Hierarchy Mehran Rezaei What types of memory do we have? Registers Cache (Static RAM) Main Memory (Dynamic RAM) Disk (Magnetic Disk) Option : Build It Out of Fast SRAM About 5- ns access Decoders
More informationCSE 333 Lecture 9 - storage
CSE 333 Lecture 9 - storage Steve Gribble Department of Computer Science & Engineering University of Washington Administrivia Colin s away this week - Aryan will be covering his office hours (check the
More informationPrinciples of Operating Systems
Principles of Operating Systems Lecture 18-20 - Main Memory Ardalan Amiri Sani (ardalan@uci.edu) [lecture slides contains some content adapted from previous slides by Prof. Nalini Venkatasubramanian, and
More informationInstruction Set Architectures
Instruction Set Architectures! ISAs! Brief history of processors and architectures! C, assembly, machine code! Assembly basics: registers, operands, move instructions 1 What should the HW/SW interface
More informationCS3600 SYSTEMS AND NETWORKS
CS3600 SYSTEMS AND NETWORKS NORTHEASTERN UNIVERSITY Lecture 11: File System Implementation Prof. Alan Mislove (amislove@ccs.neu.edu) File-System Structure File structure Logical storage unit Collection
More informationDigital Forensics Lecture 3 - Reverse Engineering
Digital Forensics Lecture 3 - Reverse Engineering Low-Level Software Akbar S. Namin Texas Tech University Spring 2017 Reverse Engineering High-Level Software Low-level aspects of software are often the
More informationMemory Hierarchy, Fully Associative Caches. Instructor: Nick Riasanovsky
Memory Hierarchy, Fully Associative Caches Instructor: Nick Riasanovsky Review Hazards reduce effectiveness of pipelining Cause stalls/bubbles Structural Hazards Conflict in use of datapath component Data
More informationCSE 451: Operating Systems Winter Processes. Gary Kimura
CSE 451: Operating Systems Winter 2013 Processes Gary Kimura Process management This module begins a series of topics on processes, threads, and synchronization this is the most important part of the class,
More informationVirtual Memory: Concepts
Virtual Memory: Concepts 5-23: Introduction to Computer Systems 7 th Lecture, March 2, 27 Instructors: Franz Franchetti & Seth Copen Goldstein Hmmm, How Does This Work?! Process Process 2 Process n Solution:
More informationECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017
ECE 550D Fundamentals of Computer Systems and Engineering Fall 2017 The Operating System (OS) Prof. John Board Duke University Slides are derived from work by Profs. Tyler Bletsch and Andrew Hilton (Duke)
More informationFILE SYSTEMS. CS124 Operating Systems Winter , Lecture 23
FILE SYSTEMS CS124 Operating Systems Winter 2015-2016, Lecture 23 2 Persistent Storage All programs require some form of persistent storage that lasts beyond the lifetime of an individual process Most
More informationCS399 New Beginnings. Jonathan Walpole
CS399 New Beginnings Jonathan Walpole Memory Management Memory Management Memory a linear array of bytes - Holds O.S. and programs (processes) - Each cell (byte) is named by a unique memory address Recall,
More informationProcesses and Virtual Memory Concepts
Processes and Virtual Memory Concepts Brad Karp UCL Computer Science CS 37 8 th February 28 (lecture notes derived from material from Phil Gibbons, Dave O Hallaron, and Randy Bryant) Today Processes Virtual
More informationCarnegie Mellon. Bryant and O Hallaron, Computer Systems: A Programmer s Perspective, Third Edition
Carnegie Mellon Virtual Memory: Concepts 5-23: Introduction to Computer Systems 7 th Lecture, October 24, 27 Instructor: Randy Bryant 2 Hmmm, How Does This Work?! Process Process 2 Process n Solution:
More informationvirtual memory. March 23, Levels in Memory Hierarchy. DRAM vs. SRAM as a Cache. Page 1. Motivation #1: DRAM a Cache for Disk
5-23 March 23, 2 Topics Motivations for VM Address translation Accelerating address translation with TLBs Pentium II/III system Motivation #: DRAM a Cache for The full address space is quite large: 32-bit
More informationAddress spaces and memory management
Address spaces and memory management Review of processes Process = one or more threads in an address space Thread = stream of executing instructions Address space = memory space used by threads Address
More informationCS2028 -UNIX INTERNALS
DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY,SIRUVACHUR-621113. CS2028 -UNIX INTERNALS PART B UNIT 1 1. Explain briefly details about History of UNIX operating system? In 1965, Bell Telephone
More informationMemory Management Topics. CS 537 Lecture 11 Memory. Virtualizing Resources
Memory Management Topics CS 537 Lecture Memory Michael Swift Goals of memory management convenient abstraction for programming isolation between processes allocate scarce memory resources between competing
More informationCSE 153 Design of Operating Systems
CSE 53 Design of Operating Systems Winter 28 Lecture 6: Paging/Virtual Memory () Some slides modified from originals by Dave O hallaron Today Address spaces VM as a tool for caching VM as a tool for memory
More informationAssembly Programming IV
Assembly Programming IV CSE 410 Winter 2017 Instructor: Justin Hsia Teaching Assistants: Kathryn Chan, Kevin Bi, Ryan Wong, Waylon Huang, Xinyu Sui The Data That Turned the World Upside Down The company
More informationChapter 2. OS Overview
Operating System Chapter 2. OS Overview Lynn Choi School of Electrical Engineering Class Information Lecturer Prof. Lynn Choi, School of Electrical Eng. Phone: 3290-3249, Kong-Hak-Kwan 411, lchoi@korea.ac.kr,
More informationRecall: Address Space Map. 13: Memory Management. Let s be reasonable. Processes Address Space. Send it to disk. Freeing up System Memory
Recall: Address Space Map 13: Memory Management Biggest Virtual Address Stack (Space for local variables etc. For each nested procedure call) Sometimes Reserved for OS Stack Pointer Last Modified: 6/21/2004
More informationCOSC3330 Computer Architecture Lecture 20. Virtual Memory
COSC3330 Computer Architecture Lecture 20. Virtual Memory Instructor: Weidong Shi (Larry), PhD Computer Science Department University of Houston Virtual Memory Topics Reducing Cache Miss Penalty (#2) Use
More informationNew-School Machine Structures. Overarching Theme for Today. Agenda. Review: Memory Management. The Problem 8/1/2011
CS 61C: Great Ideas in Computer Architecture (Machine Structures) Virtual Instructor: Michael Greenbaum 1 New-School Machine Structures Software Parallel Requests Assigned to computer e.g., Search Katz
More informationFloating Point II, x86 64 Intro
Floating Point II, x86 64 Intro CSE 351 Autumn 2018 Instructor: Teaching Assistants: Justin Hsia Akshat Aggarwal An Wang Andrew Hu Brian Dai Britt Henderson James Shin Kevin Bi Kory Watson Riley Germundson
More informationPractical Malware Analysis
Practical Malware Analysis Ch 4: A Crash Course in x86 Disassembly Revised 1-16-7 Basic Techniques Basic static analysis Looks at malware from the outside Basic dynamic analysis Only shows you how the
More informationCS 61C: Great Ideas in Computer Architecture. The Memory Hierarchy, Fully Associative Caches
CS 61C: Great Ideas in Computer Architecture The Memory Hierarchy, Fully Associative Caches Instructor: Alan Christopher 7/09/2014 Summer 2014 -- Lecture #10 1 Review of Last Lecture Floating point (single
More informationAnother View of the Memory Hierarchy. Lecture #25 Virtual Memory I Memory Hierarchy Requirements. Memory Hierarchy Requirements
CS61C L25 Virtual I (1) inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #25 Virtual I 27-8-7 Scott Beamer, Instructor Another View of the Hierarchy Thus far{ Next: Virtual { Regs Instr.
More informationOperating Systems CMPSC 473. File System Implementation April 1, Lecture 19 Instructor: Trent Jaeger
Operating Systems CMPSC 473 File System Implementation April 1, 2008 - Lecture 19 Instructor: Trent Jaeger Last class: File System Interface Today: File System Implementation Disks as Secondary Store What
More informationCMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 27, FALL 2012
CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 27, FALL 2012 ANNOUNCEMENTS Need student input on Lecturer Search Max Morawski Lecture 2:30pm 3:15pm, Fri 12/7, ITE 217 Meet with
More informationCSE 120 Principles of Operating Systems
CSE 120 Principles of Operating Systems Spring 2018 Lecture 10: Paging Geoffrey M. Voelker Lecture Overview Today we ll cover more paging mechanisms: Optimizations Managing page tables (space) Efficient
More informationCS 318 Principles of Operating Systems
CS 318 Principles of Operating Systems Fall 2018 Lecture 10: Virtual Memory II Ryan Huang Slides adapted from Geoff Voelker s lectures Administrivia Next Tuesday project hacking day No class My office
More informationCPSC 213. Introduction to Computer Systems. About the Course. Course Policies. Reading. Introduction. Unit 0
About the Course it's all on the web page... http://www.ugrad.cs.ubc.ca/~cs213/winter1t1/ - news, admin details, schedule and readings CPSC 213 - lecture slides (always posted before class) - 213 Companion
More informationFinal Exam. 11 May 2018, 120 minutes, 26 questions, 100 points
Name: CS520 Final Exam 11 May 2018, 120 minutes, 26 questions, 100 points The exam is closed book and notes. Please keep all electronic devices turned off and out of reach. Note that a question may require
More informationAssembly Programming III
Assembly Programming III CSE 410 Winter 2017 Instructor: Justin Hsia Teaching Assistants: Kathryn Chan, Kevin Bi, Ryan Wong, Waylon Huang, Xinyu Sui Facebook Stories puts a Snapchat clone above the News
More information14 May 2012 Virtual Memory. Definition: A process is an instance of a running program
Virtual Memory (VM) Overview and motivation VM as tool for caching VM as tool for memory management VM as tool for memory protection Address translation 4 May 22 Virtual Memory Processes Definition: A
More informationRecap: Memory Management
, 4/13/2018 EE445M/EE360L.12 Embedded and Real-Time Systems/ Real-Time Operating Systems : Memory Protection, Virtual Memory, Paging References: T. Anderson, M. Dahlin, Operating Systems: Principles and
More informationChapter 5B. Large and Fast: Exploiting Memory Hierarchy
Chapter 5B Large and Fast: Exploiting Memory Hierarchy One Transistor Dynamic RAM 1-T DRAM Cell word access transistor V REF TiN top electrode (V REF ) Ta 2 O 5 dielectric bit Storage capacitor (FET gate,
More informationInstruction Set Architectures
Instruction Set Architectures ISAs Brief history of processors and architectures C, assembly, machine code Assembly basics: registers, operands, move instructions 1 What should the HW/SW interface contain?
More informationSlides for Lecture 6
Slides for Lecture 6 ENCM 501: Principles of Computer Architecture Winter 2014 Term Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary 28 January,
More informationCS 3733 Operating Systems:
CS 3733 Operating Systems: Topics: Memory Management (SGG, Chapter 08) Instructor: Dr Dakai Zhu Department of Computer Science @ UTSA 1 Reminders Assignment 2: extended to Monday (March 5th) midnight:
More informationPrinceton University COS 217: Introduction to Programming Systems Fall 2017 Final Exam Preparation
Princeton University COS 217: Introduction to Programming Systems Fall 2017 Final Exam Preparation The exam is a three-hour, closed-book, closed-notes, closed-handouts exam. The exam is cumulative, but
More informationJohn Wawrzynek & Nick Weaver
CS 61C: Great Ideas in Computer Architecture Lecture 23: Virtual Memory John Wawrzynek & Nick Weaver http://inst.eecs.berkeley.edu/~cs61c From Previous Lecture: Operating Systems Input / output (I/O) Memory
More informationMemory Hierarchy Requirements. Three Advantages of Virtual Memory
CS61C L12 Virtual (1) CS61CL : Machine Structures Lecture #12 Virtual 2009-08-03 Jeremy Huddleston Review!! Cache design choices: "! Size of cache: speed v. capacity "! size (i.e., cache aspect ratio)
More informationVirtual Memory Oct. 29, 2002
5-23 The course that gives CMU its Zip! Virtual Memory Oct. 29, 22 Topics Motivations for VM Address translation Accelerating translation with TLBs class9.ppt Motivations for Virtual Memory Use Physical
More informationProcesses and Threads
COS 318: Operating Systems Processes and Threads Kai Li and Andy Bavier Computer Science Department Princeton University http://www.cs.princeton.edu/courses/archive/fall13/cos318 Today s Topics u Concurrency
More information! What is main memory? ! What is static and dynamic allocation? ! What is segmentation? Maria Hybinette, UGA. High Address (0x7fffffff) !
Memory Questions? CSCI [4 6]730 Operating Systems Main Memory! What is main memory?! How does multiple processes share memory space?» Key is how do they refer to memory addresses?! What is static and dynamic
More informationLecture 19: File System Implementation. Mythili Vutukuru IIT Bombay
Lecture 19: File System Implementation Mythili Vutukuru IIT Bombay File System An organization of files and directories on disk OS has one or more file systems Two main aspects of file systems Data structures
More informationLecture 4: Memory Management & The Programming Interface
CS 422/522 Design & Implementation of Operating Systems Lecture 4: Memory Management & The Programming Interface Zhong Shao Dept. of Computer Science Yale University Acknowledgement: some slides are taken
More informationCHAPTER 8 - MEMORY MANAGEMENT STRATEGIES
CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES OBJECTIVES Detailed description of various ways of organizing memory hardware Various memory-management techniques, including paging and segmentation To provide
More informationGoals of memory management
CSE 451: Operating Systems Winter 2004 Module 10 Memory Management Ed Lazowska lazowska@cs.washington.edu Allen Center 570 Goals of memory management Allocate scarce memory resources among competing processes,
More informationVirtual Memory II. CSE 351 Autumn Instructor: Justin Hsia
Virtual Memory II CSE 35 Autumn 27 Instructor: Justin Hsia Teaching Assistants: Lucas Wotton Michael Zhang Parker DeWilde Ryan Wong Sam Gehman Sam Wolfson Savanna Yee Vinny Palaniappan https://xkcd.com/495/
More informationChapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition
Chapter 8: Memory- Management Strategies Operating System Concepts 9 th Edition Silberschatz, Galvin and Gagne 2013 Chapter 8: Memory Management Strategies Background Swapping Contiguous Memory Allocation
More informationCSE 560 Computer Systems Architecture
This Unit: CSE 560 Computer Systems Architecture App App App System software Mem I/O The operating system () A super-application Hardware support for an Page tables and address translation s and hierarchy
More informationChapter 8: Memory-Management Strategies
Chapter 8: Memory-Management Strategies Chapter 8: Memory Management Strategies Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel 32 and
More informationCISC 360. Virtual Memory Dec. 4, 2008
CISC 36 Virtual Dec. 4, 28 Topics Motivations for VM Address translation Accelerating translation with TLBs Motivations for Virtual Use Physical DRAM as a Cache for the Disk Address space of a process
More informationCS 5460/6460 Operating Systems
CS 5460/6460 Operating Systems Fall 2009 Instructor: Matthew Flatt Lecturer: Kevin Tew TAs: Bigyan Mukherjee, Amrish Kapoor 1 Join the Mailing List! Reminders Make sure you can log into the CADE machines
More informationRandom-Access Memory (RAM) Systemprogrammering 2007 Föreläsning 4 Virtual Memory. Locality. The CPU-Memory Gap. Topics
Systemprogrammering 27 Föreläsning 4 Topics The memory hierarchy Motivations for VM Address translation Accelerating translation with TLBs Random-Access (RAM) Key features RAM is packaged as a chip. Basic
More informationWhat s in a process?
CSE 451: Operating Systems Winter 2015 Module 5 Threads Mark Zbikowski mzbik@cs.washington.edu Allen Center 476 2013 Gribble, Lazowska, Levy, Zahorjan What s in a process? A process consists of (at least):
More information15 Sharing Main Memory Segmentation and Paging
Operating Systems 58 15 Sharing Main Memory Segmentation and Paging Readings for this topic: Anderson/Dahlin Chapter 8 9; Siberschatz/Galvin Chapter 8 9 Simple uniprogramming with a single segment per
More information