From ad58d131a1d58593cc01004789c3991ac0d7b914 Mon Sep 17 00:00:00 2001 From: aarohikulkarni10 <43353439+aarohikulkarni10@users.noreply.github.com> Date: Thu, 1 Oct 2020 23:23:52 +0530 Subject: [PATCH 1/6] Update README.md Identified certain grammatical errors, reframed the text. --- Chapter-1/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Chapter-1/README.md b/Chapter-1/README.md index df41755..505907e 100644 --- a/Chapter-1/README.md +++ b/Chapter-1/README.md @@ -4,13 +4,13 @@ > The term x86 denotes a family of backward compatible instruction set architectures based on the Intel 8086 CPU. -The x86 architecture is the most common instruction set architecture since its introduction in 1981 for the IBM PC. A large amount of software, including operating systems (OS's) such as DOS, Windows, Linux, BSD, Solaris and Mac OS X, function with x86-based hardware. +The x86 architecture is the most common instruction set architecture. It was introduced in 1981 for the IBM PC. A large amount of software, including operating systems (OS's) such as DOS, Windows, Linux, BSD, Solaris and Mac OS X, function with x86-based hardware. -In this course we are not going to design an operating system for the x86-64 architecture but for x86-32, thanks to backward compatibility, our OS will be compatible with our newer PCs (but take caution if you want to test it on your real machine). +In this course we are not going to design an operating system for the x86-64 architecture but for x86-32, thanks to backward compatibility, our OS will be compatible with our newer PCs (but be cautious if you test it on your real machine). ### Our Operating System -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. +The goal is to build a very simple UNIX-based operating system in C++. The goal is not to just build a "proof-of-concept", the OS should also be able to boot, start a userland shell and be extensible. The OS will be built for the x86 architecture, running on 32 bits, and compatible with IBM PCs. From ae43be941b9a9789ae3cd164a5ee692b1c08f681 Mon Sep 17 00:00:00 2001 From: aarohikulkarni10 <43353439+aarohikulkarni10@users.noreply.github.com> Date: Thu, 1 Oct 2020 23:27:26 +0530 Subject: [PATCH 2/6] Update README.md Reframed sentences to avoid grammar mistakes. --- Chapter-2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Chapter-2/README.md b/Chapter-2/README.md index 9902b37..8609e46 100644 --- a/Chapter-2/README.md +++ b/Chapter-2/README.md @@ -13,7 +13,7 @@ The first step is to download and install Vagrant for your system at http://www. > Oracle VM VirtualBox is a virtualization software package for x86 and AMD64/Intel64-based computers. -Vagrant needs Virtualbox to work, Download and install for your system at https://www.virtualbox.org/wiki/Downloads. +Vagrant needs Virtualbox to work, download and install for your system. Available at https://www.virtualbox.org/wiki/Downloads. ### Start and test your development environment From b30dc69565eab85c402d64f6f973cae0767ec52d Mon Sep 17 00:00:00 2001 From: aarohikulkarni10 <43353439+aarohikulkarni10@users.noreply.github.com> Date: Thu, 1 Oct 2020 23:38:39 +0530 Subject: [PATCH 3/6] Update README.md Minor English grammatical errors fixed --- Chapter-3/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Chapter-3/README.md b/Chapter-3/README.md index 07ae526..52eb3ae 100644 --- a/Chapter-3/README.md +++ b/Chapter-3/README.md @@ -2,7 +2,7 @@ #### How the boot works? -When an x86-based computer is turned on, it begins a complex path to get to the stage where control is transferred to our kernel's "main" routine (`kmain()`). For this course, we are only going to consider the BIOS boot method and not it's successor (UEFI). +When an x86-based computer is turned on, it begins a complex path to get to the stage where control is transferred to our kernel's "main" routine (`kmain()`). For this course, we are only going to consider the BIOS boot method and not its successor (UEFI). The BIOS boot sequence is: RAM detection -> Hardware detection/Initialization -> Boot sequence. @@ -80,7 +80,7 @@ The first step is to create a hard-disk image (c.img) using qemu-img: qemu-img create c.img 2M ``` -We need now to partition the disk using fdisk: +We now need to partition the disk using fdisk: ```bash fdisk ./c.img @@ -128,7 +128,7 @@ fdisk ./c.img > w ``` -We need now to attach the created partition to the loop-device using losetup. This allows a file to be access like a block device. The offset of the partition is passed as an argument and calculated using: **offset= start_sector * bytes_by_sector**. +We now need to attach the created partition to the loop-device using losetup. This allows a file to be accessed like a block device. The offset of the partition is passed as an argument and calculated using: **offset= start_sector * bytes_by_sector**. Using ```fdisk -l -u c.img```, you get: 63 * 512 = 32256. From 9eb42687daaccdd5d8857e1e518b0e74393cc6bd Mon Sep 17 00:00:00 2001 From: aarohikulkarni10 <43353439+aarohikulkarni10@users.noreply.github.com> Date: Thu, 1 Oct 2020 23:45:42 +0530 Subject: [PATCH 4/6] Update README.md Corrected some English grammar errors and in line 33 replaced the word integer by - "store the value and will be positive" as the word integer could be misleading. --- Chapter-4/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Chapter-4/README.md b/Chapter-4/README.md index 9e082c2..18ef497 100644 --- a/Chapter-4/README.md +++ b/Chapter-4/README.md @@ -2,7 +2,7 @@ #### C++ kernel run-time -A kernel can be written in C++ just as it can be in C, with the exception of a few pitfalls that come with using C++ (runtime support, constructors, etc). +A kernel can be written in C++ just as it can be in C, with the exception of a few pitfalls that come with the use of C++ (runtime support, constructors, etc). The compiler will assume that all the necessary C++ runtime support is available by default, but as we are not linking 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. @@ -30,7 +30,7 @@ These functions are defined in [string.cc](https://github.com/SamyPesse/How-to-M #### C types -In the next step, we're going to define different types we're going to use in our code. Most of our variable types are going to be unsigned. This means that all the bits are used to store the integer. Signed variables use their first bit to indicate their sign. +In the next step, we're going to define different 'types' that we will be using in our code. Most of our variable 'types' are going to be unsigned. This means that all the bits are used to store the value and will be positive. Signed variables use their first bit to indicate their sign. ```cpp typedef unsigned char u8; From 74e0cf6a6760e3cad04a519aa774fc939087ef3c Mon Sep 17 00:00:00 2001 From: aarohikulkarni10 <43353439+aarohikulkarni10@users.noreply.github.com> Date: Thu, 1 Oct 2020 23:49:02 +0530 Subject: [PATCH 5/6] Update README.md Some English grammar changes. --- Chapter-5/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Chapter-5/README.md b/Chapter-5/README.md index 703e2df..bf29416 100644 --- a/Chapter-5/README.md +++ b/Chapter-5/README.md @@ -1,10 +1,10 @@ ## Chapter 5: Base classes for managing x86 architecture -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++. +Now that we know how to compile our C++ kernel and boot the binary using GRUB, we can start to do some cool things using C/C++. #### Printing to the screen console -We are going to use VGA default mode (03h) to display some text to the user. The screen can be directly accessed 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). +We are going to use VGA default mode (03h) to display some text to the user. The screen can directly be accessed 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). 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)),: * **x,y**: define the cursor position on the screen @@ -155,7 +155,7 @@ void Io::print(const char *s, ...){ #### Assembly interface -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. +A large number of instructions are available in Assembly but there is no equivalent in C (like cli, sti, in and out), so we need an interface these instructions. In C, we can include Assembly using the directive "asm()", gcc use gas to compile the assembly. From efd7a81c0e1d52b2a363d06c5bfbd79bdbc2881d Mon Sep 17 00:00:00 2001 From: aarohikulkarni10 <43353439+aarohikulkarni10@users.noreply.github.com> Date: Thu, 1 Oct 2020 23:52:24 +0530 Subject: [PATCH 6/6] Update README.md Some minor English grammar changes --- Chapter-6/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Chapter-6/README.md b/Chapter-6/README.md index ae4a8e1..4f64401 100644 --- a/Chapter-6/README.md +++ b/Chapter-6/README.md @@ -8,12 +8,12 @@ The [GDT](http://en.wikipedia.org/wiki/Global_Descriptor_Table) ("Global Descrip We are going to use the GDT to define different memory segments: -* *"code"*: kernel code, used to stored the executable binary code +* *"code"*: kernel code, used to store the executable binary code * *"data"*: kernel data -* *"stack"*: kernel stack, used to stored the call stack during kernel execution -* *"ucode"*: user code, used to stored the executable binary code for user program +* *"stack"*: kernel stack, used to store the call stack during kernel execution +* *"ucode"*: user code, used to store the executable binary code for user program * *"udata"*: user program data -* *"ustack"*: user stack, used to stored the call stack during execution in userland +* *"ustack"*: user stack, use to stored the call stack during execution in userland #### How to load our GDT?