Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPSC 457 Operating Systems

Similar presentations


Presentation on theme: "CPSC 457 Operating Systems"— Presentation transcript:

1 CPSC 457 Operating Systems
Lecture 12 Devices and File Systems

2 Last Time Deadlocks Resource Allocation Detecting Deadlocks
Resolving Deadlocks CPSC Tyson Kendon 2016

3 This Time Devices File Systems Hosts and Controllers I/O Drivers
File System Interface Directory Structures File System Implementation File Meta Data File Allocation CPSC Tyson Kendon 2016

4 Devices CPSC Tyson Kendon 2016

5 Devices and Hardware Host the CPU / Memory and OS, ”the computer”
Controller the electronics and logic that operate the device, port or bus CPSC Tyson Kendon 2016

6 Communication with Devices
Registers Data – In / Out Control – Status (what is the device doing) - Control (what to do) CPSC Tyson Kendon 2016

7 Drivers Interface Define how a type of device should behave Driver
Write the software to conform the device to the interface the OS expects CPSC Tyson Kendon 2016

8 Device Characteristics
aspect variation example Data-transfer mode Character block Terminal disk Access method Sequential random Modem DVD Transfer schedule Synchronous asynchronous Tape keyboard sharing Dedicated shareable CPSC Tyson Kendon 2016

9 Device Characteristics (2)
Device speed Latency Seek time Transfer rate Delay between ops Electronic? - memory Physical? - disk Mechanical? – tape-robot I/O direction Read-only Write-only read-write DVD Graphics controller disk CPSC Tyson Kendon 2016

10 Working with Controllers
Registers Keep registers available to pass data can control between host and controller Memory Mapped I/O Map information from/for the controller directly into virtual memory CPSC Tyson Kendon 2016

11 Controlling Controllers
Polling OS Loops and waits for the device to work Interrupts Device does its work and interrupts the host Direct Memory Access Device moves a lot of memory then interrupts CPSC Tyson Kendon 2016

12 Device Interactions Block Character Socket Asynchronous
CPSC Tyson Kendon 2016

13 Devices and the Kernel Scheduling Buffering Caching Spooling Error Handling CPSC Tyson Kendon 2016

14 File System Interface CPSC Tyson Kendon 2016

15 File System Interface How do we think about files? How do we organize files? How do we work with files? What to we track about files CPSC Tyson Kendon 2016

16 Directories Logical Construct to organize information Link the logical to the physical Tree Structures – not graphs CPSC Tyson Kendon 2016

17 File System Implementation
CPSC Tyson Kendon 2016

18 File System Structure Layered – abstract to specific Applications Logical File System File Organization Module Basic File System Disk Drivers CPSC Tyson Kendon 2016

19 File System Data – on Disk
Boot Control Block (per volume) Volume Control Block (per volume) Directory Structure (per volume) File Control Block (per file) CPSC Tyson Kendon 2016

20 File System Data – in Memory
Mount Table Directory Cache System-Wide Open File Table Per-Process Open File Tables Read/Write Buffers CPSC Tyson Kendon 2016

21 Actions on Files Creating a new file Opening a file Reading, writing, seeking in, a file Closing a file CPSC Tyson Kendon 2016

22 Virtual File System Unify File System Types in an Abstract Whole Provide a clean interface to the OS Manage details at the low level CPSC Tyson Kendon 2016

23 File System Allocation
CPSC Tyson Kendon 2016

24 Contiguous Allocation
Files are laid out in a sequence of neighbouring blocks Fast Limited free space available Need to know the size of the file CPSC Tyson Kendon 2016

25 Linked Allocation Provide reference to the next block in each block of the file – put blocks wherever in memory Don’t need to know the size Waste space on pointers Harder to seek to the middle of a file CPSC Tyson Kendon 2016

26 Indexed Allocation Keep a block of indexes to the blocks of the file
Easier to seek to a point in the file Possibly wasteful of space CPSC Tyson Kendon 2016

27 File System Considerations
Space Time Failure How do we Recover Consistency Checking Transactional Systems CPSC Tyson Kendon 2016

28 File Systems CPSC Tyson Kendon 2016

29 Next Time Disks How do we organize data on secondary storage to make sense and access it quickly Review Multiprocessor Environments CPSC Tyson Kendon 2016


Download ppt "CPSC 457 Operating Systems"

Similar presentations


Ads by Google