From 87f36584c2de769fc9f8077d72745512121efe5f Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 25 Aug 2015 17:07:40 +0200 Subject: [PATCH] Use jekyll features to link to next/previous posts --- _drafts/rust-setup.md | 8 ++++---- _posts/2015-08-18-multiboot-kernel.md | 2 +- _posts/2015-08-25-entering-longmode.md | 7 ++++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/_drafts/rust-setup.md b/_drafts/rust-setup.md index 582c6c58..d972b367 100644 --- a/_drafts/rust-setup.md +++ b/_drafts/rust-setup.md @@ -2,12 +2,12 @@ layout: post title: 'Setup Rust in small steps' --- -In the last posts we created a [minimal Multiboot kernel][multiboot post] and [switched to Long Mode][long mode post]. Now we can finally switch to sweet Rust code. [Rust] is a beautiful high-level language that has no runtime. It allows us to not link the standard library and write bare metal code. Unfortunately the setup is not quite hassle-free yet. +In the previous posts we created a [minimal Multiboot kernel][multiboot post] and [switched to Long Mode][long mode post]. Now we can finally switch to sweet Rust code. [Rust] is a beautiful high-level language that has no runtime. It allows us to not link the standard library and write bare metal code. Unfortunately the setup is not quite hassle-free yet. This blog post tries to setup Rust step-by-step and point out the different problems. If you have any questions, problems, or suggestions please [file an issue] or create a comment at the bottom. The code from this post is in a [Github repository], too. -[multiboot post]: {% post_url 2015-08-18-multiboot-kernel %} -[long mode post]: #TODO +[multiboot post]: {{ site.url }}{{ page.previous.previous.url }} +[long mode post]: {{ site.url }}{{ page.previous.url }} [Rust]: https://www.rust-lang.org/ [file an issue]: https://github.com/phil-opp/phil-opp.github.io/issues [Github repository]: https://github.com/phil-opp/blogOS/tree/rust_setup @@ -363,4 +363,4 @@ Let's break it down: ## What's next? Right now we write magic bits to memory every time we want to print something. It's time to end the hackery. In the [next post] we create a VGA buffer module that allows us to print strings in different colors. -[next post]: #TODO +[next post]: #TODO {{ site.url }}{{ page.next.url }} diff --git a/_posts/2015-08-18-multiboot-kernel.md b/_posts/2015-08-18-multiboot-kernel.md index 56691708..17061731 100644 --- a/_posts/2015-08-18-multiboot-kernel.md +++ b/_posts/2015-08-18-multiboot-kernel.md @@ -281,4 +281,4 @@ In the [next post] we will create a page table and do some CPU configuration to [Makefile tutorial]: http://mrbook.org/blog/tutorials/make/ [automatic variables]: https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html -[next post]: {% post_url 2015-08-25-entering-longmode %} +[next post]: {{ site.url }}{{ page.next.url }} diff --git a/_posts/2015-08-25-entering-longmode.md b/_posts/2015-08-25-entering-longmode.md index c227d934..d2da12f8 100644 --- a/_posts/2015-08-25-entering-longmode.md +++ b/_posts/2015-08-25-entering-longmode.md @@ -2,11 +2,11 @@ layout: post title: 'Entering Long Mode in small steps' --- -In the [last post] we created a minimal multiboot kernel. It just prints `OK` and hangs. Let's extend it! The goal is to call 64-bit [Rust] code. But the CPU is currently in [Protected Mode] and allows only 32-bit instructions and up to 4GiB memory. So we need to setup _Paging_ and switch to the 64-bit [Long Mode] first. +In the [previous post] we created a minimal multiboot kernel. It just prints `OK` and hangs. Let's extend it! The goal is to call 64-bit [Rust] code. But the CPU is currently in [Protected Mode] and allows only 32-bit instructions and up to 4GiB memory. So we need to setup _Paging_ and switch to the 64-bit [Long Mode] first. I tried to explain everything in detail and to keep the code as simple as possible. If you have any questions, suggestions or other issues, please leave a comment or [create an issue] on Github. The source code is available in a [repository][source code], too. -[last post]: {% post_url 2015-08-18-multiboot-kernel %} +[previous post]: {{ site.url }}{{ page.previous.url }} [Rust]: http://www.rust-lang.org/ [Real Mode]: http://wiki.osdev.org/Real_Mode [Protected Mode]: https://en.wikipedia.org/wiki/Protected_mode @@ -426,8 +426,9 @@ _Congratulations_! You have successfully wrestled through this CPU configuration - and we can write these 64-bit registers directly to memory using `mov qword` (quad word) ## Whats next? -It's time to leave assembly behind[^leave_assembly_behind] and switch to some higher level language. We won't use any C or C++ (not even a single line). Instead we will use the relatively new [Rust] language. It's a systems language without garbage collections but with guaranteed memory safety. Through a real type system and many abstractions it feels like a high-level language but can still be low-level enough for OS development. +It's time to leave assembly behind[^leave_assembly_behind] and switch to some higher level language. We won't use any C or C++ (not even a single line). Instead we will use the relatively new [Rust] language. It's a systems language without garbage collections but with guaranteed memory safety. Through a real type system and many abstractions it feels like a high-level language but can still be low-level enough for OS development. The [next post] describes the Rust setup. [Rust]: https://www.rust-lang.org/ +[next post]: {{ site.url }}{{ page.next.url }} [^leave_assembly_behind]: Actually we will still need some assembly in the future, but I'll try to minimize it.