You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Chapter-3/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ GRUB uses the Multiboot specification, the executable binary should be 32bits an
33
33
34
34
The first boot sequence of our kernel is written in Assembly: [start.asm](https://github.com/SamyPesse/How-to-Make-a-Computer-Operating-System/blob/master/src/kernel/arch/x86/start.asm) and we use a linker file to define our executable structure: [linker.ld](https://github.com/SamyPesse/How-to-Make-a-Computer-Operating-System/blob/master/src/kernel/arch/x86/linker.ld).
35
35
36
-
This boot process alse initialize some of our C++ runtime, it will be described in the next chapter.
36
+
This boot process also initializes some of our C++ runtime, it will be described in the next chapter.
37
37
38
38
Multiboot header structure:
39
39
@@ -68,7 +68,7 @@ struct multiboot_info {
68
68
};
69
69
```
70
70
71
-
You can use the command ```mbchk kernel.elf``` to validate your kernel.elf file against the multiboot standard. You also use the command ```nm -n kernel.elf``` to validate the offset of the differents objects in the ELF binary.
71
+
You can use the command ```mbchk kernel.elf``` to validate your kernel.elf file against the multiboot standard. You also use the command ```nm -n kernel.elf``` to validate the offset of the different objects in the ELF binary.
72
72
73
73
#### Create a disk image for our kernel and grub
74
74
@@ -128,7 +128,7 @@ fdisk ./c.img
128
128
> w
129
129
```
130
130
131
-
We need now to attach the created partition to loop-device (which allow a file to be access like a block device) using losetup. The offset of the partition is passed as an argument and calculed using: **offset= start_sector * bytes_by_sector**.
131
+
We need now to attach the created partition to loop-device (which allow a file to be access like a block device) using losetup. The offset of the partition is passed as an argument and calculated using: **offset= start_sector * bytes_by_sector**.
132
132
133
133
Using ```fdisk -l -u c.img```, you get: 63 * 512 = 32356.
Copy file name to clipboardExpand all lines: Chapter-5/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@ Now that we know how to compile our C++ kernel and boot the binary using GRUB, w
4
4
5
5
#### Printing to the screen console
6
6
7
-
We are going to use VGA default mode (03h) to display some text to the user. The screen can be directly access using the video memory at 0xB8000. The screen resolution is 80x25 and each character on the screen is defined by 2 bytes: one for the character code, and and one for the style flag. This means that the total size of the video memory is 4000B (80B*25B*2B).
7
+
We are going to use VGA default mode (03h) to display some text to the user. The screen can be directly access using the video memory at 0xB8000. The screen resolution is 80x25 and each character on the screen is defined by 2 bytes: one for the character code, and one for the style flag. This means that the total size of the video memory is 4000B (80B*25B*2B).
8
8
9
9
In the IO class ([io.cc](https://github.com/SamyPesse/How-to-Make-a-Computer-Operating-System/blob/master/src/kernel/arch/x86/io.cc)),:
10
10
***x,y**: define the cursor position on the screen
11
11
***real_screen**: define the video memory pointer
12
-
***putc(char c)**: print a unique caracter on the screen and manage cursor position
12
+
***putc(char c)**: print a unique character on the screen and manage cursor position
13
13
***printf(char* s, ...)**: print a string
14
14
15
15
We add a method **putc** to the [IO Class](https://github.com/SamyPesse/How-to-Make-a-Computer-Operating-System/blob/master/src/kernel/arch/x86/io.cc) to put a character on the screen and update the (x,y) position.
A large number of instructions are available in Assembly but there is not equivalent in C (like cli, sti, in and out), so we need an interface to these instructions.
155
155
156
-
In C, we can include Assembly using the diretctive "asm()", gcc use gas to compile the assembly.
156
+
In C, we can include Assembly using the directive "asm()", gcc use gas to compile the assembly.
Copy file name to clipboardExpand all lines: Chapter-6/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ Thanks to GRUB, your kernel is no longer in real-mode, but already in [protected
4
4
5
5
#### What is the GDT?
6
6
7
-
The [GDT](http://en.wikipedia.org/wiki/Global_Descriptor_Table) ("Global Descriptor Table") is a data structure used to define the different memory area: the base address, the size and access privileges like executability and writability. These memory areas are called "segments".
7
+
The [GDT](http://en.wikipedia.org/wiki/Global_Descriptor_Table) ("Global Descriptor Table") is a data structure used to define the different memory area: the base address, the size and access privileges like execute and write. These memory areas are called "segments".
8
8
9
-
We are going to use the GDT to define differents memory segments:
9
+
We are going to use the GDT to define different memory segments:
10
10
11
11
**"code"*: kernel code, used to stored the executable binary code
Copy file name to clipboardExpand all lines: Chapter-7/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,17 +14,17 @@ When the user pressed a key on the keyboard, the keyboard controller will signal
14
14
15
15
#### What is the PIC?
16
16
17
-
The [PIC](http://en.wikipedia.org/wiki/Programmable_Interrupt_Controller) (Programmable interrupt controler)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.
17
+
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.
18
18
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 interupts 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, it's allow the computer to manager interrupts from 14 devices.
20
20
21
21
In this chapter, we will need to program this controller to initialize it and mask interrupts.
22
22
23
23
#### What is the IDT?
24
24
25
25
> The Interrupt Descriptor Table (IDT) is a data structure used by the x86 architecture to implement an interrupt vector table. The IDT is used by the processor to determine the correct response to interrupts and exceptions.
26
26
27
-
Our kernel is going to use the IDT to define the different functions to be executed when an interrupt occured.
27
+
Our kernel is going to use the IDT to define the different functions to be executed when an interrupt occurred.
28
28
29
29
Like the GDT, the IDT is loaded using the LIDTL assembly instruction. It expects the location of a IDT description structure:
0 commit comments