Skip to content

Commit f370abc

Browse files
3rt7dbaluta
authored andcommitted
Documentation: teaching: lectures: interrupts.rst fix typos
Signed-off-by: etzl <erfanzamani3445@gmail.com>
1 parent 33ad89d commit f370abc

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

Documentation/teaching/lectures/interrupts.rst

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ What is an interrupt?
2828

2929
An interrupt is an event that alters the normal execution flow of a
3030
program and can be generated by hardware devices or even by the CPU
31-
itself. When in interrupt occurs the current flow of execution is
31+
itself. When an interrupt occurs the current flow of execution is
3232
suspended and interrupt handler runs. After the interrupt handler runs
3333
the previous execution flow is resumed.
3434

3535
Interrupts can be grouped into two categories based on the source of
36-
the interrupt. They can also be grouped in two other categories based
36+
the interrupt. They can also be grouped into two other categories based
3737
on the ability to postpone or temporarily disable the interrupt:
3838

3939
.. slide:: Interrupts
@@ -48,13 +48,13 @@ on the ability to postpone or temporarily disable the interrupt:
4848

4949
* can be ignored
5050

51-
* signalled via INT pin
51+
* signaled via INT pin
5252

5353
* **non-maskable**
5454

5555
* cannot be ignored
5656

57-
* signalled via NMI pin
57+
* signaled via NMI pin
5858

5959
Synchronous interrupts, usually named exceptions, handle conditions detected by the
6060
processor itself in the course of executing an instruction. Divide by zero or
@@ -67,7 +67,7 @@ that a packet has arrived.
6767
Most interrupts are maskable, which means we can temporarily postpone
6868
running the interrupt handler when we disable the interrupt until the
6969
time the interrupt is re-enabled. However, there are a few critical
70-
interrupts that can not be disabled / postponed.
70+
interrupts that can not be disabled/postponed.
7171

7272
Exceptions
7373
----------
@@ -90,7 +90,7 @@ There are two sources for exceptions:
9090

9191
- **int n**
9292

93-
Processor detected exceptions are raised when an abornmal condition is
93+
Processor detected exceptions are raised when an abnormal condition is
9494
detected while executing an instruction.
9595

9696
A fault is a type of exception that is reported before the execution of the
@@ -100,7 +100,7 @@ the program can re-execute the faulty instruction. (e.g page fault).
100100

101101
A trap is a type of exception that is reported after the execution of the
102102
instruction in which the exception was detected. The saved EIP is the address
103-
of the instruction after the instuction that caused the trap. (e.g debug trap).
103+
of the instruction after the instruction that caused the trap. (e.g debug trap).
104104

105105
Quiz: interrupt terminology
106106
---------------------------
@@ -109,7 +109,7 @@ Quiz: interrupt terminology
109109
:inline-contents: True
110110
:level: 2
111111

112-
For each of the following term on the left select all the terms
112+
For each of the following terms on the left select all the terms
113113
from right that best describe them.
114114

115115
.. hlist::
@@ -159,7 +159,7 @@ Programmable Interrupt Controller
159159
| | | |
160160
+-----------+ +------------+
161161

162-
A device supporting interrupts has an output pin used for signalling an Interrupt ReQuest. IRQ
162+
A device supporting interrupts has an output pin used for signaling an Interrupt ReQuest. IRQ
163163
pins are connected to a device named Programmable Interrupt Controller (PIC) which is connected
164164
to CPU's INTR pin.
165165

@@ -178,10 +178,10 @@ the current interrupt.
178178

179179
.. note::
180180

181-
Once the interrupt is acknowledge by the CPU the interrupt
181+
Once the interrupt is acknowledged by the CPU the interrupt
182182
controller can request another interrupt, regardless if the CPU
183183
finished handled the previous interrupt or not. Thus, depending on
184-
how the OS controlls the CPU it is possible to have nested
184+
how the OS controls the CPU it is possible to have nested
185185
interrupts.
186186

187187
The interrupt controller allows each IRQ line to be individually
@@ -352,7 +352,7 @@ Quiz: hardware concepts
352352
Interrupt handling on the x86 architecture
353353
==========================================
354354

355-
This section will examine how interupts are handled by the CPU on the
355+
This section will examine how interrupts are handled by the CPU on the
356356
x86 architecture.
357357

358358
Interrupt Descriptor Table
@@ -375,7 +375,7 @@ An IDT has the following characteristics:
375375
* processor locates IDT by the means of IDTR
376376

377377
Below we can find Linux IRQ vector layout. The first 32 entries are reserved
378-
for exceptions, vector 128 is used for sycall interface and the rest are
378+
for exceptions, vector 128 is used for syscall interface and the rest are
379379
used mostly for hardware interrupts handlers.
380380

381381
.. slide:: Linux IRQ vector layout
@@ -417,16 +417,16 @@ used mostly for hardware interrupts handlers.
417417

418418
On x86 an IDT entry has 8 bytes and it is named gate. There can be 3 types of gates:
419419

420-
* interrupt gate, holds the address of an interupt or exception handler.
420+
* interrupt gate, holds the address of an interrupt or exception handler.
421421
Jumping to the handler disables maskable interrupts (IF flag is cleared).
422-
* trap gates, similar with an interrupt gate but it does not disable maskable
423-
interrupts while jumping to interupt/exception handler.
422+
* trap gates, similar to an interrupt gate but it does not disable maskable
423+
interrupts while jumping to interrupt/exception handler.
424424
* task gates (not used in Linux)
425425

426-
Lets have a look at several fields of an IDT entry:
426+
Let's have a look at several fields of an IDT entry:
427427

