‫Hello and welcome.
‫And in this lecture, we are going to discuss all about the programmable interrupt controller.
‫So the programmable entropy controller allows hardware to interrupt processor state.
‫It's obviously programmable, hence the name, and it requires interrupt acknowledgement.
‫So we're going to discuss all about this and exactly what the programmable Interop controller is.
‫So a programmable entropy controller allows hardware to interrupt the process.
‫So, for example, when you press a key on the keyboard, it will actually cause an interop to be invoked.
‫When there's a hard disk operation, it will cause an interruption to be invoked.
‫When there's a mouse click, it will cause an interruption to be invoked and so on.
‫So these are the standard Interop requests for the programmable Interop controller.
‫So you have IQ zero.
‫This is a timer interrupt.
‫So basically every so often it'll just cause an interrupt, like on a timer, basically.
‫And this is perfect because it allows you to do things such as multitasking in your kernel, because
‫as soon as the timer interrupt interrupt you, you can quickly switch the process or the task.
‫Right.
‫So it's very handy this time around is very important.
‫So an IQ one is our keyboard.
‫And so, you know, you press the key and it causes an interruption to be called.
‫Now, when I say IQ zero, IQ one, I'm not talking about interrupt number zero, interrupt number one,
‫I'm talking about IQ zero, IQ one.
‫We'll discuss more about that soon.
‫So this is the entire table and you can see the mouse, the atah, hard disk, secondary hard disk and
‫so on.
‫Right.
‫So we can basically use these accused to know when a certain event in the hardware has happened.
‫So let me explain what the AI accuse them.
‫Essentially, we map the accused to an incorrect number, so we pick this number.
‫So let's say Xerox 20, OK, if we mapped Xerox 20 and Xerox 20, then IQ zero would be Xerox 20, Kuumba
‫Xerox twenty one, IQ to Xerox twenty two and so on.
‫And so the table is completed.
‫Right.
‫So that is how that works.
‫And you map the interests by talking with the programmable interop controller using the in and out instructions
‫of the intel processor.
‫So by default the Yakuza mapped interrupts eight to 15.
‫And this is a problem because in protective mode, we have exceptions at those interrupts.
‫So that's why we need to remap them.
‫So your system has to programmable interop controllers, one for the master parts and the other for
‫the slave parts.
‫So the master handles IQ zero to seven and the slave handles IQ eight to 15.
‫So that's important to know because there are two separate controllers.
‫Right.
‫And you need to take that into account when setting them up.
‫So these are the pick control part.
‫So, you know, I was saying how we can use the processes in and out instructions to cause things to
‫happen while these are the parts that we talk to on the bus.
‫So zero x twenty and twenty one for the master IQ, programmable interop controller and Xbox, a zero
‫and zero one for the slave.
‫So that's that, that's how that works.
‫OK, so this is how you remap the master pick in this example.
‫We don't remap the slave, we are just mapping the master only.
‫So you can see on the first two instructions we put the pick into an initialization state.
‫On the next to instructions we remapped the master pick to interrupt 020 so I ocu zero Wistar in six
‫twenty iaci one will start zero x twenty one and so on because we map it from that Interop number twenty.
‫So whenever the pick causes an interrupt for us, we are required to acknowledge it.
‫If we don't acknowledge it, it will no longer interrupt us for that.
‫Isaw acknowledging it is very easy.
‫We simply do an out instruction on the on the process.
‫The port is X twenty and the data we send is twenty.
‫And by sending that it acknowledges the interrupt request.
‫So the program will a controller can get complicated.
‫I'm not showing you the full specification here because you just need to be aware of how we can remap
‫it.
‫That's all you need to worry about.
‫You probably won't have to worry about doing this ever again.
‫We'll only really have to do it once.