From cb2a90ef2bded0de669517c3f011fee6359676f6 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 29 Oct 2015 19:36:04 +0100 Subject: [PATCH] typo --- _posts/2015-08-25-entering-longmode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_posts/2015-08-25-entering-longmode.md b/_posts/2015-08-25-entering-longmode.md index dc209c81..5dfd3904 100644 --- a/_posts/2015-08-25-entering-longmode.md +++ b/_posts/2015-08-25-entering-longmode.md @@ -279,7 +279,7 @@ setup_page_tables: ret ``` -Maybe I first explain how an assembly loop works. We use the `ecx` register as a counter variable, just like `i` in a or loop. After mapping the `ecx-th` entry, we increase `ecx` by one and jump to `.map_p2_table` again if it's still smaller 512. +Maybe I first explain how an assembly loop works. We use the `ecx` register as a counter variable, just like `i` in a for loop. After mapping the `ecx-th` entry, we increase `ecx` by one and jump to `.map_p2_table` again if it's still smaller 512. To map a P2 entry we first calculate the start address of its page in `eax`: The `ecx-th` entry needs to be mapped to `ecx * 2MiB`. Then we set the `present`, `writable`, and `huge page` bits and write it to the P2 entry. The address of the `ecx-th` entry in P2 is `p2_table + ecx * 8`, because each entry is 8 bytes large.