Skip to content

Commit e3806a3

Browse files
committed
Merge pull request SamyPesse#18 from jamietanna/master
Various spelling and grammar changes
2 parents 8b0d743 + 9962459 commit e3806a3

File tree

5 files changed

+19
-26
lines changed

5 files changed

+19
-26
lines changed

Chapter-1/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ In this course we are not going to design an operating system for x86-64 archite
1010

1111
### Our Operating System
1212

13-
The goal is to build a very simple UNIX-based operating system in C++, but the goal is not to just build a "proof-of-concept". The OS should be able to boot, start an userland shell and be extensible.
13+
The goal is to build a very simple UNIX-based operating system in C++, but the goal is not to just build a "proof-of-concept". The OS should be able to boot, start a userland shell and be extensible.
1414

15-
The OS will be built for x86 32bits architecture and IBM compatible PCs.
15+
The OS will be built for x86 architecture, running on 32 bits, and compatible on IBM PCs.
1616

1717
**Specifications:**
1818

1919
* Code in C++
20-
* x86-32 architecture
20+
* x86, 32 bit architecture
2121
* Boot with Grub
2222
* Kind of modular system for drivers
2323
* Kind of UNIX style
@@ -33,4 +33,3 @@ The OS will be built for x86 32bits architecture and IBM compatible PCs.
3333
* API Posix
3434
* LibC
3535
* "Can" run a shell or some excutables like Lua, ...
36-

Chapter-3/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ When an x86-based computer is turned on, it begins a complex path to get to the
66

77
The BIOS boot sequence is: RAM detection -> Hardware detection/Initialization -> Boot sequence.
88

9-
The step important for us is the "Boot sequence", when the BIOS is done with its initialization and tries to transfer control to the next stage of the bootloader process.
9+
The important step for us is the "Boot sequence", where the BIOS is done with its initialization and tries to transfer control to the next stage of the bootloader process.
1010

