Multi-Process Systems: Memory (1) The Basic Memory Hierarchy. Contemporary Memory Hierarchy & Dynamic Loading. (Executable) Secondary Primary

Size: px
Start display at page:

Download "Multi-Process Systems: Memory (1) The Basic Memory Hierarchy. Contemporary Memory Hierarchy & Dynamic Loading. (Executable) Secondary Primary"

Transcription

1 Multi- Systems: (1) What we will learn A detailed description of various ways of organizing memory Discuss various memory-management techniques, including paging and segmentation To provide a description hardware support Address augmentation: Swapping Address augmentation: Virtual Background Demand Paging Page Replacement Allocation of Frames Thrashing -Mapped Files Allocating Kernel Other Considerations Operating-System Examples 2 The Basic Hierarchy CPU Registers More Frequently Used Information Primary (Execu ) e.g. RAM Less Frequently Used Information Secondary e.g. Disk or Tape Larger storage Contemporary Hierarchy & Dynamic Loading Secondary Primary (Execu) CPU Registers L1 Cache L2 Cache Main Rotating Magnetic Optical Sequentially Accessed 3 Faster access 4

2 Exploiting the Hierarchy Upward moves are (usually) copy operations Require in upper memory Image exists in both higher & lower memories Updates are first applied to upper memory Downward move is (usually) destructive Destroy image in upper memory Update image in lower memory The cache principle Place frequently-used info high, infrequently-used info low in the hierarchy Reconfigure as process changes phases 5 6 The Manager (External view) exec() shmalloc() sbrk() getrlimit() File Mgr UNIX Device Mgr Mgr Mgr Application Program Hardware File Mgr Device Mgr VirtualAlloc() VMQuery() VirtualLock() VirtualFree() Zero() Mgr Mgr Windows The Manager (Abstract / logical view) Translation system creates an, but its are virtual instead of physical A virtual, x: Is mapped to physical y = B t (x) if x is loaded at physical y Is mapped to! if x is not loaded B t : Virtual Address " Physical Address # {!} The map, B t, changes as the process executes -- it is time varying 7 8

3 The Manager (Abstract / logical view) virtual x B t! y = B t (x) Absolute Program Address Space The Manager (Internal view) Address Space User Address Space Primary 3GB 4GB Supervisor Address Space 9 1 CPU CPU chip Virtual es from CPU to MMU Physical es on bus, in memory The Manager (Hardware view) MMU Disk controller Program uses logical or virtual es Addresses local to the process Hardware translates virtual to physical Translation done by the Management Unit Usually on the same chip as the CPU Only physical es leave the CPU/MMU chip Physical memory indexed by physical es Manager Requirements Minimize execu memory access time Maximize execu memory size Execu memory must be cost-effective Today s memory manager: Allocates primary memory to processes Maps process to primary memory Minimizes access time using cost-effective memory configuration May use static or dynamic techniques 11 12

4 and multiprogramming needs at least two things for multiprogramming Allocation/Relocation strategies Protection The cannot be certain where a program will be loaded in memory s and procedures can t use absolute locations in memory Several ways to guarantee this The must keep processes memory separate Protect a process from other processes reading or modifying its own memory Protect a process from modifying its own memory in undesirable ways (such as writing to program code) 13 Augmenting organization () HW support The big picture Contiguous Swappig Virtual Non contiguous Limit & relocation Page request Page replacement Dedicated Paging Dynamic Table based Page Frame TLB Paging & Segment 14 Allocation/relocation strategies -Partition used only in batch systems -Partition used everywhere (except in virtual memory) Swapping systems Popularized in timesharing Relies on dynamic relocation Now dated Dynamic Loading (Virtual ) Exploit the memory hierarchy Paging -- mainstream in contemporary systems -- the future Protection The hw and operating system must co-operate to ensure that different processes do not modify each other s memory The hw provides special that can be read in user mode, but only modified by instructions in supervisor mode Simple solution: the physical memory is divided between processes in contiguous chunks by the and the boundsare stored in special the hardware checks every program access to ensure it is within bounds 15 16

5 Protection Virtual memory allows protection without the requirement that pages be pre-allocated in contiguous chunks Physical pages are allocated based on program needs and physical pages belonging to different processes may be adjacent efficient use of memory Each page has certain read/write properties for user/ kernel that is checked on every access a program s execu can not be modified part of kernel data cannot be modified/read by user page s can be modified by kernel and read by user Augmenting organization () HW support The big picture Non contiguous Contiguous Swappig Virtual Limit & relocation Page request Page replacement Dedicated 17 Paging Dynamic Table based Page Frame TLB Paging & Segment 18 Contiguous Allocation Main memory usually into two partitions: Resident operating system, usually held in low memory with interrupt vector User processes then held in high memory Assumes a single hunk of memory per process xffff partition HW protection: Base and limit Special CPU : base & limit Access to the limited to system mode Registers contain Base: start of the process s memory partition Limit: length of the process s memory partition Address generation y = B t (x) Physical y: location in actual memory Logical x: location from the process s point of view B t (x) = base + logical! : Logical larger than limit => error xffff 19 partition x2 Limit Base x9 Logical : x124 Physical : x124+x9 = xa24 2

