Chapter 5 Input/Output

Similar documents
I/O Devices. Chapter 5 Input/Output. Memory-Mapped I/O (2) Memory-Mapped I/O (1) Interrupts Revisited. Direct Memory Access (DMA) 11/26/2013

Long-term Information Storage Must store large amounts of data Information stored must survive the termination of the process using it Multiple proces

I/O Hardwares. Some typical device, network, and data base rates

File Systems. Todays Plan

Chap. 3. Input/Output

Chapter 4 File Systems

Chapter 6. File Systems

File Systems. File system interface (logical view) File system implementation (physical view)

Typical File Extensions File Structure

File Systems. What do we need to know?

File Systems. Todays Plan. Vera Goebel Thomas Plagemann. Department of Informatics University of Oslo

Chapter 6: File Systems

CS4500/5500 Operating Systems File Systems and Implementations

Chapter 4 File Systems. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved

File Systems. Information Server 1. Content. Motivation. Motivation. File Systems. File Systems. Files

OPERATING SYSTEMS CS136

CS510 Operating System Foundations. Jonathan Walpole

Operating systems. Lecture 7 File Systems. Narcis ILISEI, oct 2014

CS333 Intro to Operating Systems. Jonathan Walpole

CSE 380 Computer Operating Systems

Input/Output Systems Prof. James L. Frankel Harvard University

Chapter 11 I/O Management and Disk Scheduling

File Management. COMP3231 Operating Systems

Chapter 11: File-System Interface. Long-term Information Storage. File Structure. File Structure. File Concept. File Attributes

File Systems Management and Examples

CISC 7310X. C11: Mass Storage. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 4/19/2018 CUNY Brooklyn College

Disk Scheduling. Based on the slides supporting the text

I/O Design, I/O Subsystem, I/O-Handler Device Driver, Buffering, Disks, RAID January WT 2008/09

CSE380 - Operating Systems

Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. One OS function is to control devices

Disk Scheduling. Chapter 14 Based on the slides supporting the text and B.Ramamurthy s slides from Spring 2001

Implementation should be efficient. Provide an abstraction to the user. Abstraction should be useful. Ownership and permissions.

File Systems Ch 4. 1 CS 422 T W Bennet Mississippi College

Chapter 14: Mass-Storage Systems

Input/Output. Chapter 5: I/O Systems. How fast is I/O hardware? Device controllers. Memory-mapped I/O. How is memory-mapped I/O done?

File systems. Chapter 6: File Systems. Naming files. Long-term information storage. Typical file extensions. File structures

Chapter 10: Mass-Storage Systems

Chapter 14: Mass-Storage Systems. Disk Structure

Chapter 4. File Systems. Part 1

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 420, York College. November 21, 2006

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara

Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. (done)

Module 13: Secondary-Storage

File. File System Implementation. File Metadata. File System Implementation. Direct Memory Access Cont. Hardware background: Direct Memory Access

Tape pictures. CSE 30341: Operating Systems Principles

UNIT 4 Device Management

Chapter 11: File System Implementation. Objectives

File Management. COMP3231 Operating Systems

Silberschatz, et al. Topics based on Chapter 13

Input/Output. Today. Next. Principles of I/O hardware & software I/O software layers Disks. Protection & Security

File. File System Implementation. Operations. Permissions and Data Layout. Storing and Accessing File Data. Opening a File

Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. One OS function is to control devices

Module 13: Secondary-Storage Structure

File Management. COMP3231 Operating Systems. Kevin Elphinstone. Tanenbaum, Chapter 4

Chapter 12: Mass-Storage Systems. Operating System Concepts 8 th Edition,

UNIT-7. Overview of Mass Storage Structure

File systems: management 1

CSE380 - Operating Systems. Communicating with Devices

Chapter 13: Mass-Storage Systems. Disk Scheduling. Disk Scheduling (Cont.) Disk Structure FCFS. Moving-Head Disk Mechanism

Chapter 13: Mass-Storage Systems. Disk Structure

Physical Representation of Files

File system internals Tanenbaum, Chapter 4. COMP3231 Operating Systems

MASS-STORAGE STRUCTURE

Operating Systems, Fall

Chapter 12: Secondary-Storage Structure. Operating System Concepts 8 th Edition,

CHAPTER 11: IMPLEMENTING FILE SYSTEMS (COMPACT) By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

Operating Systems, Fall

File Management. Ezio Bartocci.

CS3600 SYSTEMS AND NETWORKS

