From a5acfee7c3ace898f876f8d6bdac6768f49d7409 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Fri, 5 Aug 2016 11:20:56 +0200 Subject: [PATCH 1/3] Improve some heading levels --- blog/post/2016-04-11-kernel-heap.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blog/post/2016-04-11-kernel-heap.md b/blog/post/2016-04-11-kernel-heap.md index 1229d357..93e172a1 100644 --- a/blog/post/2016-04-11-kernel-heap.md +++ b/blog/post/2016-04-11-kernel-heap.md @@ -141,7 +141,7 @@ But how do we deallocate memory in our bump allocator? Well, we don't ;). We jus (Don't worry, we will introduce a better allocator later in this post.) -### Custom Allocators in Rust +## Custom Allocators in Rust In order to use our crate as system allocator, we add some attributes at the beginning of the file: ``` rust @@ -320,7 +320,7 @@ The `collections` crate provides the [format!] and [vec!] macros, so we use `#[m [format!]: //doc.rust-lang.org/nightly/collections/macro.format!.html [vec!]: https://doc.rust-lang.org/nightly/collections/macro.vec!.html -## Testing +### Testing Now we should be able to allocate memory on the heap. Let's try it in our `rust_main`: From 86efbda8d8fa083e2412d612b61b8ab2e4b5288f Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Fri, 5 Aug 2016 11:21:06 +0200 Subject: [PATCH 2/3] Remove panic=abort note --- blog/post/2016-04-11-kernel-heap.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/blog/post/2016-04-11-kernel-heap.md b/blog/post/2016-04-11-kernel-heap.md index 93e172a1..7582b4a4 100644 --- a/blog/post/2016-04-11-kernel-heap.md +++ b/blog/post/2016-04-11-kernel-heap.md @@ -331,10 +331,6 @@ use alloc::boxed::Box; let heap_test = Box::new(42); ``` -(If you're getting a linker error about `_Unwind_Resume`, try to use the [panic=abort cargo option].) - -[panic=abort cargo option]: https://github.com/phil-opp/blog_os/pull/170 - When we run it, a triple fault occurs and causes permanent rebooting. Let's try debug it using QEMU and objdump as described [in the previous post][qemu debugging]: [qemu debugging]: http://os.phil-opp.com/remap-the-kernel.html#debugging From 72199bb7d7a22eb29b7b19b680f87d2770a7d46e Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Fri, 5 Aug 2016 11:21:46 +0200 Subject: [PATCH 3/3] =?UTF-8?q?Fix=20link=20and=20link=20to=20both=20?= =?UTF-8?q?=E2=80=9Cpage=20tables=E2=80=9D=20and=20=E2=80=9Cremap=20the=20?= =?UTF-8?q?kernel=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog/post/2016-04-11-kernel-heap.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blog/post/2016-04-11-kernel-heap.md b/blog/post/2016-04-11-kernel-heap.md index 7582b4a4..083d1314 100644 --- a/blog/post/2016-04-11-kernel-heap.md +++ b/blog/post/2016-04-11-kernel-heap.md @@ -458,9 +458,10 @@ That's it. Now our `memory::init` function can only be called once. The macro wo [AtomicBool]: https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicBool.html ### Mapping the Heap -Now we're ready to map the heap pages. In order to do it, we need access to the `ActivePageTable` or `Mapper` instance (see the [previous post]). Therefore we return it from the `paging::remap_the_kernel` function: +Now we're ready to map the heap pages. In order to do it, we need access to the `ActivePageTable` or `Mapper` instance (see the [page table] and [kernel remapping] posts). Therefore we return it from the `paging::remap_the_kernel` function: -[previous post]: {{ page.previous.url }} +[page table]: {{% relref "2015-12-09-page-tables.md" %}} +[kernel remapping]: {{% relref "2016-01-01-remap-the-kernel.md" %}} ```rust // in src/memory/paging/mod.rs