6 HW protection: Runtime Bound Checking CPU Relative Address Relocation Register Limit Register < $ Interrupt Bound checking is inexpensive to add Provides excellent memory protection + MAR xffff partition Contiguous Allocation (Cont.) Multiple-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) process 5 process 8 process 2 21 process 5 process 2 process 5 process 9 process 2 process 5 process 9 process 1 process 2 22 (size) Partition mechanism Divide memory into fixed s maximum number of processes maximum process size Assign a process to a when it s free Mechanisms Separate input queues for each partition Single input queue: better ability to optimize CPU usage Partition 4 Partition 3 Partition 2 Partition 1 9K 7K 6K 5K Partition 4 Partition 3 Partition 2 Partition 1 9K 7K 6K 5K 1K 1K 23 Partition Mechanism Operating System Loader adjusts every in every absolute module when Operating System Operating System Operating System External fragmentation Compaction moves program in memory placed in memory 24

7 Partition Mechanism: the cost of moving load R1, x21 3F131 Program loaded at x1 3F161 Program loaded at x4 Must run loader over program again! Consider dynamic techniques Dynamic Allocation Could use dynamically allocated memory wants to change the size of its Smaller % Creates an external fragment Larger % May have to move/relocate the program Needs to keep track of memory usage Allocate holes (a free memory segment) in memory according to Best- /Worst- / First- /Next-fit Needs to keep track of memory usage Tracking memory usage: bitmaps Keep track of free / allocated memory regions with a bitmap One bit in map corresponds to a fixed-size region of memory Bitmap is a constant size for a given amount of memory regardless of how much is allocated at a particular time Chunk size determines efficiency At 1 bit per 4KB chunk, we need just 256 bits (32 bytes) per MB of memory For smaller chunks, we need more memory for the bitmap Can be difficult to find large contiguous free areas in bitmap A B C D Tracking memory usage: linked lists Keep track of free / allocated memory regions with a linked list Each entry in the list corresponds to a contiguous region of memory Entry can indicate either allocated or free (and, optionally, owning process) May have separate lists for free and allocated areas Efficient if chunks are large -size representation for each region More regions => more needed for free lists A B C D regions Bitmap regions A B C 17 9 D

8 Allocating memory Search through region list to find a large enough Suppose there are several choices: which one to use? First fit: the first sui hole on the list Next fit: the first sui after the previously allocated hole Best fit: the smallest hole that is larger than the desired region (wastes least?) Worst fit: the largest available hole (leaves largest fragment) Option: maintain separate queues for different-size holes Allocate 2 blocks first fit Allocate 13 blocks best fit Allocate 12 blocks next fit Allocate 15 blocks worst fit Freeing memory Allocation structures must be updated when memory is freed Easy with bitmaps: just set the appropriate bits in the bitmap Linked lists: modify adjacent elements as needed Merge adjacent free regions into a single region May involve merging two regions with the just-freed area A X B A X X X B A A B B 3 Buddy Goal: make it easy to merge regions together after Use multiple bitmaps Track blocks of size 2 d for values of d between (say) 12 and 17 Each bitmap tracks free blocks in the same region of different sizes Keep a free list for each block size as well Store one bit per two blocks Blocks paired with buddy : buddies differ in block number only in their lowest-order bit Bit == : both buddies free or both buddies allocated Bit == 1: exactly one of the buddies is allocated, and the other is free Fragmentation External Fragmentation total memory exists to satisfy a request, but it is not contiguous Internal Fragmentation allocated memory may be slightly larger than requested memory; this size difference is memory internal to a partition, but not being used Reduce external fragmentation by compaction Shuffle memory contents to place all free memory together in one large block Compaction is possible only if relocation is dynamic, and is done at execution time I/O problem Latch job in memory while it is involved in I/O Do I/O only into buffers 31 32

9 Augmenting organization () HW support The big picture Non contiguous Contiguous Swappig Virtual Limit & relocation Page request Page replacement Dedicated Paging Dynamic Table based Page Frame TLB Paging & Segment Paging Logical of a process can be non contiguous; process is allocated physical memory whenever the latter is available Divide physical memory into fixed-sized blocks called frames (size is power of 2, between 512 bytes and 8,192 bytes) Divide logical memory into blocks of same size called pages Keep track of all free frames To run a program of size n pages, need to find n free frames and load program y = B t (x) : Set up a page to translate logical to physical es Internal fragmentation Paging and page s Virtual es mapped to physical es All es in the same virtual page are in the same physical page Page entry (PTE) contains translation for a single page Table translates virtual page number to physical page number Not all virtual memory has a physical page Not every physical page need be used Example: 64 KB virtual memory 32 KB physical memory 6 64K 56 6K K 48 52K K K K 32 36K K K 2 24K K 12 16K 8 12K - 4 8K 4 4K 7 Virtual 28 32K 24 28K 2 24K 16 2K 12 16K 8 12K 4 8K 4K Physical memory What s in a page entry? Each entry in the page contains Valid bit: set if this logical page number has a corresponding physical frame in memory If not valid, remainder of PTE is irrelevant Page frame number: page in physical memory Referenced (Used) bit: set if data on the page has been accessed Dirty (modified) bit :set if data on the page has been modified Protection information Protection Dirty bit D R V Referenced or Used bit Page frame number Valid bit 35 36