CS 537 Fall 2017 Review Session

Chapter 5: Input Output Management. Slides by: Ms. Shree Jaswal

C13: Files and Directories: System s Perspective

Segmentation with Paging. Review. Segmentation with Page (MULTICS) Segmentation with Page (MULTICS) Segmentation with Page (MULTICS)

Mass Storage. 2. What are the difference between Primary storage and secondary storage devices? Primary Storage is Devices. Secondary Storage devices

Chapter 5 Input/Output. I/O Devices

12: Filesystems: The User View

Lecture 18 File Systems and their Management and Optimization

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

CSE 120. Overview. July 27, Day 8 Input/Output. Instructor: Neil Rhodes. Hardware. Hardware. Hardware

I/O, Disks, and RAID Yi Shi Fall Xi an Jiaotong University


Introduction. Secondary Storage. File concept. File attributes

Chapter 14 Mass-Storage Structure

Major Device Number specifies the device class, floppy disk, hard disk, terminal (selects device driver)

CPSC 421 Database Management Systems. Lecture 11: Storage and File Organization

I/O Management and Disk Scheduling. Chapter 11

Chapter 10: Mass-Storage Systems

Chapter 14: Mass-Storage Systems

Chapter 4 - File Systems

File System: Interface and Implmentation

Chapter 10: Mass-Storage Systems. Operating System Concepts 9 th Edition

Disk scheduling Disk reliability Tertiary storage Swap space management Linux swap space management

CS720 - Operating Systems

Chapter 12: Mass-Storage Systems. Operating System Concepts 8 th Edition

Chapter 11: Mass-Storage Systems

Secondary Storage (Chp. 5.4 disk hardware, Chp. 6 File Systems, Tanenbaum)

Chapter 12: Mass-Storage

CS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University

CS6401- Operating System QUESTION BANK UNIT-IV

Chapter 12: Mass-Storage

Transcription:

Chapter 5 Input/Output 5.1 Principles of I/O hardware 5.2 Principles of I/O software 5.3 I/O software layers 5.4 Disks 5.5 Clocks 5.6 Character-oriented terminals 5.7 Graphical user interfaces 5.8 Network terminals 5.9 Power management 1 Memory-Mapped I/O (1) Separate I/O and memory space Memory-mapped I/O Hybrid 2 1

Memory-Mapped I/O (2) (a) A single-bus architecture (b) A dual-bus memory architecture 3 Direct Memory Access (DMA) Operation of a DMA transfer 4 2

Interrupts Revisited How interrupts happens. Connections between devices and interrupt controller actually use interrupt lines on the bus rather than dedicated wires 5 Disks Disk Hardware (1) Disk parameters for the original IBM PC floppy disk and a Western Digital WD 18300 hard disk 6 3

Disk Hardware (2) Physical geometry of a disk with two zones A possible virtual geometry for this disk 7 Disk Hardware (3) Raid levels 0 through 2 Backup and parity drives are shaded 8 4

Disk Hardware (4) Raid levels 3 through 5 Backup and parity drives are shaded 9 Disk Hardware (5) Recording structure of a CD or CD-ROM 10 5

Disk Hardware (6) Logical data layout on a CD-ROM 11 Disk Hardware (7) Cross section of a CD-R disk and laser not to scale Silver CD-ROM has similar structure without dye layer with pitted aluminum layer instead of gold 12 6

Disk Hardware (8) A double sided, dual layer DVD disk 13 Disk Formatting (1) A disk sector 14 7

Disk Formatting (2) An illustration of cylinder skew 15 Disk Formatting (3) No interleaving Single interleaving Double interleaving 16 8

Disk Arm Scheduling Algorithms (1) Time required to read or write a disk block determined by 3 factors 1. Seek time 2. Rotational delay 3. Actual transfer time Seek time dominates Error checking is done by controllers 17 Disk Arm Scheduling Algorithms (2) Initial position Pending requests Shortest Seek First (SSF) disk scheduling algorithm 18 9

Disk Arm Scheduling Algorithms (3) The elevator algorithm for scheduling disk requests 19 Error Handling A disk track with a bad sector Substituting a spare for the bad sector Shifting all the sectors to bypass the bad one 20 10

Stable Storage Analysis of the influence of crashes on stable writes 21 Chapter 6 File Systems 6.1 Files 6.2 Directories 6.3 File system implementation 6.4 Example file systems 22 11

Long-term Information Storage 1. Must store large amounts of data 2. Information stored must survive the termination of the process using it 3. Multiple processes must be able to access the information concurrently 23 File Naming Typical file extensions. 24 12

