Download CS 1550 Chapter 5: Input/Output (I/O) Systems - Prof. Jonathan R. Misurda and more Study notes Computer Science in PDF only on Docsity! CS 1550 – Chapter 5 I/O Jonathan Misurda jmisurda@cs.pitt.edu Block Devices A device that stores data in fixed‐sized blocks, each uniquely addressed, and can be randomly accessed Character Devices Device that delivers or accepts a stream of characters Device Controllers The electronic component of an I/O unit, in contrast with the physical component. Memory-Mapped I/O Separate I/O & memory space 0xFFF… 0 Memory I/O ports Memory‐mapped I/O Hybrid: both memory‐mapped & separate spaces Dynamic Frequency on XScale Setting CPU Freq. in WinCE ; Coprocessor 14, register C6 (CLKCFG) initiates the changes programmed in CCCR ; when CLKCFG is written. doSwitch MOV r3, r0 ; Move r0, the argument to doSwitch, into register r3 MCR p14, 0, r3, c6, c0, 0 ; Copy the contents of r3 into register c6 on coprocessor 14. MOV pc, lr ; return execution to where it last left off // Allocate some space for the virtual reference to CCCR LPVOID virtCCCR = VirtualAlloc(0, sizeof(DWORD), MEM_RESERVE, PAGE_NOACCESS); //0x41300000 is the memory‐mapped location of the CCCR register LPVOID CCCR = (LPVOID)(0x41300000 / 256); // shift by 8 bits for ability to address 2^40 bytes // Map writing the virtual pointer to the physical address of the CCCR register VirtualCopy((LPVOID)virtCCCR, CCCR, sizeof(DWORD), PAGE_READWRITE | PAGE_NOCACHE | PAGE_PHYSICAL); // Set the CCCR register with the new speed *(int *)virtCCCR = new_speed; // Call the assembly function to actually perform the switch doSwitch(0x02 | 0x01); //0x02 means turbo mode, 0x01 means the clock is being switched // Clean up memory by freeing the virtual register. VirtualFree(virtCCCR, 0, MEM_RELEASE); virtCCCR = NULL; Bus Communication CPU Memory I/O CPU Memory I/O This port allows I/O devices access into memory DMA Interrupts Bus I/O Software Goals • Device independence • Uniform naming • Error handling • Synchronous vs. asynchronous transfers • Buffering • Sharable vs. dedicated devices Programmed I/O Printed page ABCD EFGH Ke rn el U se r A Printed page ABCD EFGH ABCD EFGH AB Printed page ABCD EFGH ABCD EFGH