10 Paging model A page is a fixed size, 2 h, block of virtual es A page frame is a fixed size, 2 h, block of physical memory (the same size as a page) When a virtual, x, in page i is referenced by the CPU If page i is loaded at page frame j, the virtual is relocated to page frame j If page is not loaded, the interrupts the process and loads the page into a page frame Paging model : Addresses Suppose there are G= 2 g &2 h =2 g+h virtual es H= 2 j &2 h =2 j+h physical es assigned to a process Each page/page frame is 2 h es There are 2 g pages in the virtual 2 j page frames are allocated to the process Rather than map individual es B t maps the 2 g pages to the 2 j page frames That is, page_frame j = B t (page i ) Address k in page i corresponds to k in page_frame j Example How many entries would there be in a process page in a system with 32-bit es and a 1K page size? 1K= 124=2 1 =2 h, h=1 G=2 32 N= 2 g = G/2 h = 2 32 / 2 1 = 2 22 g=22 N=2 12!2 1 = 496K or over 4 million. Paging model: Address Translation Let N = {d, d 1, d n-1 } be the pages Let M = {b, b 1,, b m-1 } be page frames Virtual i, satisfies 'i<g= 2 g+h Physical k = U2 h +V ('V<G= 2 h ) U is page frame number V is the line number within the page B t :[:G-1] " <U, V> # {!} Since every page is size c=2 h page number = U = (i/2 h ) = (i/c) line number = V = i mod c 4

11 // // // TranslateUserToSystem // //!Translate a user (in the process referenced by pcb) //!into an (physical). This works for simple one-level //!page s, but will have to be modified for two-level page //!s. // // uint32 TranslateUserToSystem (PCB *pcb, uint32 addr) { int! page = addr / MEMORY_PAGE_SIZE; int offset = addr % MEMORY_PAGE_SIZE; } Address Translation with Paging if (page > pcb->npages) { return (); } return ((pcb->page[page] & MEMORY_PTE_MASK) + offset); U = (i/2 h ) V = i mod (i/2 h ) Example: translation Split from CPU into two pieces Page # (p) Page offset (d) Page number Index into page Page contains base of page in physical memory Page offset Added to base to get actual physical memory Page size = 2 h bytes Example: 4 KB (=496 byte) pages 32 bit logical es 2 h = 496 h = 12 g=32-12 = 2 bits p 12 bits d 32 bit logical 41 Operating Systems and 42Distributed Systems Address translation architecture page number page offset (=line) Page frame number Page frame number CPU p d 1 p-1 p p+1. f page f d physical. memory f-1 f f+1 f+2

OPERATING SYSTEM - MEMORY MANAGEMENT

OPERATING SYSTEM - MEMORY MANAGEMENT OPERATING SYSTEM - MEMORY MANAGEMENT http://www.tutorialspoint.com/operating_system/os_memory_management.htm Copyright tutorialspoint.com Memory management is the functionality of an operating system which

More information

Chapter 7 Memory Management

Chapter 7 Memory Management Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 7 Memory Management Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall Memory Management Subdividing

More information

Memory Management Outline. Background Swapping Contiguous Memory Allocation Paging Segmentation Segmented Paging

Memory Management Outline. Background Swapping Contiguous Memory Allocation Paging Segmentation Segmented Paging Memory Management Outline Background Swapping Contiguous Memory Allocation Paging Segmentation Segmented Paging 1 Background Memory is a large array of bytes memory and registers are only storage CPU can

More information

Chapter 7 Memory Management

Chapter 7 Memory Management Operating Systems: Internals and Design Principles Chapter 7 Memory Management Eighth Edition William Stallings Frame Page Segment A fixed-length block of main memory. A fixed-length block of data that

More information

Operating Systems, 6 th ed. Test Bank Chapter 7

Operating Systems, 6 th ed. Test Bank Chapter 7 True / False Questions: Chapter 7 Memory Management 1. T / F In a multiprogramming system, main memory is divided into multiple sections: one for the operating system (resident monitor, kernel) and one

More information

Memory management basics (1) Requirements (1) Objectives. Operating Systems Part of E1.9 - Principles of Computers and Software Engineering

Memory management basics (1) Requirements (1) Objectives. Operating Systems Part of E1.9 - Principles of Computers and Software Engineering Memory management basics (1) Requirements (1) Operating Systems Part of E1.9 - Principles of Computers and Software Engineering Lecture 7: Memory Management I Memory management intends to satisfy the following

More information

Memory management. Chapter 4: Memory Management. Memory hierarchy. In an ideal world. Basic memory management. Fixed partitions: multiple programs

Memory management. Chapter 4: Memory Management. Memory hierarchy. In an ideal world. Basic memory management. Fixed partitions: multiple programs Memory management Chater : Memory Management Part : Mechanisms for Managing Memory asic management Swaing Virtual Page relacement algorithms Modeling age relacement algorithms Design issues for aging systems

More information

The Deadlock Problem. Deadlocks. Deadlocks. Bridge Crossing Example

The Deadlock Problem. Deadlocks. Deadlocks. Bridge Crossing Example The Deadlock Problem Deadlocks A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set. Example System has 2 tape drives. P 1 and P 2 each

More information

CS 61C: Great Ideas in Computer Architecture Virtual Memory Cont.

CS 61C: Great Ideas in Computer Architecture Virtual Memory Cont. CS 61C: Great Ideas in Computer Architecture Virtual Memory Cont. Instructors: Vladimir Stojanovic & Nicholas Weaver http://inst.eecs.berkeley.edu/~cs61c/ 1 Bare 5-Stage Pipeline Physical Address PC Inst.

More information

CS5460: Operating Systems

CS5460: Operating Systems CS5460: Operating Systems Lecture 13: Memory Management (Chapter 8) Where are we? Basic OS structure, HW/SW interface, interrupts, scheduling Concurrency Memory management Storage management Other topics

More information

Virtual vs Physical Addresses

Virtual vs Physical Addresses Virtual vs Physical Addresses Physical addresses refer to hardware addresses of physical memory. Virtual addresses refer to the virtual store viewed by the process. virtual addresses might be the same

More information

& Data Processing 2. Exercise 3: Memory Management. Dipl.-Ing. Bogdan Marin. Universität Duisburg-Essen

& Data Processing 2. Exercise 3: Memory Management. Dipl.-Ing. Bogdan Marin. Universität Duisburg-Essen Folie a: Name & Data Processing 2 3: Memory Management Dipl.-Ing. Bogdan Marin Fakultät für Ingenieurwissenschaften Abteilung Elektro-und Informationstechnik -Technische Informatik- Objectives Memory Management

More information

Secondary Storage. Any modern computer system will incorporate (at least) two levels of storage: magnetic disk/optical devices/tape systems

Secondary Storage. Any modern computer system will incorporate (at least) two levels of storage: magnetic disk/optical devices/tape systems 1 Any modern computer system will incorporate (at least) two levels of storage: primary storage: typical capacity cost per MB $3. typical access time burst transfer rate?? secondary storage: typical capacity

More information

OPERATING SYSTEMS MEMORY MANAGEMENT

OPERATING SYSTEMS MEMORY MANAGEMENT OPERATING SYSTEMS MEMORY MANAGEMENT Jerry Breecher 8: Memory Management 1 OPERATING SYSTEM Memory Management What Is In This Chapter? Just as processes share the CPU, they also share physical memory. This

More information

Operating Systems. Virtual Memory

Operating Systems. Virtual Memory Operating Systems Virtual Memory Virtual Memory Topics. Memory Hierarchy. Why Virtual Memory. Virtual Memory Issues. Virtual Memory Solutions. Locality of Reference. Virtual Memory with Segmentation. Page

More information

Memory unit sees only the addresses, and not how they are generated (instruction counter, indexing, direct)

Memory unit sees only the addresses, and not how they are generated (instruction counter, indexing, direct) Memory Management 55 Memory Management Multitasking without memory management is like having a party in a closet. Charles Petzold. Programming Windows 3.1 Programs expand to fill the memory that holds

More information

Chapter 2: Computer-System Structures. Computer System Operation Storage Structure Storage Hierarchy Hardware Protection General System Architecture

Chapter 2: Computer-System Structures. Computer System Operation Storage Structure Storage Hierarchy Hardware Protection General System Architecture Chapter 2: Computer-System Structures Computer System Operation Storage Structure Storage Hierarchy Hardware Protection General System Architecture Operating System Concepts 2.1 Computer-System Architecture

More information

COS 318: Operating Systems. Virtual Memory and Address Translation

COS 318: Operating Systems. Virtual Memory and Address Translation COS 318: Operating Systems Virtual Memory and Address Translation Today s Topics Midterm Results Virtual Memory Virtualization Protection Address Translation Base and bound Segmentation Paging Translation

More information

Virtual Memory. Virtual Memory. Paging. CSE 380 Computer Operating Systems. Paging (1)

Virtual Memory. Virtual Memory. Paging. CSE 380 Computer Operating Systems. Paging (1) Virtual Memory CSE 380 Computer Operating Systems Instructor: Insup Lee University of Pennsylvania Fall 2003 Lecture Note: Virtual Memory (revised version) 1 Recall: memory allocation with variable partitions

More information

The Linux Virtual Filesystem

The Linux Virtual Filesystem Lecture Overview Linux filesystem Linux virtual filesystem (VFS) overview Common file model Superblock, inode, file, dentry Object-oriented Ext2 filesystem Disk data structures Superblock, block group,

More information

Chapter 12 File Management. Roadmap

Chapter 12 File Management. Roadmap Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 12 File Management Dave Bremer Otago Polytechnic, N.Z. 2008, Prentice Hall Overview Roadmap File organisation and Access

More information

Chapter 12 File Management

Chapter 12 File Management Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 12 File Management Dave Bremer Otago Polytechnic, N.Z. 2008, Prentice Hall Roadmap Overview File organisation and Access

More information

1 File Management. 1.1 Naming. COMP 242 Class Notes Section 6: File Management

1 File Management. 1.1 Naming. COMP 242 Class Notes Section 6: File Management COMP 242 Class Notes Section 6: File Management 1 File Management We shall now examine how an operating system provides file management. We shall define a file to be a collection of permanent data with

More information

361 Computer Architecture Lecture 14: Cache Memory

361 Computer Architecture Lecture 14: Cache Memory 1 361 Computer Architecture Lecture 14 Memory cache.1 The Motivation for s Memory System Processor DRAM Motivation Large memories (DRAM) are slow Small memories (SRAM) are fast Make the average access

More information

W4118: segmentation and paging. Instructor: Junfeng Yang

W4118: segmentation and paging. Instructor: Junfeng Yang W4118: segmentation and paging Instructor: Junfeng Yang Outline Memory management goals Segmentation Paging TLB 1 Uni- v.s. multi-programming Simple uniprogramming with a single segment per process Uniprogramming

More information

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 412, University of Maryland. Guest lecturer: David Hovemeyer.

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 412, University of Maryland. Guest lecturer: David Hovemeyer. Guest lecturer: David Hovemeyer November 15, 2004 The memory hierarchy Red = Level Access time Capacity Features Registers nanoseconds 100s of bytes fixed Cache nanoseconds 1-2 MB fixed RAM nanoseconds

More information

Two Parts. Filesystem Interface. Filesystem design. Interface the user sees. Implementing the interface

