mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Remove rust-os category
This commit is contained in:
@@ -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_64‑elf‑ld` and `x86_64‑elf‑objdump` 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:
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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]):
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user