input and output Flashcards
what does memory mapped io do
attaches io devices to a processor via a single unified memory bus
what is a memory bus
a linear address space in main memory
what is the point of the io device having memory on it
provides us control of it and can manage how the device is operating
allows us to transfer data into it
what does the status register in an io device tell us
if the device is ready to accept more data or if it has data to pass into memory
what is the biggest benefit of memory mapped io
attaching devices to the memory bus allows programs to access the device the same as anything else
how do we usually access memory mapped devices
c pointers
what is the negative of memory mapped io and how do we fix it
we can only make memory as fast as the the slowest thing attached to the memory bus and some io devices such as a mouse or keyboard are quite slow
fixed via isolated io
isolated io
separate memory bus for slow io devices
what is the benefit of isolated io
simple devices can remain simple; dont need extra hardware e.g. high speed/performance chips
what is the negative of isolated io
programs dont understand the second bus as its a separate address space therefore special processor instructions have to be used to address these devices
how do we write instructions to address devices in isolated io
functions to access the control/status register and memory in assembly (can be wrapped in c functions but underlying code has to be assembly)
in which two ways can we optimise memory use
circular queues
direct memory access
how do circular queues optimise memory use
2 circular queues one for input and output for messages going in and out
how does direct memory access optimise memory use (positive of it)
means that the cpu can do other things instead of data transfer
good as it could be with a slow device
how does direct memory access work
when we want to transfer data, we configure a dma controller ( a little processor)
the dma gets/sends the data whilst the cpu does something else
once complete the controller signals back to the cpu that the operation is complete
when configuring the dma controller what information do we want it to have
the address of memory were transferring
the number of bytes being transferred
control information to and from the device
what is the alternative of programmed io
direct memory access
what is programmed io
the cpu actively controls the data transfer and must be waiting for the device to be ready
what is RTC (real clock time) and what is it used for
the actual time which is used for time stamps
what is PIT (programmable interrupt time)
a device that sends signals to the processor in a particular amount of milliseconds
how we manage process scheduling etc
why do we use PIT (programmable interrupt time)
the os needs to know when events are occuring which happens at defined times/intervals
what happens if the PID interval is is too low
the system will seem unresponsive
what happens if the PID interval is is too high
managing events + overhead becomes dominant in the running of the system as there may be lots of devices with lots of messages
how do we ensure theres a balance in the frequency of PID intervals
having a queue of events; instead of the interval timer being a fixed amount, we configure the next interval after each event