Two Parts. Filesystem Interface. Filesystem design. Interface the user sees. Implementing the interface File Management Two Parts Filesystem Interface Interface the user sees Organization of the files as seen by the user Operations defined on files Properties that can be read/modified Filesystem design Implementing

More information

Computer-System Architecture

Computer-System Architecture Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection General System Architecture 2.1 Computer-System Architecture 2.2 Computer-System

More information

Operating Systems CSE 410, Spring 2004. File Management. Stephen Wagner Michigan State University

Operating Systems CSE 410, Spring 2004. File Management. Stephen Wagner Michigan State University Operating Systems CSE 410, Spring 2004 File Management Stephen Wagner Michigan State University File Management File management system has traditionally been considered part of the operating system. Applications

More information

Memory Management CS 217. Two programs can t control all of memory simultaneously

Memory Management CS 217. Two programs can t control all of memory simultaneously Memory Management CS 217 Memory Management Problem 1: Two programs can t control all of memory simultaneously Problem 2: One program shouldn t be allowed to access/change the memory of another program

More information

Chapter 12. Paging an Virtual Memory Systems

Chapter 12. Paging an Virtual Memory Systems Chapter 12 Paging an Virtual Memory Systems Paging & Virtual Memory Virtual Memory - giving the illusion of more physical memory than there really is (via demand paging) Pure Paging - The total program

More information

Virtual Machines. COMP 3361: Operating Systems I Winter 2015 http://www.cs.du.edu/3361

Virtual Machines. COMP 3361: Operating Systems I Winter 2015 http://www.cs.du.edu/3361 s COMP 3361: Operating Systems I Winter 2015 http://www.cs.du.edu/3361 1 Virtualization! Create illusion of multiple machines on the same physical hardware! Single computer hosts multiple virtual machines

More information

File Systems Management and Examples

File Systems Management and Examples File Systems Management and Examples Today! Efficiency, performance, recovery! Examples Next! Distributed systems Disk space management! Once decided to store a file as sequence of blocks What s the size

More information

The Classical Architecture. Storage 1 / 36

The Classical Architecture. Storage 1 / 36 1 / 36 The Problem Application Data? Filesystem Logical Drive Physical Drive 2 / 36 Requirements There are different classes of requirements: Data Independence application is shielded from physical storage

More information

Chapter 2: OS Overview

Chapter 2: OS Overview Chapter 2: OS Overview CmSc 335 Operating Systems 1. Operating system objectives and functions Operating systems control and support the usage of computer systems. a. usage users of a computer system:

More information

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems Lecture Outline Operating Systems Objectives Describe the functions and layers of an operating system List the resources allocated by the operating system and describe the allocation process Explain how

More information

Memory Management 1. Memory Management. Multitasking without memory management is like having a party in a closet.

Memory Management 1. Memory Management. Multitasking without memory management is like having a party in a closet. Memory Management 1 Memory Management Multitasking without memory management is like having a party in a closet. Charles Petzold. Programming Windows 3.1 Programs expand to fill the memory that holds them.

More information

Chapter 11 I/O Management and Disk Scheduling

Chapter 11 I/O Management and Disk Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 11 I/O Management and Disk Scheduling Dave Bremer Otago Polytechnic, NZ 2008, Prentice Hall I/O Devices Roadmap Organization

More information

File-System Implementation

File-System Implementation File-System Implementation 11 CHAPTER In this chapter we discuss various methods for storing information on secondary storage. The basic issues are device directory, free space management, and space allocation

More information

Chapter 12 File Management

Chapter 12 File Management Operating Systems: Internals and Design Principles Chapter 12 File Management Eighth Edition By William Stallings Files Data collections created by users The File System is one of the most important parts

More information

Record Storage and Primary File Organization

Record Storage and Primary File Organization Record Storage and Primary File Organization 1 C H A P T E R 4 Contents Introduction Secondary Storage Devices Buffering of Blocks Placing File Records on Disk Operations on Files Files of Unordered Records

More information

OPERATING SYSTEM - VIRTUAL MEMORY

OPERATING SYSTEM - VIRTUAL MEMORY OPERATING SYSTEM - VIRTUAL MEMORY http://www.tutorialspoint.com/operating_system/os_virtual_memory.htm Copyright tutorialspoint.com A computer can address more memory than the amount physically installed

More information

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study CS 377: Operating Systems Lecture 25 - Linux Case Study Guest Lecturer: Tim Wood Outline Linux History Design Principles System Overview Process Scheduling Memory Management File Systems A review of what

More information

How To Write A Page Table

How To Write A Page Table 12 Paging: Introduction Remember our goal: to virtualize memory. Segmentation (a generalization of dynamic relocation) helped us do this, but has some problems; in particular, managing free space becomes

More information

Memory Allocation. Static Allocation. Dynamic Allocation. Memory Management. Dynamic Allocation. Dynamic Storage Allocation

Memory Allocation. Static Allocation. Dynamic Allocation. Memory Management. Dynamic Allocation. Dynamic Storage Allocation Dynamic Storage Allocation CS 44 Operating Systems Fall 5 Presented By Vibha Prasad Memory Allocation Static Allocation (fixed in size) Sometimes we create data structures that are fixed and don t need

More information

Lesson Objectives. To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization

Lesson Objectives. To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization Lesson Objectives To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization AE3B33OSD Lesson 1 / Page 2 What is an Operating System? A

More information

Lecture 17: Virtual Memory II. Goals of virtual memory