11-
During the "Boot sequence", the BIOS will first choose the "boot device" (floppy disk, hard-disk, CD, usb flash memory device or network). Our Operating system will first boot from the hard-disk (but it's possible to boot it from a CD or a usb flash memory device).
11+
During the "Boot sequence", the BIOS will first choose the "boot device" (floppy disk, hard-disk, CD, usb flash memory device or network). Our Operating system will first boot from the hard-disk (but it will be possible to boot it from a CD or a usb flash memory device).
1212

13-
The BIOS will read the 512 bytes from the first valid bootsector (If the last two bytes are 0x55, and then 0xAA, then the BIOS considers this to be a valid bootsector), If the BIOS never finds a valid bootsector, it will lock up with an error message. And it'll transfer these 512 bytes into physical memory starting at address 0x7c00 then starts running the code that now begins at 0x7c00.
13+
The BIOS will read 512 bytes from the first valid bootsector (where the last two bytes are 0x55 0xAA), or lock up with an error message if it cannot find one. And it'll transfer these 512 bytes into physical memory starting at address 0x7c00 then starts running the code that now begins at 0x7c00.
1414

1515
When the BIOS transfers control to the bootsector, the bootsector code is loaded and running at physical address 0x7c00 and the CPU is in 16-bit Real Mode but our kernel will be only 32bits so we need a bootloader to read our kernel switch to protected mode and starts running it.
1616

@@ -68,7 +68,7 @@ struct multiboot_info {
6868
};
6969
```
7070

71-
You can use the command ```mbchk kernel.elf``` to valid your kernel.elf file with 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 differents objects in the ELF binary.
7272

7373
#### Create a disk image for our kernel and grub
7474

Chapter-4/README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
A kernel can be programmed in C++, it is very similar to making a kernel in C, except that there are a few pitfalls you must take into account (runtime support, constructors, ...)
66

7-
The compiler will assume that all the C++ runtime support is available by default, however you are not linking in libsupc++ into your C++ kernel, which implements the necessary run-time support. So we need to add some basic run-time support.
8-
9-
Our basic C++ runtime can be found in the [cxx.cc](https://github.com/SamyPesse/How-to-Make-a-Computer-Operating-System/blob/master/src/kernel/runtime/cxx.cc) file.
7+
The compiler will assume that all the necessary C++ runtime support is available by default, but as we are not linking in libsupc++ into your C++ kernel, we need to add some basic functions that can be found in the [cxx.cc](https://github.com/SamyPesse/How-to-Make-a-Computer-Operating-System/blob/master/src/kernel/runtime/cxx.cc) file.
108

119
**Caution:** The operators `new` and `delete` cannot be used before virtual memory and pagination have been initialized.
1210

@@ -66,6 +64,4 @@ FLAG= $(INCDIR) -g -O2 -w -trigraphs -fno-builtin -fno-exceptions -fno-stack-pr
6664
# Assembly compiler
6765
ASM=nasm
6866
ASMFLAG=-f elf -o
69-
```
70-
71-
67+
```

Chapter-5/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
## Chapter 5: Base classes for managing x86 architecture
22

3-
Now that we know how to compile our C++ kernel and boot the binary using GRUB, we can start to do some nice stuffs in C/C++.
3+
Now that we know how to compile our C++ kernel and boot the binary using GRUB, we can start to do some cool things in C/C++.
44

55
#### Printing to the screen console
66

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 caracters in the screen is defined by 2 bytes: one for the caracter and one for the style flag. So the size of the video memory is 4000 = 80*25*2
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).
88

99
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)),:
1010
* **x,y**: define the cursor position on the screen
1111
* **real_screen**: define the video memory pointer
1212
* **putc(char c)**: print a unique caracter on the screen and manage cursor position
1313
* **printf(char* s, ...)**: print a string
1414

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 caracter on the screen and update the x,y position.
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.
1616

1717
```cpp
1818
/* put a byte on screen */
@@ -47,7 +47,7 @@ void Io::putc(char c){
4747
}
4848
```
4949
50-
We also add a usefull and very known method: [printf](https://github.com/SamyPesse/How-to-Make-a-Computer-Operating-System/blob/master/src/kernel/arch/x86/io.cc#L155)
50+
We also add a useful and very known method: [printf](https://github.com/SamyPesse/How-to-Make-a-Computer-Operating-System/blob/master/src/kernel/arch/x86/io.cc#L155)
5151
5252
```cpp
5353
/* put a string in screen */

Chapter-6/README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
## Chapter 6: GDT
22

3-
Thanks to GRUB, your kernel is no more in real-mode, but already in [protected mode](http://en.wikipedia.org/wiki/Protected_mode), this mode allows us to use all the possibilities of the microprocessor such as virtual memory management, paging and safe multi-tasking.
3+
Thanks to GRUB, your kernel is no longer in real-mode, but already in [protected mode](http://en.wikipedia.org/wiki/Protected_mode), this mode allows us to use all the possibilities of the microprocessor such as virtual memory management, paging and safe multi-tasking.
44

55
#### What is the GDT?
66

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.
8-
9-
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 executability and writability. These memory areas are called "segments".
108

119
We are going to use the GDT to define differents memory segments:
1210

@@ -19,7 +17,7 @@ We are going to use the GDT to define differents memory segments:
1917

2018
#### How to load our GDT?
2119

22-
GRUB already initialize a GDT but this GDT is not corresponding to our kernel.
20+
GRUB initializes a GDT but this GDT is does not correspond to our kernel.
2321
The GDT is loaded using the LGDT assembly instruction. It expects the location of a GDT description structure:
2422

2523
![GDTR](./gdtr.png)
@@ -33,9 +31,9 @@ struct gdtr {
3331
} __attribute__ ((packed));
3432
```
3533
36-
**Caution:** the directive ```__attribute__ ((packed))``` signal to gcc that the structure should use the less memory possible. Without this directive, gcc include some bytes to optimize the memory alignment and the access during execution.
34+
**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.
3735
38-
So we need to define our GDT table and load it using LGDT. The GDT table can be stored wherever we want in memory, its address should just be signaled to the process using the GDTR registry.
36+
Now we need to define our GDT table and then load it using LGDT. The GDT table can be stored wherever we want in memory, its address should just be signaled to the process using the GDTR registry.
3937
4038
The GDT table is composed of segments with the following structure:
4139
@@ -81,7 +79,7 @@ void init_gdt_desc(u32 base, u32 limite, u8 acces, u8 other, struct gdtdesc *des
8179
}
8280
```
8381
84-
And the function **init_gdt** initialize the GDT, some part of the function will explain later and are used for multitasking.
82+
And the function **init_gdt** initialize the GDT, some parts of the below function will be explained later and are used for multitasking.
8583
8684
```cpp
8785
void init_gdt(void)

0 commit comments

Comments
 (0)