operating systems mehdi naghavi [email protected] [email protected] spring 1386
TRANSCRIPT
![Page 2: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/2.jpg)
2
Class outline
Introduction and Overview Operating system structures Processes Scheduling Deadlocks Memory management Input/Output File Systems Security
![Page 5: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/5.jpg)
5
Overview
Principles of I/O hardware Principles of I/O software I/O software layers Disks Clocks Character-oriented terminals Graphical user interfaces Network terminals Power management
![Page 6: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/6.jpg)
6
How to pick a disk scheduling algorithm
SSTF is easy to implement and works OK if there aren’t too many disk requests in the queue
SCAN-type algorithms perform better for systems under heavy load
More fair than SSTF Use LOOK rather than SCAN algorithms to save time
Long seeks aren’t too expensive, so choose C-LOOK over LOOK to make response time more even
Disk request scheduling interacts with algorithms for allocating blocks to files
Make scheduling algorithm modular: allow it to be changed without changing the file system
Þ Use SSTF for lightly loaded systemsÞ Use C-LOOK for heavily loaded systems
![Page 7: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/7.jpg)
7
When good disks go bad…
Disks have defects In 3M+ sectors, this isn’t surprising!
ECC helps with errors, but sometimes this isn’t enough Disks keep spare sectors (normally unused) and remap bad
sectors into these spares If there’s time, the whole track could be reordered…
![Page 8: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/8.jpg)
8
Cost
Main memory is much more expensive than disk storage
The cost per megabyte of hard disk storage is competitive with magnetic tape if only one tape is used per drive.
The cheapest tape drives and the cheapest disk drives have had about the same storage capacity over the years.
Tertiary storage gives a cost savings only when the number of cartridges is considerably larger than the number of drives.
![Page 9: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/9.jpg)
9
Price per Megabyte of DRAM (From 1981 to 2004)
![Page 10: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/10.jpg)
10
Price per Megabyte of Hard Disk (From 1981 to 2004)
![Page 11: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/11.jpg)
11
Price per Megabyte of a Tape Drive (From 1984-2000)
![Page 12: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/12.jpg)
12
Clock hardware
![Page 13: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/13.jpg)
13
Maintaining time of day
![Page 14: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/14.jpg)
14
Doing multiple timers with a single clock
![Page 15: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/15.jpg)
15
Soft timers
A second clock may be available for timer interrupts Specified by applications No problems if interrupt frequency is low
Soft timers avoid interrupts Kernel checks for soft timer expiration before it exits to
user mode How well this works depends on rate of kernel entries
![Page 16: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/16.jpg)
16
Character-oriented terminals
An RS-232 terminal communicates with computer 1 bit at a time
Called a serial line – bits go out in series, 1 bit at a time Windows uses COM1 and COM2 ports, first to serial lines Computer and terminal are completely independent
![Page 17: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/17.jpg)
17
Buffering for input
![Page 18: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/18.jpg)
18
Special terminal characters
![Page 19: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/19.jpg)
19
Special output characters
![Page 20: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/20.jpg)
20
Driver writes directly into display's video RAM
Parallel port
Memory-mapped display
![Page 21: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/21.jpg)
21
A video RAM image simple monochrome display character mode
Corresponding screen the xs are attribute bytes
How characters are displayed
![Page 22: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/22.jpg)
22
Input software
Keyboard driver delivers a number Driver converts to characters Uses a ASCII table
Exceptions, adaptations needed for other languages Many OS provide for loadable keymaps or code pages Example: characters such as ç
![Page 23: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/23.jpg)
23
Output software for Windows
Sample window located at (200,100) on XGA display
![Page 24: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/24.jpg)
24
Character outlines at different point sizes
![Page 25: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/25.jpg)
25
X Windows
![Page 26: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/26.jpg)
26
Architecture of the SLIM terminal system
![Page 27: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/27.jpg)
27
The SLIM Network Terminal
![Page 28: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/28.jpg)
28
Power Management (1)
Power consumption of various parts of a laptop computer
![Page 29: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/29.jpg)
29
Power management (2)
The use of zones for backlighting the display
![Page 30: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/30.jpg)
30
Power Management (3)
Running at full clock speed Cutting voltage by two
cuts clock speed by two, cuts power by four
![Page 31: Operating Systems Mehdi Naghavi naghavi@iust.ac.ir naghavi@aut.ac.ir Spring 1386](https://reader036.vdocuments.site/reader036/viewer/2022081516/5517a73b5503460e6e8b5f86/html5/thumbnails/31.jpg)
31
Power Management (4)
Telling the programs to use less energy may mean poorer user experience
Examples change from color output to black and white speech recognition reduces vocabulary less resolution or detail in an image