mirror of
https://github.com/0xAX/linux-insides.git
synced 2024-11-04 14:19:00 +00:00
Merge pull request #153 from NanXiao/patch-1
Update linux-initialization-2.md
This commit is contained in:
commit
c793899359
@ -20,11 +20,11 @@ Some theory
|
|||||||
|
|
||||||
Interrupt is an event caused by software or hardware to the CPU. On interrupt, CPU stops the current task and transfer control to the interrupt handler, which handles interruption and transfer control back to the previously stopped task. We can split interrupts on three types:
|
Interrupt is an event caused by software or hardware to the CPU. On interrupt, CPU stops the current task and transfer control to the interrupt handler, which handles interruption and transfer control back to the previously stopped task. We can split interrupts on three types:
|
||||||
|
|
||||||
* Software interrupts - when a software signals CPU that it needs kernel attention. These interrupts generally used for system calls;
|
* Software interrupts - when a software signals CPU that it needs kernel attention. These interrupts are generally used for system calls;
|
||||||
* Hardware interrupts - when a hardware, for example button pressed on a keyboard;
|
* Hardware interrupts - when a hardware event happens, for example button is pressed on a keyboard;
|
||||||
* Exceptions - interrupts generated by CPU, when the CPU detects error, for example division by zero or accessing a memory page which is not in RAM.
|
* Exceptions - interrupts generated by CPU, when the CPU detects error, for example division by zero or accessing a memory page which is not in RAM.
|
||||||
|
|
||||||
Every interrupt and exception is assigned an unique number which called - `vector number`. `Vector number` can be any number from `0` to `255`. There is common practice to use first `32` vector numbers for exceptions, and vector numbers from `31` to `255` are used for user-defined interrupts. We can see it in the code above - `NUM_EXCEPTION_VECTORS`, which defined as:
|
Every interrupt and exception is assigned a unique number which called - `vector number`. `Vector number` can be any number from `0` to `255`. There is common practice to use first `32` vector numbers for exceptions, and vector numbers from `32` to `255` are used for user-defined interrupts. We can see it in the code above - `NUM_EXCEPTION_VECTORS`, which defined as:
|
||||||
|
|
||||||
```C
|
```C
|
||||||
#define NUM_EXCEPTION_VECTORS 32
|
#define NUM_EXCEPTION_VECTORS 32
|
||||||
|
Loading…
Reference in New Issue
Block a user