File Structure Three kinds of files byte sequence record sequence tree 25 File Types (a) An executable file (b) An archive 26 13

Sequential access File Access read all bytes/records from the beginning cannot jump around, could rewind or back up convenient when medium was mag tape Random access bytes/records read in any order essential for data base systems read can be move file marker (seek), then read or read and then move file marker 27 File Attributes Possible file attributes 28 14

File Operations 1. Create 2. Delete 3. Open 4. Close 5. Read 6. Write 7. Append 8. Seek 9. Get attributes 10.Set Attributes 11.Rename 29 An Example Program Using File System Calls (1/2) 30 15

An Example Program Using File System Calls (2/2) 31 Memory-Mapped Files (a) Segmented process before mapping files into its address space (b) Process after mapping existing file DEF into one segment creating new segment for [\] 32 16

Directories Single-Level Directory Systems A single level directory system contains 4 files owned by 3 different people, A, B, and C 33 Two-level Directory Systems Letters indicate RZQHUV of the directories and files 34 17

Hierarchical Directory Systems A hierarchical directory system 35 Path Names A UNIX directory tree 36 18

Directory Operations 1. Create 2. Delete 3. Opendir 4. Closedir 5. Readdir 6. Rename 7. Link 8. Unlink 37 File System Implementation A possible file system layout 38 19

Implementing Files (1) (a) Contiguous allocation of disk space for 7 files (b) State of the disk after files ' and ( have been removed 39 Implementing Files (2) Storing a file as a linked list of disk blocks 40 20

Implementing Files (3) Linked list allocation using a file allocation table in RAM 41 Implementing Files (4) An example i-node 42 21

Implementing Directories (1) (a) A simple directory fixed size entries disk addresses and attributes in directory entry (b) Directory in which each entry just refers to an i-node 43 Implementing Directories (2) Two ways of handling long file names in directory (a) In-line (b) In a heap 44 22

Shared Files (1) File system containing a shared file 45 Shared Files (2) (a) Situation prior to linking (b) After the link is created (c)after the original owner removes the file 46 23

Disk Space Management (1) Block size Dark line (left hand scale) gives data rate of a disk Dotted line (right hand scale) gives disk space efficiency All files 2KB 47 Disk Space Management (2) (a) Storing the free list on a linked list (b) A bit map 48 24

Disk Space Management (3) (a) Almost-full block of pointers to free disk blocks in RAM - three blocks of pointers on disk (b) Result of freeing a 3-block file (c) Alternative strategy for handling 3 free blocks - shaded entries are pointers to free disk blocks 49 Disk Space Management (4) Quotas for keeping track of each user s disk use 50 25

File System Reliability (1) )LOHWKDWKDV QRWFKDQJHG A file system to be dumped squares are directories, circles are files shaded items, modified since last dump each directory & file labeled by i-node number 51 File System Reliability (2) Bit maps used by the logical dumping algorithm 52 26

File System Reliability (3) File system states (a) consistent (b) missing block (c) duplicate block in free list (d) duplicate data block 53 File System Performance (1) The block cache data structures 54 27

File System Performance (2) I-nodes placed at the start of the disk Disk divided into cylinder groups each with its own blocks and i-nodes 55 Log-Structured File Systems With CPUs faster, memory larger disk caches can also be larger increasing number of read requests can come from cache thus, most disk accesses will be writes LFS Strategy structures entire disk as a log have all writes initially buffered in memory periodically write these to the end of the disk log when file opened, locate i-node, then find blocks 56 28

Example File Systems CD-ROM File Systems The ISO 9660 directory entry 57 The CP/M File System (1) Memory layout of CP/M 58 29

The CP/M File System (2) The CP/M directory entry format 59 The MS-DOS File System (1) The MS-DOS directory entry 60 30

The MS-DOS File System (2) Maximum partition for different block sizes The empty boxes represent forbidden combinations 61 The Windows 98 File System (1) %\WHV The extended MOS-DOS directory entry used in Windows 98 62 31

The Windows 98 File System (2) Bytes Checksum An entry for (part of) a long file name in Windows 98 63 The Windows 98 File System (3) An example of how a long name is stored in Windows 98 64 32

The UNIX V7 File System (1) A UNIX V7 directory entry 65 The UNIX V7 File System (2) A UNIX i-node 66 33

The UNIX V7 File System (3) The steps in looking up XVUDVWPER[ 67 34