Lecture 17: Virtual Memory II. Goals of virtual memory Lecture 17: Virtual Memory II Last Lecture: Introduction to virtual memory Today Review and continue virtual memory discussion Lecture 17 1 Goals of virtual memory Make it appear as if each process has:

More information

Technical Properties. Mobile Operating Systems. Overview Concepts of Mobile. Functions Processes. Lecture 11. Memory Management.

Technical Properties. Mobile Operating Systems. Overview Concepts of Mobile. Functions Processes. Lecture 11. Memory Management. Overview Concepts of Mobile Operating Systems Lecture 11 Concepts of Mobile Operating Systems Mobile Business I (WS 2007/08) Prof Dr Kai Rannenberg Chair of Mobile Business and Multilateral Security Johann

More information

Operating System Tutorial

Operating System Tutorial Operating System Tutorial OPERATING SYSTEM TUTORIAL Simply Easy Learning by tutorialspoint.com tutorialspoint.com i ABOUT THE TUTORIAL Operating System Tutorial An operating system (OS) is a collection

More information

Chapter 11: File System Implementation. Operating System Concepts with Java 8 th Edition

Chapter 11: File System Implementation. Operating System Concepts with Java 8 th Edition Chapter 11: File System Implementation 11.1 Silberschatz, Galvin and Gagne 2009 Chapter 11: File System Implementation File-System Structure File-System Implementation Directory Implementation Allocation

More information

1. Computer System Structure and Components

1. Computer System Structure and Components 1 Computer System Structure and Components Computer System Layers Various Computer Programs OS System Calls (eg, fork, execv, write, etc) KERNEL/Behavior or CPU Device Drivers Device Controllers Devices

More information

PC Boot Considerations for Devices >8GB

PC Boot Considerations for Devices >8GB X3T10 95-321 Rev 1 PC Boot Considerations for Devices >8GB Overview This is a draft of a document proposed in the System Issues Study Group meeting held on 7/12/95 in Colorado Springs. It is intended to

More information

Chapter 10: Virtual Memory. Lesson 03: Page tables and address translation process using page tables

Chapter 10: Virtual Memory. Lesson 03: Page tables and address translation process using page tables Chapter 10: Virtual Memory Lesson 03: Page tables and address translation process using page tables Objective Understand page tables Learn the offset fields in the virtual and physical addresses Understand

More information

Computer Architecture

Computer Architecture Computer Architecture Slide Sets WS 2013/2014 Prof. Dr. Uwe Brinkschulte M.Sc. Benjamin Betting Part 11 Memory Management Computer Architecture Part 11 page 1 of 44 Prof. Dr. Uwe Brinkschulte, M.Sc. Benjamin

More information

Filing Systems. Filing Systems

Filing Systems. Filing Systems Filing Systems At the outset we identified long-term storage as desirable characteristic of an OS. EG: On-line storage for an MIS. Convenience of not having to re-write programs. Sharing of data in an

More information

Operating System Concepts. Operating System 資 訊 工 程 學 系 袁 賢 銘 老 師

Operating System Concepts. Operating System 資 訊 工 程 學 系 袁 賢 銘 老 師 Lecture 6: Secondary Storage Systems Moving-head Disk Mechanism 6.2 Overview of Mass-Storage Structure Magnetic disks provide bulk of secondary storage of modern computers Drives rotate at 60 to 200 times

More information

Chapter 12: Secondary-Storage Structure

Chapter 12: Secondary-Storage Structure Chapter 12: Secondary-Storage Structure Chapter 12: Secondary-Storage Structure Overview of Mass Storage Structure Disk Structure Disk Attachment Disk Scheduling Disk Management Swap-Space Management RAID

More information

With respect to the way of data access we can classify memories as:

With respect to the way of data access we can classify memories as: Memory Classification With respect to the way of data access we can classify memories as: - random access memories (RAM), - sequentially accessible memory (SAM), - direct access memory (DAM), - contents

More information

SAP HANA - Main Memory Technology: A Challenge for Development of Business Applications. Jürgen Primsch, SAP AG July 2011

SAP HANA - Main Memory Technology: A Challenge for Development of Business Applications. Jürgen Primsch, SAP AG July 2011 SAP HANA - Main Memory Technology: A Challenge for Development of Business Applications Jürgen Primsch, SAP AG July 2011 Why In-Memory? Information at the Speed of Thought Imagine access to business data,

More information

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan Chapter 2 Basic Structure of Computers Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan Outline Functional Units Basic Operational Concepts Bus Structures Software

More information

Linux Driver Devices. Why, When, Which, How?

Linux Driver Devices. Why, When, Which, How? Bertrand Mermet Sylvain Ract Linux Driver Devices. Why, When, Which, How? Since its creation in the early 1990 s Linux has been installed on millions of computers or embedded systems. These systems may

More information

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note: Chapter 7 OBJECTIVES Operating Systems Define the purpose and functions of an operating system. Understand the components of an operating system. Understand the concept of virtual memory. Understand the

More information

Outline: Operating Systems

Outline: Operating Systems Outline: Operating Systems What is an OS OS Functions Multitasking Virtual Memory File Systems Window systems PC Operating System Wars: Windows vs. Linux 1 Operating System provides a way to boot (start)

More information

File Management. Chapter 12

File Management. Chapter 12 Chapter 12 File Management File is the basic element of most of the applications, since the input to an application, as well as its output, is usually a file. They also typically outlive the execution

More information

Chapter 1 Computer System Overview

Chapter 1 Computer System Overview Operating Systems: Internals and Design Principles Chapter 1 Computer System Overview Eighth Edition By William Stallings Operating System Exploits the hardware resources of one or more processors Provides

