4 INPUT OUTPUT DEVICE IN OPERATING SYSTEM
4. INPUT OUTPUT DEVICES
● The CPU and memory are not the only resources that the operating system must manage.
● I/O devices also interact heavily with the operating system.
● I/O devices generally consist of two parts: a controller and the device itself.
● The controller is a chip or a set of chips that physically controls the device.
● It accepts commands from the operating system, for example, to read data FROM the device, and carries them out
● Interrupts are very important in operating systems, so let us examine the idea more closely.
● In Fig.(a) we see a three-step process for I/O.
● In step 1, the driver tells the controller what to do by writing into its device registers.
● The controller then starts the device. When the controller has finished reading or writing the number of bytes it has been told to transfer, it signals the interrupt controller chip using certain bus lines in step 2.
● If the interrupt controller is ready to accept the interrupt (which it may not be if it is busy handling a higher-priority one), it asserts a pin on the CPU chip telling it, in step 3.
● In step 4, the interrupt controller puts the number of the device on the bus so the CPU can read it and know which device has just finished (many devices may be running at the same time).
● Once the CPU has decided to take the interrupt, the program counter and PSW are typically then pushed onto the current stack and the CPU switched into kernel mode.
● The device number may be used as an index into part of memory to find the address of the interrupt handler for this device. This part of memory is called the interrupt vector.
● Once the interrupt handler (part of the driver for the interrupting device) has started, it removes the stacked program counter and PSW and saves them, then queries the device to learn its status.
● When the handler is all finished, it returns to the previously running user program to the first instruction that was not yet executed. These steps are shown in Fig.(b).
Operating System #PLAYLIST.
#Subscribe the Channel Link :-
IF any Query or Doubt DM on #Instagram :-
@Aj Upgrading ( BANSODE TECH SOLUTION ) LinkedIn Profile
Link for slides, code samples and text version of the video #blogger
#software #linkedin #tech #hardware #video #operatingsystems #management #data #bscit #mumbaiuniv #operatingsystem #characteristics #bansodetechsolution #ajupgrading
Comments
Post a Comment