From d519c08ffb71128adb498e3414cc31dfab0012d4 Mon Sep 17 00:00:00 2001 From: 0xAX Date: Sun, 4 Jan 2015 22:55:43 +0600 Subject: [PATCH] bootstrap-1 updated --- README.md | 1 - linux-bootstrap-1.md | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 84d9442..990508c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ Series of posts about linux kernel. **Goal is simple** - to share my modest knowledge about linux kernel internals and help people who interested in low-level stuff and linux kernel as me. **Questions/Suggestions**: Feel free about any questions or suggestsions by pinging me at twitter [@0xAX](https://twitter.com/0xAX), adding [issue](https://github.com/0xAX/linux-internals/issues/new) or just drop me [email](anotherworldofworld@gmail.com). - **Contributions**: Feel free to create issues if my English is too bad or create pull-requests. Author diff --git a/linux-bootstrap-1.md b/linux-bootstrap-1.md index 275ca5f..f3fee03 100644 --- a/linux-bootstrap-1.md +++ b/linux-bootstrap-1.md @@ -34,7 +34,7 @@ CS selector 0xf000 CS base 0xffff0000 ``` -Processor works in the [real mode](http://en.wikipedia.org/wiki/Real_mode) now and we need to make a little retreat for understanding memory segmentation in this mode. Real mode is supported in all x86 compatible processors, from [8086](http://en.wikipedia.org/wiki/Intel_8086) to modern intel 64 CPUs. 8086 processor had 20 bit addres bus, which means that it could work with 0-2^20 address space (1 MB). But it had only 16 bit registers, and with 16 bit registers maximum address is 2^16 or 0xffff (640 KB). Memory segmentation was used to make use of all of the addres space. All memory was divided into small fixed-size segments of 65535 bytes, or 64 KB. Since we can not address memory behind 640 KB with 16 bit register, another method to do it has been devised. Address consists of two parts: beginning address of segment and offset from the beginning of this segment. To get physical address in memory, we need to multiply segment part by 16 and add offset part: +Processor works in the [real mode](http://en.wikipedia.org/wiki/Real_mode) now and we need to make a little retreat for understanding memory segmentation in this mode. Real mode is supported in all x86 compatible processors, from [8086](http://en.wikipedia.org/wiki/Intel_8086) to modern intel 64 CPUs. 8086 processor had 20 bit addres bus, which means that it could work with 0-2^20 bytes address space (1 megabyte). But it had only 16 bit registers, and with 16 bit registers maximum address is 2^16 or 0xffff (640 KB). Memory segmentation was used to make use of all of the addres space. All memory was divided into small fixed-size segments of 65535 bytes, or 64 KB. Since we can not address memory behind 640 KB with 16 bit register, another method to do it has been devised. Address consists of two parts: beginning address of segment and offset from the beginning of this segment. To get physical address in memory, we need to multiply segment part by 16 and add offset part: ``` PhysicalAddress = Segment * 16 + Offset @@ -146,7 +146,7 @@ as I wrote above. But we have only 16 bit general purpose registers. The maximum '0x10ffef' ``` -Where `0x10ffef` is equal to `1mb + 64KB - 16b`. But [8086](http://en.wikipedia.org/wiki/Intel_8086) processor, which was first processor with real mode, had 20 address line, and `20^2 = 1048576.0` which is 1MB, so it means that actually available memory amount is 1MB. +Where `0x10ffef` is equal to `1mb + 64KB - 16b`. But [8086](http://en.wikipedia.org/wiki/Intel_8086) processor, which was first processor with real mode, had 20 bit address line, and `20^2 = 1048576.0` which is 1MB, so it means that actually available memory amount is 1MB. General real mode memory map is: