From ceb52ac411a695f4f6abf873cc03bf838ff623d6 Mon Sep 17 00:00:00 2001 From: Byron Hambly Date: Thu, 31 Dec 2020 13:53:41 +0200 Subject: [PATCH] Minor grammar fixes (#894) 2 small fixes "we don't have implemented" -> "we haven't implemented" and "We use lazy_static again, because Rust's const evaluator is not powerful enough yet" -> "As before, we use lazy_static again." just to remove what has already been said a few paragraphs up. Thank you for this amazing resource! --- blog/content/edition-2/posts/06-double-faults/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blog/content/edition-2/posts/06-double-faults/index.md b/blog/content/edition-2/posts/06-double-faults/index.md index c9a909ff..45a90bc8 100644 --- a/blog/content/edition-2/posts/06-double-faults/index.md +++ b/blog/content/edition-2/posts/06-double-faults/index.md @@ -264,7 +264,7 @@ lazy_static! { We use `lazy_static` because Rust's const evaluator is not yet powerful enough to do this initialization at compile time. We define that the 0th IST entry is the double fault stack (any other IST index would work too). Then we write the top address of a double fault stack to the 0th entry. We write the top address because stacks on x86 grow downwards, i.e. from high addresses to low addresses. -We don't have implemented memory management yet, so we don't have a proper way to allocate a new stack. Instead, we use a `static mut` array as stack storage for now. The `unsafe` is required because the compiler can't guarantee race freedom when mutable statics are accessed. It is important that it is a `static mut` and not an immutable `static`, because otherwise the bootloader will map it to a read-only page. We will replace this with a proper stack allocation in a later post, then the `unsafe` will be no longer needed at this place. +We haven't implemented memory management yet, so we don't have a proper way to allocate a new stack. Instead, we use a `static mut` array as stack storage for now. The `unsafe` is required because the compiler can't guarantee race freedom when mutable statics are accessed. It is important that it is a `static mut` and not an immutable `static`, because otherwise the bootloader will map it to a read-only page. We will replace this with a proper stack allocation in a later post, then the `unsafe` will be no longer needed at this place. Note that this double fault stack has no guard page that protects against stack overflow. This means that we should not do anything stack intensive in our double fault handler because a stack overflow might corrupt the memory below the stack. @@ -301,7 +301,7 @@ lazy_static! { } ``` -We use `lazy_static` again, because Rust's const evaluator is not powerful enough yet. We create a new GDT with a code segment and a TSS segment. +As before, we use `lazy_static` again. We create a new GDT with a code segment and a TSS segment. #### Loading the GDT