Remove rust-os category

This commit is contained in:
Philipp Oppermann
2015-11-06 19:43:02 +01:00
parent 870d858018
commit ba5550aebb
8 changed files with 9 additions and 19 deletions

View File

@@ -1,8 +1,6 @@
---
layout: post
title: 'A minimal x86 kernel'
category: 'rust-os'
redirect_from: '/rust-os/2015/08/18/multiboot-kernel/'
---
This post explains how to create a minimal x86 operating system kernel. In fact, it will just boot and print `OK` to the screen. The following blog posts we will extend it using the [Rust] programming language.
@@ -173,7 +171,7 @@ Idx Name Size VMA LMA File off Algn
CONTENTS, ALLOC, LOAD, READONLY, CODE
```
_Note_: The `ld` and `objdump` commands are platform specific. If you're _not_ working on x86_64 architecture, you will need to [cross compile binutils]. Then use `x86_64elfld` and `x86_64elfobjdump` instead of `ld` and `objdump`.
[cross compile binutils]: {{ site.url }}/rust-os/cross-compile-binutils.html
[cross compile binutils]: {{ site.url }}/cross-compile-binutils.html
## Creating the ISO
The last step is to create a bootable ISO image with GRUB. We need to create the following directory structure and copy the `kernel.bin` to the right place:

View File

@@ -1,8 +1,6 @@
---
layout: post
title: 'Entering Long Mode'
category: 'rust-os'
redirect_from: "/rust-os/2015/08/25/entering-longmode/"
updated: 2015-10-29 00:00:00 +0000
---
In the [previous post] we created a minimal multiboot kernel. It just prints `OK` and hangs. The goal is to extend it and 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.

View File

@@ -1,8 +1,6 @@
---
layout: post
title: 'Setup Rust'
category: 'rust-os'
redirect_from: "/rust-os/2015/09/02/setup-rust/"
---
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 [Rust] code. Rust is a high-level language without runtime. It allows us to not link the standard library and write bare metal code. Unfortunately the setup is not quite hassle-free yet.
@@ -74,7 +72,7 @@ We can now build it using `cargo build`. To make sure, we are building it for th
cargo build --target=x86_64-unknown-linux-gnu
```
It creates a static library at `target/x86_64-unknown-linux-gnu/debug/libblog_os.a`, which can be linked with our assembly kernel. If you're getting an error about a missing `core` crate, [look here][cross compile libcore].
[cross compile libcore]: {{ site.url }}/rust-os/cross-compile-libcore.html
[cross compile libcore]: {{ site.url }}/cross-compile-libcore.html
To build and link the rust library on `make`, we extend our `Makefile`([full file][github makefile]):

View File

@@ -1,8 +1,6 @@
---
layout: post
title: 'Printing to Screen'
category: 'rust-os'
redirect_from: "/rust-os/2015/10/23/printing-to-screen/"
---
In the [previous post] we switched from assembly to [Rust], a systems programming language that provides great safety. But so far we are using unsafe features like [raw pointers] whenever we want to print to screen. In this post we will create a Rust module that provides a safe and easy-to-use interface for the VGA text buffer. It will support Rust's [formatting macros], too.
@@ -423,7 +421,7 @@ Now that you know the very basics of OS development in Rust, you should also che
_Note_: You need to [cross compile binutils] to build it (or you create some symbolic links[^fn-symlink] if you're on x86_64).
[Rust Bare-Bones Kernel]: https://github.com/thepowersgang/rust-barebones-kernel
[higher half]: http://wiki.osdev.org/Higher_Half_Kernel
[cross compile binutils]: {{ site.url }}/rust-os/cross-compile-binutils.html
[cross compile binutils]: {{ site.url }}/cross-compile-binutils.html
[^fn-symlink]: You will need to symlink `x86_64-none_elf-XXX` to `/usr/bin/XXX` where `XXX` is in {`as`, `ld`, `objcopy`, `objdump`, `strip`}. The `x86_64-none_elf-XXX` files must be in some folder that is in your `$PATH`. But then you can only build for your x86_64 host architecture, so use this hack only for testing.
- [RustOS]: More advanced kernel that supports allocation, keyboard inputs, and threads. It also has a scheduler and a basic network driver.

View File

@@ -6,11 +6,11 @@ redirect_from: "/archive/"
## Rust OS
{% for post in site.categories.rust-os reversed %}
{% for post in site.posts reversed %}
* [ {{ post.title }} ]({{ post.url }})
{% endfor %}
### Cross Compiling for Rust OS
* [binutils]({{ site.url }}/rust-os/cross-compile-binutils.html)
* [libcore]({{ site.url }}/rust-os/cross-compile-libcore.html)
* [binutils]({{ site.url }}/cross-compile-binutils.html)
* [libcore]({{ site.url }}/cross-compile-libcore.html)

View File

@@ -1,7 +1,6 @@
---
layout: page
title: Cross Compile Binutils
category: "rust-os"
---
The [GNU Binutils] are a collection of various binary tools such as `ld`, `as`, `objdump`, or `readelf`. These tools are platform-specific, so you need to compile them again if your host system and target system are different. In our case, we need `ld` and `objdump` for the x86_64 architecture.
[GNU Binutils]: https://www.gnu.org/software/binutils/

View File

@@ -1,14 +1,13 @@
---
layout: page
title: "Cross Compiling: libcore"
category: "rust-os"
---
So you're getting an ``error: can't find crate for `core` [E0463]`` when using `--target x86_64-unknown-linux-gnu`. That means that you're not running Linux or not using using a x86_64 processor.
**If you have an x86_64 processor and want a quick fix**, try it with `x86_64-pc-windows-gnu` or `x86_64-apple-darwin` (or simply omit the explicit `--target`).
The idiomatic alternative and the only option for non x86_64 CPUs is described below. Note that you need to [cross compile binutils], too.
[cross compile binutils]: {{ site.url }}/rust-os/cross-compile-binutils.html
[cross compile binutils]: {{ site.url }}/cross-compile-binutils.html
## Libcore
The core library is a dependency-free library that is added implicitly when using `#![no_std]`. It provides basic standard library features like Option or Iterator. The core library is installed together with the rust compiler (just like the std library). But the installed libcore is specific to your architecture. If you aren't working on x86_64 Linux and pass `target x86_64unknownlinuxgnu` to cargo, it can't find a x86_64 libcore. To fix this, you can either download it or build it using cargo.

View File

@@ -3,7 +3,7 @@ layout: default
title: Home
---
<div class="newest-post">
<emph>Latest Post</emph>: {% for post in site.categories.rust-os limit:1 %}
<emph>Latest Post</emph>: {% for post in site.posts limit:1 %}
<strong><a href="#{{ post.id }}" onclick="
post = document.getElementById('{{ post.id }}');
post.className = post.className.replace(/\b updated\b/, '');
@@ -14,7 +14,7 @@ title: Home
</div>
<div class="posts">
{% for post in site.categories.rust-os reversed %}
{% for post in site.posts reversed %}
<article class="post" id="{{ post.id }}">
<h1 class="post-title">
<a href="{{ site.baseurl }}{{ post.url }}">