428428
* segment selector, index into GDT/LDT to find the start of the code segment where
429-
the interupt handlers resides
429+
the interrupt handlers reside
430430
* offset, offset inside the code segment
431431
* T, represents the type of gate
432432
* DPL, minimum privilege required for using the segments content.
@@ -459,7 +459,7 @@ In order to find the interrupt handler address we first need to find the start
459459
address of the code segment where interrupt handler resides. For this we
460460
use the segment selector to index into GDT/LDT where we can find the corresponding
461461
segment descriptor. This will provide the start address kept in the 'base' field.
462-
Using base address and the offset we can now go at the start of the interrupt handler.
462+
Using base address and the offset we can now go to the start of the interrupt handler.
463463

464464

465465
.. slide:: Interrupt handler address
@@ -498,7 +498,7 @@ Using base address and the offset we can now go at the start of the interrupt ha
498498
Stack of interrupt handler
499499
--------------------------
500500

501-
Similar with control transfer to a normal function, a control transfer
501+
Similar to control transfer to a normal function, a control transfer
502502
to an interrupt or exception handler uses the stack to store the
503503
information needed for returning to the interrupted code.
504504

@@ -552,7 +552,7 @@ Handling an interrupt request
552552
-----------------------------
553553

554554
After an interrupt request has been generated the processor runs a sequence of
555-
events that eventually ends up with running the kernel interrupt handler:
555+
events that eventually end up with running the kernel interrupt handler:
556556

557557

558558
.. slide:: Handling an interrupt request
@@ -573,9 +573,9 @@ events that eventually ends up with running the kernel interrupt handler:
573573
Returning from an interrupt handler
574574
-----------------------------------
575575

576-
Most architectures offers special instructions to clean-up the stack and resume
576+
Most architectures offer special instructions to clean up the stack and resume
577577
the execution after the interrupt handler has been executed. On x86 IRET is used
578-
to return from an interrupt handler. IRET is similar with RET except that IRET
578+
to return from an interrupt handler. IRET is similar to RET except that IRET
579579
increments ESP by extra four bytes (because of the flags on stack) and moves the
580580
saved flags into EFLAGS register.
581581

@@ -585,7 +585,7 @@ To resume the execution after an interrupt the following sequence is used (x86):
585585
:inline-contents: True
586586
:level: 2
587587

588-
* pop the eror code (in case of an abort)
588+
* pop the error code (in case of an abort)
589589
* call IRET
590590

591591
* pops values from the stack and restore the following register: CS, EIP, EFLAGS
@@ -645,8 +645,8 @@ actions will also be performed (e.g. acknowledge the interrupt at the interrupt
645645
controller level). Local processor interrupts are disabled for the duration of
646646
this phase and continue to be disabled in the next phase.
647647

648-
In the second phase all of the device drivers handler associated with this
649-
interrupt will be executed. At the end of this phase the interrupt controller's
648+
In the second phase, all of the device driver's handlers associated with this
649+
interrupt will be executed. At the end of this phase, the interrupt controller's
650650
"end of interrupt" method is called to allow the interrupt controller to
651651
reassert this interrupt. The local processor interrupts are enabled at this
652652
point.
@@ -657,12 +657,12 @@ point.
657657
devices and in this case it is said that the interrupt is
658658
shared. Usually, when using shared interrupts it is the
659659
responsibility of the device driver to determine if the interrupt
660-
is target to it's device or not.
660+
is target to its device or not.
661661

662662
Finally, in the last phase of interrupt handling interrupt context deferrable
663663
actions will be run. These are also sometimes known as "bottom half" of the
664664
interrupt (the upper half being the part of the interrupt handling that runs
665-
with interrupts disabled). At this point interrupts are enabled on the local
665+
with interrupts disabled). At this point, interrupts are enabled on the local
666666
processor.
667667

668668
.. slide:: Interrupt handling in Linux
@@ -697,7 +697,7 @@ ago in order to avoid increasingly complex solutions to stack
697697
overflows issues - allow just one level of nesting, allow multiple
698698
levels of nesting up to a certain kernel stack depth, etc.
699699

700-
However it is still possible to have nesting between exceptions and
700+
However, it is still possible to have nesting between exceptions and
701701
interrupts but the rules are fairly restrictive:
702702

703703
.. slide:: IRQ and exception nesting in Linux
@@ -771,7 +771,7 @@ interface and the network card buffer is full).
771771

772772
Deferrable actions have APIs to: **initialize** an instance, **activate** or
773773
**schedule** the action and **mask/disable** and **unmask/enable** the execution
774-
of the callback function. The later is used for synchronization purposes between
774+
of the callback function. The latter is used for synchronization purposes between
775775
the callback function and other contexts.
776776

777777
Typically the device driver will initialize the deferrable action
@@ -783,18 +783,18 @@ structure during the device instance initialization and will activate
783783
:level: 2
784784

785785

786-
* Schedule callback functions to run a later time
786+
* Schedule callback functions to run at a later time
787787

788788
* Interrupt context deferrable actions
789789

790790
* Process context deferrable actions
791791

792-
* APIs for initialization, scheduling and masking
792+
* APIs for initialization, scheduling, and masking
793793

794794
Soft IRQs
795795
---------
796796

797-
Soft IRQs is the term used for the low level mechanism that implements deferring
797+
Soft IRQs is the term used for the low-level mechanism that implements deferring
798798
work from interrupt handlers but that still runs in interrupt context.
799799

800800
.. slide:: Soft IRQs

0 commit comments

Comments
 (0)