More information

Intel P6 Systemprogrammering 2007 Föreläsning 5 P6/Linux Memory System

Intel P6 Systemprogrammering 2007 Föreläsning 5 P6/Linux Memory System Intel P6 Systemprogrammering 07 Föreläsning 5 P6/Linux ory System Topics P6 address translation Linux memory management Linux page fault handling memory mapping Internal Designation for Successor to Pentium

More information

The Quest for Speed - Memory. Cache Memory. A Solution: Memory Hierarchy. Memory Hierarchy

The Quest for Speed - Memory. Cache Memory. A Solution: Memory Hierarchy. Memory Hierarchy The Quest for Speed - Memory Cache Memory CSE 4, Spring 25 Computer Systems http://www.cs.washington.edu/4 If all memory accesses (IF/lw/sw) accessed main memory, programs would run 20 times slower And

More information

Solid State Drive Architecture

Solid State Drive Architecture Solid State Drive Architecture A comparison and evaluation of data storage mediums Tyler Thierolf Justin Uriarte Outline Introduction Storage Device as Limiting Factor Terminology Internals Interface Architecture

More information

W4118 Operating Systems. Instructor: Junfeng Yang

W4118 Operating Systems. Instructor: Junfeng Yang W4118 Operating Systems Instructor: Junfeng Yang Outline x86 segmentation and paging hardware Linux address space translation Copy-on-write Linux page replacement algorithm Linux dynamic memory allocation

More information

Origins of Operating Systems OS/360. Martin Grund HPI

Origins of Operating Systems OS/360. Martin Grund HPI Origins of Operating Systems OS/360 HPI Table of Contents IBM System 360 Functional Structure of OS/360 Virtual Machine Time Sharing 2 Welcome to Big Blue 3 IBM System 360 In 1964 IBM announced the IBM-360

More information

Virtual Memory. How is it possible for each process to have contiguous addresses and so many of them? A System Using Virtual Addressing

Virtual Memory. How is it possible for each process to have contiguous addresses and so many of them? A System Using Virtual Addressing How is it possible for each process to have contiguous addresses and so many of them? Computer Systems Organization (Spring ) CSCI-UA, Section Instructor: Joanna Klukowska Teaching Assistants: Paige Connelly

More information

Introduction. What is an Operating System?

Introduction. What is an Operating System? Introduction What is an Operating System? 1 What is an Operating System? 2 Why is an Operating System Needed? 3 How Did They Develop? Historical Approach Affect of Architecture 4 Efficient Utilization

More information

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines Operating System Concepts 3.1 Common System Components

More information

Database 2 Lecture I. Alessandro Artale

Database 2 Lecture I. Alessandro Artale Free University of Bolzano Database 2. Lecture I, 2003/2004 A.Artale (1) Database 2 Lecture I Alessandro Artale Faculty of Computer Science Free University of Bolzano Room: 221 artale@inf.unibz.it http://www.inf.unibz.it/

More information

File Management. Chapter 12

File Management. Chapter 12 File Management Chapter 12 File Management File management system is considered part of the operating system Input to applications is by means of a file Output is saved in a file for long-term storage

More information

CS 6290 I/O and Storage. Milos Prvulovic

CS 6290 I/O and Storage. Milos Prvulovic CS 6290 I/O and Storage Milos Prvulovic Storage Systems I/O performance (bandwidth, latency) Bandwidth improving, but not as fast as CPU Latency improving very slowly Consequently, by Amdahl s Law: fraction

More information

COS 318: Operating Systems. File Layout and Directories. Topics. File System Components. Steps to Open A File

COS 318: Operating Systems. File Layout and Directories. Topics. File System Components. Steps to Open A File Topics COS 318: Operating Systems File Layout and Directories File system structure Disk allocation and i-nodes Directory and link implementations Physical layout for performance 2 File System Components

More information

Chapter 3 Operating-System Structures

Chapter 3 Operating-System Structures Contents 1. Introduction 2. Computer-System Structures 3. Operating-System Structures 4. Processes 5. Threads 6. CPU Scheduling 7. Process Synchronization 8. Deadlocks 9. Memory Management 10. Virtual

More information

Topics in Computer System Performance and Reliability: Storage Systems!

Topics in Computer System Performance and Reliability: Storage Systems! CSC 2233: Topics in Computer System Performance and Reliability: Storage Systems! Note: some of the slides in today s lecture are borrowed from a course taught by Greg Ganger and Garth Gibson at Carnegie

More information

COS 318: Operating Systems

COS 318: Operating Systems COS 318: Operating Systems File Performance and Reliability Andy Bavier Computer Science Department Princeton University http://www.cs.princeton.edu/courses/archive/fall10/cos318/ Topics File buffer cache

More information

Computer Organization and Architecture. Characteristics of Memory Systems. Chapter 4 Cache Memory. Location CPU Registers and control unit memory

Computer Organization and Architecture. Characteristics of Memory Systems. Chapter 4 Cache Memory. Location CPU Registers and control unit memory Computer Organization and Architecture Chapter 4 Cache Memory Characteristics of Memory Systems Note: Appendix 4A will not be covered in class, but the material is interesting reading and may be used in

More information

6. Storage and File Structures

6. Storage and File Structures ECS-165A WQ 11 110 6. Storage and File Structures Goals Understand the basic concepts underlying different storage media, buffer management, files structures, and organization of records in files. Contents

More information

