Skip to content

Commit c78457b

Browse files
committed
Merge pull request SamyPesse#57 from steveno/master
Correct grammar and spelling
2 parents c6a7b51 + d7d0916 commit c78457b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Chapter-7/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ There are 3 types of interrupts:
1010

1111
#### The keyboard example:
1212

13-
When the user pressed a key on the keyboard, the keyboard controller will signal an interrupt to the Interrupt Controller. If the interrupt is not masked, the controller signal the interrupt to the processor, the processor will execute a routine to manage the interrupt (key pressed or key released), this routine could for example get the pressed key from the keyboard controller and print the key to the screen. Once the character processing routine is completed, the interrupted job can be resumed.
13+
When the user pressed a key on the keyboard, the keyboard controller will signal an interrupt to the Interrupt Controller. If the interrupt is not masked, the controller will signal the interrupt to the processor, the processor will execute a routine to manage the interrupt (key pressed or key released), this routine could, for example, get the pressed key from the keyboard controller and print the key to the screen. Once the character processing routine is completed, the interrupted job can be resumed.
1414

1515
#### What is the PIC?
1616

1717
The [PIC](http://en.wikipedia.org/wiki/Programmable_Interrupt_Controller) (Programmable interrupt controller)is a device that is used to combine several sources of interrupt onto one or more CPU lines, while allowing priority levels to be assigned to its interrupt outputs. When the device has multiple interrupt outputs to assert, it asserts them in the order of their relative priority.
1818

19-
The best known PIC is the 8259A, each 8259A can handle 8 devices but most computers have two controllers: one master and one slave, it's allow the computer to manager interrupts from 14 devices.
19+
The best known PIC is the 8259A, each 8259A can handle 8 devices but most computers have two controllers: one master and one slave, this allows the computer to manage interrupts from 14 devices.
2020

21-
In this chapter, we will need to program this controller to initialize it and mask interrupts.
21+
In this chapter, we will need to program this controller to initialize and mask interrupts.
2222

2323
#### What is the IDT?
2424

@@ -46,7 +46,7 @@ struct idtdesc {
4646
} __attribute__ ((packed));
4747
```
4848

49-
**Caution:** the directive ```__attribute__ ((packed))``` signal to gcc that the structure should use as little memory as possible. Without this directive, gcc include some bytes to optimize the memory alignment and the access during execution.
49+
**Caution:** the directive ```__attribute__ ((packed))``` signal to gcc that the structure should use as little memory as possible. Without this directive, gcc includes some bytes to optimize the memory alignment and the access during execution.
5050

5151
Now we need to define our IDT table and then load it using LIDTL. The IDT table can be stored wherever we want in memory, its address should just be signaled to the process using the IDTR registry.
5252

@@ -126,12 +126,12 @@ void init_idt(void)
126126
}
127127
```
128128
129-
After intialization our IDT, we need to activate interrupts by configuring the PIC. The following function will configure the two PICs by writting in their internal registries using the output ports of the processor ```io.outb```. We configure the PICs using the ports:
129+
After intialization of our IDT, we need to activate interrupts by configuring the PIC. The following function will configure the two PICs by writting in their internal registries using the output ports of the processor ```io.outb```. We configure the PICs using the ports:
130130
131131
* Master PIC: 0x20 and 0x21
132132
* Slave PIC: 0xA0 and 0xA1
133133
134-
For a PIC, there is 2 types of registries:
134+
For a PIC, there are 2 types of registries:
135135
136136
* ICW (Initialization Command Word): reinit the controller
137137
* OCW (Operation Control Word): configure the controller once initialized (used to mask/unmask the interrupts)
@@ -198,7 +198,7 @@ For the slave:
198198

199199
**ICW4 (port 0x21 / port 0xA1)**
200200

201-
It is used to define in which mode the controller chould works.
201+
It is used to define in which mode the controller should work.
202202

203203
```
204204
|0|0|0|x|x|x|x|1|
@@ -208,9 +208,9 @@ It is used to define in which mode the controller chould works.
208208
+------------ mode "fully nested" (1)
209209
```
210210

211-
#### Why does idt segments offset are ASM functions?
211+
#### Why do idt segments offset our ASM functions?
212212

213-
You should had notice that when I'm initializing our IDT segments, I'm using offset to segment of code in Assembly. The se different functions are defined in [x86int.asm](https://github.com/SamyPesse/How-to-Make-a-Computer-Operating-System/blob/master/src/kernel/arch/x86/x86int.asm) and are following the scheme:
213+
You should have noticed that when I'm initializing our IDT segments, I'm using offsets to segment the code in Assembly. The different functions are defined in [x86int.asm](https://github.com/SamyPesse/How-to-Make-a-Computer-Operating-System/blob/master/src/kernel/arch/x86/x86int.asm) and are of the following scheme:
214214

215215
```
216216
%macro SAVE_REGS 0
@@ -247,4 +247,4 @@ _asm_int_%1:
247247
%endmacro
248248
```
249249

250-
These macros will be used to define interrupt segment that will prevent corruption of the different registries, it will be very usefull for multitasking.
250+
These macros will be used to define the interrupt segment that will prevent corruption of the different registries, it will be very useful for multitasking.

0 commit comments

Comments
 (0)