INPUT OUTPUT ARCHITECTURE (PART 1)
INTRODUCTION
INTRODUCTION
INPUT DEVICES
|
OUTPUT DEVICES
|
INPUT
OUTPUT DEVICES
|
|
|
|
DATA TRANSFER COMMUNICATION
SYNCHRONOUS
Data is sent via a bit-stream, which sends a group of characters in a single stream.Synchronous modems must be match with each other. They accomplish this by sending special characters.
ASYNCHRONOUS
Data is coded into a series of pulses, including a start bit(sending by sending modem) and a stop bit.Stop bit designating that the transfer of that bit is complete.
FUNCTION OF INPUT/OUTPUT MODULES
- CONTROL AND TIMING
- Coordination of traffic between internal resources and external devices.
example transaction :
- processor interrogates status of I/O module
- module return devices status.
- I/O module obtains a byte of data from the devices.
- CPU COMMUNICATING
- Data will exchange between CPU and module.Status reporting to CPU since peripherals are slow.Address recognition for the devices connected to it.
Processor communication involves :
- Command decoding : send as signal on control bus with parameters on data bus.
- Data exchange with processor.
- Status reporting : Peripherals are slow compared to processor.
- Address decoding : Module recognizes unique address for each devices it controls.
- DEVICE COMMUNICATION
- On the other side I/O module has to communicate with the device : command,status information,data.
- DATA BUFFERING
- Buffering is often essential.
- Handles the speed mismatch between memory and the device : low speed devices need to have data from memory buffered.
- ERROR DETECTION
- Mechanical and electrical malfunction : out of paper, paper jam, bad disk sector.
- Data communication errors : typically detected with parity bits.
NUR DIYANA BINTI DZOLKIFLI
B031410414
INPUT OUTPUT ARCHITECTURE (PART 2)
TYPICAL I/O CONTROL STEPS
- COMMUNICATION GOES ACROSS THE BUS
- CPU checks I/O module devices status
- I/O module returns status
- If ready, CPU request data transfer
- I/O module gets data from device
- I/O module transfers data to CPU
- Variations for output, DMA, etc.
INPUT/OUTPUT MODULE STRUCTURE
I/O MODULE DECISIONS
- Hide or reveal device properties to CPU
Example :
Disks : LBA(logical block addressing) physical address(CHS) is hidden from CPU.
- Support multiple or single device
- Control device functions or leave for CPU
- video adapters with the Direct Draw interface
- But tape drives expose direct control to CPU.
- Operating decisions
TERMINOLOGY
- Device or input/output controller : relatively simple, detailed control left to CPU.
- Input/Output Processor or Input/Output Channel
- Presents high-level interface to CPU.
- Often control multiple devices.
- Has processing capability.
INPUT OUTPUT TECHNIQUE
- PROGRAMMED I/O
- The CPU issues a command then waits for the I/O operations to be complete.The CPU is faster than the I/O module then method is wasteful.
- INTERRUPT DRIVEN I/O
- Processor issues command
- Device proceeds and leaves processor free.
- DIRECT ACCESS MEMORY(DMA)
- Devices exchanges data directly with memory.
- MEMORY MAPPED I/O
- Memory and I/O are treated as memory only. It means no signal like IO/M.
- ISOLATED I/O
- Address space of memory and I/O is isolated. It uses IO/M signal.
TYPES OF INPUT/OUTPUT COMMANDS
- CPU issues address : identifies module(& device if > 1 per module)
- CPU issues command :
- Control - telling module what to do : spin up disk
- Test - check status : power? error?
- Read/Write : module transfers data via buffer from/to device.
NUR SYAZWANI BINTI MAHADZIR
B031410014
INPUT OUTPUT ARCHITECTURE (PART 3)
INPUT/OUTPUT CONTROLLERS
FOUR DESIGN TECHNIQUES
- MULTIPLE INTERRUPT LINES : In this method we have multiple lines like in IC 8085.
- SOFTWARE POLLING : ISR polls to find out the device which has interrupted. The CPU reads a status register.The method is time consuming.
- DAISY CHIN : The method is hardware polling. The ack signal propagates through and is stopped by the devices who is interrupted.
- BUS ARBITRATION : In this method the device first gets control of the bus and then raises an interrupt request for data transfer.The CPU issues an ack the devices gives vector for branching.
PROGRAMMED INPUT/OUTPUT
- CPU has direct control I/O : sensing status, read/write commands, transferring data.
- CPU waits for I/O module to complete operation.
- Wastes CPU time.
- Programmed I/O-detail
- CPU request I/O operation
- I/O module performs operation
- I/O module sets status bits.
- CPU checks status bits periodically.
- I/O module does not inform CPU directly.
- I/O module does not interrupt CPU.
- CPU may wait or come back later.
The code in the OS for programmed I/O be more like :
keyboard_wait: ; for get_ch
test Keyboard_Status, 80000000h
jz keyboard_wait
mov eax, Keyboard_Data
and
display_wait: ; for put_ch
test Display_Status, 80000000h
jz display_wait
mov Display_Data, eax
|
This scheme is known as BUSY WAITING, or SPIN WAITING.
The little loop is called a SPIN WAIT LOOP.
Programmed I/O flow chart.
Programmed input/output [POLLING]
PROGRAMMED I/O PROBLEM
- Much time is wasted spin waiting.
ADDRESSING I/O DEVICES
- Under programmed I/O data transfer is very much like memory access(CPU viewpoint)
- Each device given unique identifier
- CPU command contain identifier(address)
INPUT/OUTPUT MAPPING
- Memory mapped I/O
- devices and memory share an address space.
- I/O looks just like memory read/write.
- No special commands for I/O
- Isolated I/O
- Separate address spaces
- Need I/O or memory select lines
- Special commands for I/O : limited set of commands
INPUT OUTPUT ARCHITECTURE (PART 4)
INTERRUPTS
- CPU interrupt request line triggered by I/O devices
- Interrupt handler receives interrupt
- Maskable to ignore or delay some interrupts.
- Interrupt vector to dispatch interrupt to correct handler.
- Interrupt mechanism also used for exceptions.
- Interrupt Driven I/O
- overcome CPU waiting
- Avoids repeated checking of device by CPU (polling)
- I/O module interrupts when ready.
- Interrupt Driven I/O basic operation
- CPU issues read command
- I/O module gets data from peripheral while CPU does other work.
- I/O module interrupts CPU
- CPU requests data
- I/O module transfer data.
Interrupt-driven I/O flowchart
Simple interrupt processing
MULTIPLE INTERRUPTS
- Each interrupt line has a priority
- Higher priority lines can interrupt lower priority lines
- If bus mastering only current master can interrupt
VECTORED INTERRUPTS
- A device requesting an interrupt can identify itself by sending a special code to the processor over the bus.
- Interrupt vector
- Avoid bus collision
INPUT/OUTPUT TRANSFER MODE
- Serial
- In band signaling
- Bit oriented
- Bit/byte word translation
- Parallel
- Byte word oriented
- Out of band signaling
- IDE, SCSI.
SERIAL TRANSFER
- Asynchronous Clocking
- Master clock the transfer
- Slave derive clock from master
- Synchronous clocking
- Independent clocking
- Verification by synchronization pattern
PARALLEL TRANSFER
- Data transfer
- Read sector
- Write sector
- Control
- Disk seek
- Transfer Intergrity
- Transfer parity
- Data encoding
CONTROLLING DEVICE REQUESTS
- Some I/O device may not be allowed to issue interrupt request to the processor.
- At device end, an interrupt-enable bit in a control register determine whether the device is allowed to generate an interrupt request.
- At processor end, either an interrupt enable bit in the PS register or priority structure determines whether a given interrupt request will be accepted.
EXCEPTION
- Recovery from errors
- Debugging : trace, breakpoint
- Privilege exception
USE OF INTERRUPTS IN OPERATING SYSTEM
- The OS and the application program pass control back and forth using software interrupts
- Supervisor mode/user mode.
- Multitasking
- Process - running, runnable, blocked
- Program state.
INPUT OUTPUT ARCHITECTURE (PART 5)
BUS ARBITRATION
- The device that is allowed to initiate data transfers on the bus at any given time is called the bus master.
- Bus arbitration is the process by which the next device to become the bus master is selected and bus mastership is transferred to it.
- Need to establish a priority system.
- Two approaches : centralized and distributed.
Centralized Arbitration
BUSES
- The primary function of a bus is to provide a communications path for the transfer of data.
- A bus protocol is the set of rules that govern the behavior of various devices connected to the bus as to when to place information on the bus,assert control signals.
- Three types o bus linen : data, address , control.
- The bus control signal also carry timing information.
- Bus master(initiatior)/slave(target)
ISA BUS INTERRUPT SYSTEM
- ISA bus chains two 8259As together
- Link is via interrupt 2.
- Gives 15 lines : -16 lines less one for link
- IRQ 9 is used to re-route anything trying to use IRQ 2: backwards compatibility.
- Incorporated in chip set - you will not see a chip labeled "82591A" on a motherboard.
PIC
- The chip is called a"programmable interrupt controller" because it can be set up by the OS to use different operating modes :
- Fully nested : IRQs are priotized(settable by OS)
- Rotating : round-robin of equal priority interrupts
- Masks can be inhibit or enable interrupts
- Interrupts can be vectored to a different INT from the IRQ.
WEBSITE LINK FOR EACH CHAPTER
CHAPTER 12 : INPUT OUTPUT ARCHITECTURE
TRUC TRUONG POWERPOINT
MUSTAFA MOHAMED
MUSTAFA MOHAMED
NOR EZREEN FARA BINTI KHALID - B031410024
NUR DIYANA BINTI DZOLKIFLI - B031410414
NUR SYAZWANI BINTI MAHADZIR - B031410014
NURUL HASLINDA BINTI MOHAMMAD - B03141017
NOR NURUL AIN BINTI HASSAN - B031410032