• Tidak ada hasil yang ditemukan

Principles of IO Hardware

N/A
N/A
Protected

Academic year: 2018

Membagikan "Principles of IO Hardware"

Copied!
63
0
0

Teks penuh

(1)

1

Input/Output

Chapter 5

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

(2)

2

Principles of I/O Hardware

(3)

3

Device Controllers

• I/O devices have components:

– mechanical component – electronic component

• The electronic component is the device controller

– may be able to handle multiple devices

• Controller's tasks

– convert serial bit stream to block of bytes – perform error correction as necessary

(4)

4

Memory-Mapped I/O (1)

• Separate I/O and memory space • Memory-mapped I/O

(5)

5

Memory-Mapped I/O (2)

(a) A single-bus architecture

(6)

6

Direct Memory Access (DMA)

(7)

7

Interrupts Revisited

(8)

8

Principles of I/O Software

Goals of I/O Software (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

(9)

9

Goals of I/O Software (2)

• 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

(10)

1 0

Programmed I/O (1)

(11)

1 1

Programmed I/O (2)

(12)

1 2

Interrupt-Driven I/O

• Writing a string to the printer using interrupt-driven I/O

(13)

1 3

I/O Using DMA

• Printing a string using DMA

(14)

1 4

I/O Software Layers

(15)

1 5

Interrupt Handlers (1)

• Interrupt handlers are best hidden

– have driver starting an I/O operation block until interrupt notifies of completion

• Interrupt procedure does its task

– then unblocks driver that started it

• Steps must be performed in software after interrupt completed

1. Save regs not already saved by interrupt hardware

(16)

1 6

Interrupt Handlers (2)

3. Set up stack for interrupt service procedure

4. Ack interrupt controller, reenable interrupts

5. Copy registers from where saved

6. Run service procedure

7. Set up MMU context for process to run next

8. Load new process' registers

(17)

1 7

Device Drivers

• Logical position of device drivers is shown here

(18)

1 8

Device-Independent I/O Software (1)

Functions of the device-independent I/O software

Uniform interfacing for device drivers Buffering

Error reporting

(19)

1 9

Device-Independent I/O Software (2)

(20)

2 0

Device-Independent I/O Software (3)

(a) Unbuffered input

(b) Buffering in user space

(21)

2 1

Device-Independent I/O Software (4)

(22)

2 2

User-Space I/O Software

(23)

2 3

Disks

Disk Hardware (1)

(24)

2 4

Disk Hardware (2)

(25)

2 5

Disk Hardware (3)

• Raid levels 0 through 2

(26)

2 6

Disk Hardware (4)

• Raid levels 3 through 5

(27)

2 7

Disk Hardware (5)

(28)

2 8

Disk Hardware (6)

(29)

2 9

Disk Hardware (7)

• Cross section of a CD-R disk and laser

– not to scale

• Silver CD-ROM has similar structure

– without dye layer

(30)

3 0

Disk Hardware (8)

(31)

3 1

Disk Formatting (1)

(32)

3 2

Disk Formatting (2)

(33)

3 3

Disk Formatting (3)

• No interleaving

(34)

3 4

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

(35)

3 5

Disk Arm Scheduling Algorithms (2)

Shortest Seek First (SSF) disk scheduling algorithm

Initial positio

n

(36)

3 6

Disk Arm Scheduling Algorithms (3)

(37)

3 7

Error Handling

• A disk track with a bad sector

• Substituting a spare for the bad sector

(38)

3 8

Stable Storage

(39)

3 9

Clocks

Clock Hardware

(40)

4 0

Clock Software (1)

(41)

4 1

Clock Software (2)

(42)

4 2

Soft Timers

• A second clock 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

(43)

4 3

Character Oriented Terminals

RS-232 Terminal Hardware

• 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

(44)

4 4

• Central buffer pool

• Dedicated buffer for each terminal

(45)

4 5

Input Software (2)

(46)

4 6

Output Software

The ANSI escape sequences

• accepted by terminal driver on output • ESC is ASCII character (0x1B)

(47)

4 7

Display Hardware (1)

Memory-mapped displays

• driver writes directly into display's video RAM

(48)

4 8

Display Hardware (2)

• A video RAM image

– simple monochrome display – character mode

(49)

4 9

Input Software

• Keyboard driver delivers a number

– driver converts to characters

– uses a ASCII table

• Exceptions, adaptations needed for

other languages

(50)

5 0

Output Software for Windows (1)

(51)

5 1

Output Software for Windows (2)

(52)

5 2

Output Software for Windows (3)

(53)

5 3

Output Software for Windows (4)

(54)

5 4

Output Software for Windows (5)

• Copying bitmaps using BitBlt.

(55)

5 5

Output Software for Windows (6)

(56)

5 6

Network Terminals

X Windows (1)

(57)

5 7

X Windows (2)

(58)

5 8

The SLIM Network Terminal (1)

(59)

5 9

The SLIM Network Terminal (2)

(60)

6 0

Power Management (1)

(61)

6 1

Power management (2)

(62)

6 2

Power Management (3)

• Running at full clock speed • Cutting voltage by two

(63)

6 3

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

Referensi

Dokumen terkait

Kondisi ini dapat terlihat dalam perwilayahan komoditas, aktivitas pertanian kurang mendapat sorotan yang lebih mendetail mengenai jenis pertanian pada tataran Rencana Tata Ruang

Gedung H, Kampus Sekaran-Gunungpati, Semarang 50229 Telepon: (024)

[r]

Menurut UU No 28 tahun 2009 Pajak Daerah, yang selanjutnya disebut Pajak, adalah kontribusi wajib kepada Daerah yang terutang oleh orang pribadi atau badan yang

mempunyai kepercayaaan diri yang positif antara lain:.. a) Keyakinan akan kemampuan diri. yaitu sikap positif tentang dirinya bahwa

Dalam konteks kajian keragaman (multikultural) pandangan ini sangat superficial (Summer, 2010,). Pada tahap ini paling sering orang menganggap sebagai multikultural misalnya

Salah satu bentuk layanan tersebut adalah konseling dan tes HIV yang bertujuan tidak hanya untuk menegakkan diagnosis namun juga memberikan konseling untuk mendapatkan

Telah melakukan perbaikan terhadap Tesis yang bujudul Pengaruh Social Networh, Shared Goals, du Self-Worth Terhadap Sikap dan Norma Subyektif dalam funwledge Sharing