Module 11: External I/O Flashcards
device driver
a separate device driver exists for each device; the device driver is software that interacts with the interrupts generated by its respective hardware component, acting as an interface between the external devices and the OS; the driver usually runs as a process
interrupt handler
a separate handler exists for each device that may generate an interrupt; executes (e.g. as a callback function in C) on interrupt; the device driver communicates with the OS through interrupts
device controllers
hardware component that receives data from its respective device, stores it locally, and passes it to the device driver; the controller makes sense of signals going in and coming out from the CPU
-
device registers: allow the device driver to read and write status of the devices like checking whether a printer is ready or not
- data buffers: enable one to write to the controller, which is then subsequently pushed onto the external devices; any data that we write to the disk, or read from the disk, is first buffered in the data buffers of the device controllers, then can be read by the device drivers
port-mapped I/O
special assembly language instructions that allow the device driver to read directly from the external device
memory-mapped I/O
reading or writing to particular addresses that correspond to a location in main memory, control register, of address in the data buffer of a specific I/O device
I/O operations at these addresses are automatically converted to corresponding device control registers or data buffers, reducing the burden on the programmer. This technique requires memory caching to be disabled and the MMU to distinguish the I/O requests from legitimate memory accesses
direct memory access (DMA)
to avoid involving the CPU in the data transfer between the physical memory and external device, a separate hardware co-processor called the DMA is tasked with handling I/O requests
checksum
a sequence of characters, generated by applying cryptographic hash function to data (e.g. in a file)
using the checksum, a system can validate whether different copies of data match
ioctl system call
allows your user application to make requests of devices and is typically used for the process of hardware configuration, command line interface, and building upon kernel functionality
I/O scheduling
many processes create I/O requests and the I/O scheduler determines the order in which to send these requests to the external devices while preserving interactivity
endpoint
remote device capable of communication over a TCP/IP network
socket
a network abstraction uniquely identified by an IP address and port number; a network abstraction used to receive and send data from a given endpoint identified by the IP address for the network service identified by the port number
sockets allow inter or intra machine processes to communicate over the network
IP address
32 bit number in IPv4
128 bit number in IPv6
used to identify endpoints and their location in the network
port number
16-bit integer; ports are associated with the IP address of the machine being used in networking and the type of network protocol being used in the communication
each port is used to handle a different network service so that the machine can execute multiple services and sessions of the same service
port numbers 0- 1023 are reserved for well-known services and port numbers 1024+ can be used by a developer in general applications
socket API
common set of functions, data structures, and constants across many OSes used to maintain and interact with sockets
socket()
creates a socket