From 007bf8a937dd77f93af6f9bf9463443db95e5549 Mon Sep 17 00:00:00 2001
From: Philipp Oppermann
Date: Tue, 28 Jan 2020 16:57:00 +0100
Subject: [PATCH 1/5] Move posts about red zone and disabling SIMD in second
post folder
They are strongly related to the second post.
---
.../02-minimal-rust-kernel}/disable-red-zone/index.md | 2 +-
.../disable-red-zone/red-zone-overwrite.svg | 0
.../02-minimal-rust-kernel}/disable-red-zone/red-zone.svg | 0
.../02-minimal-rust-kernel}/disable-simd/index.md | 2 +-
.../second-edition/posts/02-minimal-rust-kernel/index.md | 4 ++--
5 files changed, 4 insertions(+), 4 deletions(-)
rename blog/content/second-edition/{extra => posts/02-minimal-rust-kernel}/disable-red-zone/index.md (97%)
rename blog/content/second-edition/{extra => posts/02-minimal-rust-kernel}/disable-red-zone/red-zone-overwrite.svg (100%)
rename blog/content/second-edition/{extra => posts/02-minimal-rust-kernel}/disable-red-zone/red-zone.svg (100%)
rename blog/content/second-edition/{extra => posts/02-minimal-rust-kernel}/disable-simd/index.md (98%)
diff --git a/blog/content/second-edition/extra/disable-red-zone/index.md b/blog/content/second-edition/posts/02-minimal-rust-kernel/disable-red-zone/index.md
similarity index 97%
rename from blog/content/second-edition/extra/disable-red-zone/index.md
rename to blog/content/second-edition/posts/02-minimal-rust-kernel/disable-red-zone/index.md
index f8740dde..023e0af3 100644
--- a/blog/content/second-edition/extra/disable-red-zone/index.md
+++ b/blog/content/second-edition/posts/02-minimal-rust-kernel/disable-red-zone/index.md
@@ -2,7 +2,7 @@
title = "Disable the Red Zone"
weight = 1
path = "red-zone"
-
+template = "second-edition/extra.html"
+++
The [red zone] is an optimization of the [System V ABI] that allows functions to temporarily use the 128 bytes below its stack frame without adjusting the stack pointer:
diff --git a/blog/content/second-edition/extra/disable-red-zone/red-zone-overwrite.svg b/blog/content/second-edition/posts/02-minimal-rust-kernel/disable-red-zone/red-zone-overwrite.svg
similarity index 100%
rename from blog/content/second-edition/extra/disable-red-zone/red-zone-overwrite.svg
rename to blog/content/second-edition/posts/02-minimal-rust-kernel/disable-red-zone/red-zone-overwrite.svg
diff --git a/blog/content/second-edition/extra/disable-red-zone/red-zone.svg b/blog/content/second-edition/posts/02-minimal-rust-kernel/disable-red-zone/red-zone.svg
similarity index 100%
rename from blog/content/second-edition/extra/disable-red-zone/red-zone.svg
rename to blog/content/second-edition/posts/02-minimal-rust-kernel/disable-red-zone/red-zone.svg
diff --git a/blog/content/second-edition/extra/disable-simd/index.md b/blog/content/second-edition/posts/02-minimal-rust-kernel/disable-simd/index.md
similarity index 98%
rename from blog/content/second-edition/extra/disable-simd/index.md
rename to blog/content/second-edition/posts/02-minimal-rust-kernel/disable-simd/index.md
index 6810ddf6..da46183f 100644
--- a/blog/content/second-edition/extra/disable-simd/index.md
+++ b/blog/content/second-edition/posts/02-minimal-rust-kernel/disable-simd/index.md
@@ -2,7 +2,7 @@
title = "Disable SIMD"
weight = 2
path = "disable-simd"
-
+template = "second-edition/extra.html"
+++
[Single Instruction Multiple Data (SIMD)] instructions are able to perform an operation (e.g. addition) simultaneously on multiple data words, which can speed up programs significantly. The `x86_64` architecture supports various SIMD standards:
diff --git a/blog/content/second-edition/posts/02-minimal-rust-kernel/index.md b/blog/content/second-edition/posts/02-minimal-rust-kernel/index.md
index 1f77204c..b915850c 100644
--- a/blog/content/second-edition/posts/02-minimal-rust-kernel/index.md
+++ b/blog/content/second-edition/posts/02-minimal-rust-kernel/index.md
@@ -169,7 +169,7 @@ This setting specifies that the target doesn't support [stack unwinding] on pani
We're writing a kernel, so we'll need to handle interrupts at some point. To do that safely, we have to disable a certain stack pointer optimization called the _“red zone”_, because it would cause stack corruptions otherwise. For more information, see our separate post about [disabling the red zone].
-[disabling the red zone]: @/second-edition/extra/disable-red-zone/index.md
+[disabling the red zone]: @/second-edition/posts/02-minimal-rust-kernel/disable-red-zone/index.md
```json
"features": "-mmx,-sse,+soft-float",
@@ -183,7 +183,7 @@ The `mmx` and `sse` features determine support for [Single Instruction Multiple
A problem with disabling SIMD is that floating point operations on `x86_64` require SIMD registers by default. To solve this problem, we add the `soft-float` feature, which emulates all floating point operations through software functions based on normal integers.
-For more information, see our post on [disabling SIMD](@/second-edition/extra/disable-simd/index.md).
+For more information, see our post on [disabling SIMD](@/second-edition/posts/02-minimal-rust-kernel/disable-simd/index.md).
#### Putting it Together
Our target specification file now looks like this:
From f710404f10c849abefe6ad19a03f4a6f4a0ac7b8 Mon Sep 17 00:00:00 2001
From: Philipp Oppermann
Date: Tue, 28 Jan 2020 16:57:49 +0100
Subject: [PATCH 2/5] Remove extra content section from front page
We only have a single extra post, which is about building on Android and possibly outdated.
---
blog/templates/second-edition/index.html | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/blog/templates/second-edition/index.html b/blog/templates/second-edition/index.html
index 1e9b75b5..6e10bc4f 100644
--- a/blog/templates/second-edition/index.html
+++ b/blog/templates/second-edition/index.html
@@ -62,19 +62,6 @@
-
- {% set extra = get_section(path = "second-edition/extra/_index.md") %}
-
{{ extra.title }}
-
-
-
Status Updates
{% set status_updates = get_section(path = "status-update/_index.md") %}
From d351e48602f68b494b4eccf53805a99f0230eabc Mon Sep 17 00:00:00 2001
From: Philipp Oppermann
Date: Tue, 28 Jan 2020 16:58:26 +0100
Subject: [PATCH 3/5] Adjust style of 'read more' link
---
blog/templates/macros.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blog/templates/macros.html b/blog/templates/macros.html
index 406a1ef2..061dac66 100644
--- a/blog/templates/macros.html
+++ b/blog/templates/macros.html
@@ -3,7 +3,7 @@
{{ page.summary | safe}}
-
read more…
+
read more »
{% endmacro post_link %}
From 578b03efcbf44479bbb4abeafc644db299751b1c Mon Sep 17 00:00:00 2001
From: Philipp Oppermann
Date: Tue, 28 Jan 2020 16:59:43 +0100
Subject: [PATCH 4/5] Move and rewrite front page section about first edition
---
blog/templates/second-edition/index.html | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/blog/templates/second-edition/index.html b/blog/templates/second-edition/index.html
index 6e10bc4f..38267733 100644
--- a/blog/templates/second-edition/index.html
+++ b/blog/templates/second-edition/index.html
@@ -55,11 +55,6 @@
-
-
First Edition
- You are viewing the second edition of “Writing an OS in Rust”, which is still in progress. The
first edition has more content, but is no longer updated. We try our best to incorporate the missing content soon.
-
-
@@ -75,6 +70,11 @@
+
First Edition
+
You are currently viewing the second edition of “Writing an OS in Rust”. The first edition is very different in many aspects, for example it builds upon the GRUB bootloader instead of using the `bootloader` crate. In case you're interested in it, it is still available. Note that the first edition is no longer updated and might contain outdated information. read the first edition »
+
+
+
Support Me
{% include "support.html" %}
From c7af79f4525e0cd0e776b65bbec2deb700204782 Mon Sep 17 00:00:00 2001
From: Philipp Oppermann
Date: Tue, 28 Jan 2020 17:06:47 +0100
Subject: [PATCH 5/5] Remove '(Second Edition)' from title
---
blog/templates/second-edition/base.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blog/templates/second-edition/base.html b/blog/templates/second-edition/base.html
index e7df9a0f..35247461 100644
--- a/blog/templates/second-edition/base.html
+++ b/blog/templates/second-edition/base.html
@@ -25,7 +25,7 @@