Your SlideShare is downloading. ×
0
RevisionRoad map towards marks ....
Principles Of Input / Output H/W• Two types of I/O devices- block, character• Block- can read blocks independently of one ...
Device Controllers• I/O unit has 2 components-mechanical, electronic (controller)• Controller is a chip with a connector w...
Memory-Mapped I/O  (a) Separate I/O ports and memory space. (b) Memory-mapped I/O.     (c) Memory mapped data buffers and ...
Memory Mapped Advantages• Don’t need special instructions to read/write control registers.• Can write a device driver in C...
Memory Mapped Disadvantage• Can cache memory words, which means that old memory value (e.g.  for port 4) could remain in c...
How does DMA work?
Interrupts Revisited     How interrupts happens. Connections between devices and interrupt controller       actually use i...
Principles of I/O Software - Goals of I/OSoftware (1)• Device independence   • programs can access any I/O device   • with...
Goals of I/O Software• Synchronous vs. asynchronous transfers   • blocked transfers vs. interrupt-driven• Buffering   • da...
Device Drivers• Operating system and driver communication   • Commands and data between OS and device drivers• Driver and ...
Check input parameters for validity, and translate them to devicespecific language• Check if device is free (wait or block...
RAID Levels 0,1,2      Backup and parity drives are shown shaded.
RAID       Backup and parity drives are shown shaded.
Disk Scheduling                                    First-In/First-Out           FIFOHead at 53             98       183   ...
Disk Scheduling                             Shortest Seek Time First - SSTFHead at 53              98       183   37    12...
Disk Scheduling                                                        ScanHead at 53                         98       183...
Disk Scheduling                                                  LookHead at 53                   98       183    37    12...
C-SCAN• A disk queue with requests for I/O to blocks on cylinders             23, 89, 132, 42, 187With disk head initially...
C-SCAN• 23, 89, 132, 42, 187Calculation• 11+47+19+23+199+12+55  =366
Upcoming SlideShare
Loading in...5
×

Revision os

132

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
132
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Revision os"

  1. 1. RevisionRoad map towards marks ....
  2. 2. Principles Of Input / Output H/W• Two types of I/O devices- block, character• Block- can read blocks independently of one another • Hard disks, CD-ROMs, USB sticks • 512-32,768 bytes• Character-accepts characters without regard to block structure • Printers, mice, network interfaces• Not everything fits, e.g. clocks don’t fit• Division allows OS to deal with devices in device independent manner • File system deals with blocks Computer Engineering Department - MEFGI 2
  3. 3. Device Controllers• I/O unit has 2 components-mechanical, electronic (controller)• Controller is a chip with a connector which plugs into cables to device• Disk • Disk might have 10,000 sectors of 512 bytes per track • Serial bit stream comes off drive • Has preamble, 4096 bits/sector, error correcting code • Preamble has sector number, cylinder number, sector size….• Controller assembles block from bit stream, does error correction, puts into buffer in controller• Blocks are what are sent from a disk
  4. 4. Memory-Mapped I/O (a) Separate I/O ports and memory space. (b) Memory-mapped I/O. (c) Memory mapped data buffers and separate ports (Pentium)
  5. 5. Memory Mapped Advantages• Don’t need special instructions to read/write control registers.• Can write a device driver in C• Don’t need special protection to keep users from doing I/O directly. Just don’t put I/O memory in any user space
  6. 6. Memory Mapped Disadvantage• Can cache memory words, which means that old memory value (e.g. for port 4) could remain in cache• => have to be able to disable caching when it is worthwhile• I/O devices and memory have to respond to memory references• Works with single bus because both memory and I/O look at address on bus and decide who it is for ?• It gets harder with multiple buses
  7. 7. How does DMA work?
  8. 8. Interrupts Revisited How interrupts happens. Connections between devices and interrupt controller actually use interrupt lines on the bus rather than dedicated wires 8
  9. 9. Principles of I/O Software - Goals of I/OSoftware (1)• Device independence • programs can access any I/O device • without specifying device in advance · (floppy, hard drive, or CD-ROM)• Uniform naming • name of a file or device a string or an integer • not depending on which machine• Error handling • handle as close to the hardware as possible 9
  10. 10. Goals of I/O Software• Synchronous vs. asynchronous transfers • blocked transfers vs. interrupt-driven• Buffering • data coming off a device cannot be stored in final destination• Sharable vs. dedicated devices • disks are sharable • tape drives would not be 10
  11. 11. Device Drivers• Operating system and driver communication • Commands and data between OS and device drivers• Driver and hardware communication • Commands and data between driver and hardware• Driver responsibilities • Initialize devices • Interpreting commands from OS • Schedule multiple outstanding requests • Manage data transfers • Accept and process interrupts • Maintain the integrity of driver and kernel data structures
  12. 12. Check input parameters for validity, and translate them to devicespecific language• Check if device is free (wait or block if not)• Issue commands to control device• Write them into device controller’s registers• Check after each if device is ready for next (wait or block if not)• Block or wait for controller to finish work• Check for errors, and pass data to device-independent software• Return status information• Process next queued request, or block waiting for next
  13. 13. RAID Levels 0,1,2 Backup and parity drives are shown shaded.
  14. 14. RAID Backup and parity drives are shown shaded.
  15. 15. Disk Scheduling First-In/First-Out FIFOHead at 53 98 183 37 122 14 124 65 670 14 37 53 65 67 98 122 124 183 199 45 45 85 + 85 146 + 146 85 + 85 108 + 108 110 + 110 59 + 59 2 + 2 = 640
  16. 16. Disk Scheduling Shortest Seek Time First - SSTFHead at 53 98 183 37 122 14 124 65 670 14 37 53 65 67 98 122 124 183 199 12 12 2 + 2 30 + 30 23 + 23 84 + 84 24 + 24 2 + 2 59 + 59 = 236
  17. 17. Disk Scheduling ScanHead at 53 98 183 37 122 14 124 65 670 14 37 53 65 67 98 122 124 183 199 16 16 + 23 23 + 14 14 + 65 65 + 2 2 + 31 31 + 24 24 + 2 2 + 59 59 = 236
  18. 18. Disk Scheduling LookHead at 53 98 183 37 122 14 124 65 670 14 37 53 65 67 98 122 124 183 199 16 16 23 + 23 51 + 51 2 + 2 31 + 31 24 + 24 2 + 2 59 + 59 = 208
  19. 19. C-SCAN• A disk queue with requests for I/O to blocks on cylinders 23, 89, 132, 42, 187With disk head initially at 100HOME WORK - CLOOK
  20. 20. C-SCAN• 23, 89, 132, 42, 187Calculation• 11+47+19+23+199+12+55 =366
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×