Main Memory & Backing Store. Main memory backing storage devices

Main Memory & Backing Store. Main memory backing storage devices Main Memory & Backing Store Main memory backing storage devices 1 Introduction computers store programs & data in two different ways: nmain memory ntemporarily stores programs & data that are being processed

More information

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

COMPUTER HARDWARE. Input- Output and Communication Memory Systems COMPUTER HARDWARE Input- Output and Communication Memory Systems Computer I/O I/O devices commonly found in Computer systems Keyboards Displays Printers Magnetic Drives Compact disk read only memory (CD-ROM)

More information

Chapter 11: File System Implementation. Chapter 11: File System Implementation. Objectives. File-System Structure

Chapter 11: File System Implementation. Chapter 11: File System Implementation. Objectives. File-System Structure Chapter 11: File System Implementation Chapter 11: File System Implementation File-System Structure File-System Implementation Directory Implementation Allocation Methods Free-Space Management Efficiency

More information

Chapter 3: Operating-System Structures. Common System Components

Chapter 3: Operating-System Structures. Common System Components Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System Design and Implementation System Generation 3.1

More information

File System & Device Drive. Overview of Mass Storage Structure. Moving head Disk Mechanism. HDD Pictures 11/13/2014. CS341: Operating System

File System & Device Drive. Overview of Mass Storage Structure. Moving head Disk Mechanism. HDD Pictures 11/13/2014. CS341: Operating System CS341: Operating System Lect 36: 1 st Nov 2014 Dr. A. Sahu Dept of Comp. Sc. & Engg. Indian Institute of Technology Guwahati File System & Device Drive Mass Storage Disk Structure Disk Arm Scheduling RAID

More information

File System Management

File System Management Lecture 7: Storage Management File System Management Contents Non volatile memory Tape, HDD, SSD Files & File System Interface Directories & their Organization File System Implementation Disk Space Allocation

More information

INTRODUCTION The collection of data that makes up a computerized database must be stored physically on some computer storage medium.

INTRODUCTION The collection of data that makes up a computerized database must be stored physically on some computer storage medium. Chapter 4: Record Storage and Primary File Organization 1 Record Storage and Primary File Organization INTRODUCTION The collection of data that makes up a computerized database must be stored physically

More information

COS 318: Operating Systems. I/O Device and Drivers. Input and Output. Definitions and General Method. Revisit Hardware

COS 318: Operating Systems. I/O Device and Drivers. Input and Output. Definitions and General Method. Revisit Hardware COS 318: Operating Systems I/O and Drivers Input and Output A computer s job is to process data Computation (, cache, and memory) Move data into and out of a system (between I/O devices and memory) Challenges

More information

POSIX. RTOSes Part I. POSIX Versions. POSIX Versions (2)

POSIX. RTOSes Part I. POSIX Versions. POSIX Versions (2) RTOSes Part I Christopher Kenna September 24, 2010 POSIX Portable Operating System for UnIX Application portability at source-code level POSIX Family formally known as IEEE 1003 Originally 17 separate

More information

Tech Application Chapter 3 STUDY GUIDE

Tech Application Chapter 3 STUDY GUIDE Name: Class: Date: Tech Application Chapter 3 STUDY GUIDE Multiple Choice Identify the letter of the choice that best completes the statement or answers the question. 1. This type of device retains data

More information

Hardware Assisted Virtualization

Hardware Assisted Virtualization Hardware Assisted Virtualization G. Lettieri 21 Oct. 2015 1 Introduction In the hardware-assisted virtualization technique we try to execute the instructions of the target machine directly on the host

More information

Segmentation and Fragmentation

Segmentation and Fragmentation Segmentation and Fragmentation Operating System Design MOSIG 1 Instructor: Arnaud Legrand Class Assistants: Benjamin Negrevergne, Sascha Hunold September 16, 2010 A. Legrand Segmentation and Fragmentation

More information

OPTIMIZING VIRTUAL TAPE PERFORMANCE: IMPROVING EFFICIENCY WITH DISK STORAGE SYSTEMS

OPTIMIZING VIRTUAL TAPE PERFORMANCE: IMPROVING EFFICIENCY WITH DISK STORAGE SYSTEMS W H I T E P A P E R OPTIMIZING VIRTUAL TAPE PERFORMANCE: IMPROVING EFFICIENCY WITH DISK STORAGE SYSTEMS By: David J. Cuddihy Principal Engineer Embedded Software Group June, 2007 155 CrossPoint Parkway

More information

Scheduling. Yücel Saygın. These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum

Scheduling. Yücel Saygın. These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum Scheduling Yücel Saygın These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum 1 Scheduling Introduction to Scheduling (1) Bursts of CPU usage alternate with periods

More information

Operating system Dr. Shroouq J.

Operating system Dr. Shroouq J. 3 OPERATING SYSTEM STRUCTURES An operating system provides the environment within which programs are executed. The design of a new operating system is a major task. The goals of the system must be well

More information

How To Understand The History Of An Operating System

How To Understand The History Of An Operating System 7 Operating Systems 7.1 Source: Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: 7.2 Understand the role of the operating system.

More information

High-Performance Processing of Large Data Sets via Memory Mapping A Case Study in R and C++

High-Performance Processing of Large Data Sets via Memory Mapping A Case Study in R and C++ High-Performance Processing of Large Data Sets via Memory Mapping A Case Study in R and C++ Daniel Adler, Jens Oelschlägel, Oleg Nenadic, Walter Zucchini Georg-August University Göttingen, Germany - Research

More information