What Happens When You Click Your Mouse - Georgia Tech - Advanced Operating Systems
Watch on Udacity: https://www.udacity.com/course/viewer#!/c-ud189/l-636779583/m-639480909
Check out the full Advanced Operating Systems course for free at: https://www.udacity.com/course/ud189
Georgia Tech online Master's program: https://www.udacity.com/georgia-tech
Closed Caption:
Let's understand what happens when you click
the mouse on your computer. Let's say you're
running the Google Earth application and you select
the point that you want to visit on
the globe by clicking the mouse. When
you click the mouse, first the hardware controller
that is interfacing the mouse, which is a
hardware device. To the system using the conduit
of the bus is going to raise an interrupt
on the interupt line which is one of the
dedicated lines on the bus. This conduit, which I
call the bus, contains, as you know, data lines and
address lines and one of the things it also
contains is an interrupt line or multiple interrupt lines.
And the controller asserts this interrupt line to indicate
to the CPU that it wants attention. It's sort of like,
if I'm teaching a class and you all
were a live audience. If you have a question,
you might raise your hand and that's exactly
what happens when you click the mouse. The equivalent
of raising your hand in a classroom is
what the controller is doing, but asserting the interrupt
line on the bus. Asserting the interrupt line on
the bus results in an interrupt to the CPU,
now the processor at this point of time,
is running some program. Perhaps your Google Earth
application is being run on the CPU at
this point of time. An interrupt is a hardware
mechanism for alerting the processor that something external,
in this case the mouse click, requires the
attention of the processor. It's sort of like a
doorbell in a house. Someone is ringing the doorbell,
someone has got to pay attention to who is at the door. Remember that the CPU is
a dumb animal. All it can do is execute
instructions. Right now, it's executing some application. Now, an
interrupt comes in, some other program has to run
on it, in order to field that interrupt, answer
the doorbell. Who's that entity? That is the operating
system. The operating system, which is also a collection
of programs, schedules itself to run on the processor so that it can answer the
doorbell. So the operating system is the one that fields this interrupt, finds
out, who it is intended for, and passes it to the program for appropriate
action for this particular interrupt. This example
of a mouse click and what happens between
the hardware and the software is a good way to segue into the abstractions
provided by an operating system for managing the hardware resources.
Video Length: 02:47
Uploaded By: Udacity
View Count: 1,329