From 5a0ab7481d886d37fb06ffbfa03f66b916fb0cbf Mon Sep 17 00:00:00 2001 From: Dou Liyang Date: Tue, 28 Feb 2017 09:32:30 +0800 Subject: [PATCH 1/4] fix a typo s/consuider/consider --- Concepts/cpumask.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Concepts/cpumask.md b/Concepts/cpumask.md index c484404..ea67bc3 100644 --- a/Concepts/cpumask.md +++ b/Concepts/cpumask.md @@ -19,7 +19,7 @@ set_cpu_present(cpu, true); set_cpu_possible(cpu, true); ``` -Before we will consiuder implementation of these functions, let's consider all of these masks. +Before we will consider implementation of these functions, let's consider all of these masks. The `cpu_possible` is a set of cpu ID's which can be plugged in anytime during the life of that system boot or in other words mask of possible CPUs contains maximum number of CPUs which are possible in the system. It will be equal to value of the `NR_CPUS` which is which is set statically via the `CONFIG_NR_CPUS` kernel configuration option. From 337c8b801d03a2181296b58270030b0b936e0afe Mon Sep 17 00:00:00 2001 From: Ayyuce Demirbas Date: Tue, 28 Feb 2017 13:12:44 +0200 Subject: [PATCH 2/4] closing brace your for loop does not have a closing brace --- Booting/linux-bootstrap-2.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Booting/linux-bootstrap-2.md b/Booting/linux-bootstrap-2.md index a796fac..6a5cf2c 100644 --- a/Booting/linux-bootstrap-2.md +++ b/Booting/linux-bootstrap-2.md @@ -515,7 +515,8 @@ for (devno = 0x80; devno < 0x80+EDD_MBR_SIG_MAX; devno++) { } ... ... - ... + ... + } ``` where `0x80` is the first hard drive and the value of `EDD_MBR_SIG_MAX` macro is 16. It collects data into the array of [edd_info](https://github.com/torvalds/linux/blob/master/include/uapi/linux/edd.h#L172) structures. `get_edd_info` checks that EDD is present by invoking the `0x13` interrupt with `ah` as `0x41` and if EDD is present, `get_edd_info` again calls the `0x13` interrupt, but with `ah` as `0x48` and `si` containing the address of the buffer where EDD information will be stored. From a21734b76d25a7f5a79e4918fff0fdbfffdaa930 Mon Sep 17 00:00:00 2001 From: Cao jin Date: Wed, 1 Mar 2017 10:34:12 +0800 Subject: [PATCH 3/4] Nitpicking: correct address space range s/0x100000/0xFFFFF/. Address space size is 1M, but range is 0 - 0xFFFFF --- Booting/linux-bootstrap-1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Booting/linux-bootstrap-1.md b/Booting/linux-bootstrap-1.md index 460d6ac..85a6eff 100644 --- a/Booting/linux-bootstrap-1.md +++ b/Booting/linux-bootstrap-1.md @@ -34,7 +34,7 @@ CS selector 0xf000 CS base 0xffff0000 ``` -The processor starts working in [real mode](https://en.wikipedia.org/wiki/Real_mode). Let's back up a little and try to understand memory segmentation in this mode. Real mode is supported on all x86-compatible processors, from the [8086](https://en.wikipedia.org/wiki/Intel_8086) all the way to the modern Intel 64-bit CPUs. The 8086 processor has a 20-bit address bus, which means that it could work with a 0-0x100000 address space (1 megabyte). But it only has 16-bit registers, which have a maximum address of 2^16 - 1 or 0xffff (64 kilobytes). [Memory segmentation](http://en.wikipedia.org/wiki/Memory_segmentation) is used to make use of all the address space available. All memory is divided into small, fixed-size segments of 65536 bytes (64 KB). Since we cannot address memory above 64 KB with 16 bit registers, an alternate method is devised. An address consists of two parts: a segment selector, which has a base address, and an offset from this base address. In real mode, the associated base address of a segment selector is `Segment Selector * 16`. Thus, to get a physical address in memory, we need to multiply the segment selector part by 16 and add the offset: +The processor starts working in [real mode](https://en.wikipedia.org/wiki/Real_mode). Let's back up a little and try to understand memory segmentation in this mode. Real mode is supported on all x86-compatible processors, from the [8086](https://en.wikipedia.org/wiki/Intel_8086) all the way to the modern Intel 64-bit CPUs. The 8086 processor has a 20-bit address bus, which means that it could work with a 0-0xFFFFF address space (1 megabyte). But it only has 16-bit registers, which have a maximum address of 2^16 - 1 or 0xffff (64 kilobytes). [Memory segmentation](http://en.wikipedia.org/wiki/Memory_segmentation) is used to make use of all the address space available. All memory is divided into small, fixed-size segments of 65536 bytes (64 KB). Since we cannot address memory above 64 KB with 16 bit registers, an alternate method is devised. An address consists of two parts: a segment selector, which has a base address, and an offset from this base address. In real mode, the associated base address of a segment selector is `Segment Selector * 16`. Thus, to get a physical address in memory, we need to multiply the segment selector part by 16 and add the offset: ``` PhysicalAddress = Segment Selector * 16 + Offset From df66966959869ce4228e3dae436bd9c0ddee22cf Mon Sep 17 00:00:00 2001 From: Alexander Kuleshov Date: Thu, 2 Mar 2017 14:48:13 +0600 Subject: [PATCH 4/4] remove description of lockdep_init() --- Initialization/linux-initialization-4.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Initialization/linux-initialization-4.md b/Initialization/linux-initialization-4.md index 258c166..60d689a 100644 --- a/Initialization/linux-initialization-4.md +++ b/Initialization/linux-initialization-4.md @@ -45,15 +45,7 @@ char *command_line; char *after_dashes; ``` -The first represents a pointer to the kernel command line and the second will contain the result of the `parse_args` function which parses an input string with parameters in the form `name=value`, looking for specific keywords and invoking the right handlers. We will not go into the details related with these two variables at this time, but will see it in the next parts. In the next step we can see a call to the: - -```C -lockdep_init(); -``` - -function. `lockdep_init` initializes [lock validator](https://www.kernel.org/doc/Documentation/locking/lockdep-design.txt). Its implementation is pretty simple, it just initializes two [list_head](https://github.com/0xAX/linux-insides/blob/master/DataStructures/dlist.md) hashes and sets the `lockdep_initialized` global variable to `1`. Lock validator detects circular lock dependencies and is called when any [spinlock](http://en.wikipedia.org/wiki/Spinlock) or [mutex](http://en.wikipedia.org/wiki/Mutual_exclusion) is acquired. - -The next function is `set_task_stack_end_magic` which takes address of the `init_task` and sets `STACK_END_MAGIC` (`0x57AC6E9D`) as canary for it. `init_task` represents the initial task structure: +The first represents a pointer to the kernel command line and the second will contain the result of the `parse_args` function which parses an input string with parameters in the form `name=value`, looking for specific keywords and invoking the right handlers. We will not go into the details related with these two variables at this time, but will see it in the next parts. In the next step we can see a call to the `set_task_stack_end_magic` function. This function takes address of the `init_task` and sets `STACK_END_MAGIC` (`0x57AC6E9D`) as canary for it. `init_task` represents the initial task structure: ```C struct task_struct init_task = INIT_TASK(init_task);