Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9d32d49
Begin new post about freestanding executables
phil-opp Oct 5, 2017
75b4e09
Make page title an h1 for semantics
phil-opp Oct 10, 2017
7a26335
Add custom templates for second edition posts
phil-opp Oct 10, 2017
25441a8
Use absolute `path`s instead of `permalink`
phil-opp Jan 19, 2018
d38e97e
Link to #id instead of permalink in TOC
phil-opp Jan 19, 2018
abc9f35
Use utterances for comments on second edition posts
phil-opp Jan 19, 2018
7f3de8d
Update to gutenberg 0.3.0
phil-opp Jan 28, 2018
082c9f0
New favicon
phil-opp Feb 2, 2018
f5797b7
Begin post about creating a minimal Rust kernel
phil-opp Jan 31, 2018
2629945
Delete code from first edition
phil-opp Feb 2, 2018
5823bcb
Initial code for second edition
phil-opp Feb 2, 2018
734310f
Allow executables for x86_64-blog_os target
phil-opp Feb 2, 2018
8f69dfa
Use lld for linking
phil-opp Feb 3, 2018
7d7b948
Rewrite .travis.yml for second edition
phil-opp Feb 2, 2018
244dd16
Add appveyor configuration
phil-opp Feb 2, 2018
c266193
We do not need separate “Intoduction” and “Booting” posts
phil-opp Feb 3, 2018
eb68896
Rewrite first post to work on Windows too
phil-opp Feb 3, 2018
9fc0a07
Fix offset typo
phil-opp Feb 3, 2018
bff0c44
Print “Hello” instead of “OK”
phil-opp Feb 3, 2018
9bb456e
Add support for bors.ng
phil-opp Feb 4, 2018
8a75c28
More work on minimal kernel post
phil-opp Feb 5, 2018
7d55dda
Add extra posts about disabling red zone and SIMD and installing LLD
phil-opp Feb 5, 2018
cef4416
Remove/resolve some todos
phil-opp Feb 5, 2018
7be59b5
Use static and for loop for printing Hello World
phil-opp Feb 8, 2018
5e96335
Add instructions for running in QEMU, VirtualBox, and on real hardware
phil-opp Feb 8, 2018
254d547
Update Linux/Windows/Mac entry points
phil-opp Feb 9, 2018
56be17a
Add paragraph about Multiboot
phil-opp Feb 10, 2018
dc50747
Link to the github issue from the UEFI section
phil-opp Feb 10, 2018
b2285f7
Add a “first-edition” section
phil-opp Feb 10, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
branches:
except:
# Used by bors
- staging.tmp

# Appveyor configuration template for Rust using rustup for Rust installation
# https://github.com/starkat99/appveyor-rust

## Operating System (VM environment) ##

# Rust needs at least Visual Studio 2013 Appveyor OS for MSVC targets.
os: Visual Studio 2015

## Build Matrix ##
environment:
matrix:

### MSVC Toolchains ###
# Nightly 64-bit MSVC
- channel: nightly
target: x86_64-pc-windows-msvc
MSYS_BITS: 64
# Nightly 32-bit MSVC
- channel: nightly
target: i686-pc-windows-msvc
MSYS_BITS: 32

### GNU Toolchains ###
# Nightly 64-bit GNU
- channel: nightly
target: x86_64-pc-windows-gnu
MSYS_BITS: 64
# Nightly 32-bit GNU
- channel: nightly
target: i686-pc-windows-gnu
MSYS_BITS: 32

cache:
- '%USERPROFILE%\.cargo\bin'
- '%USERPROFILE%\.cargo\config'
- '%USERPROFILE%\.cargo\env'
- '%USERPROFILE%\.cargo\.crates.toml'
- '%USERPROFILE%\.xargo'
- target

## Install Script ##

# This is the most important part of the Appveyor configuration. This installs the version of Rust
# specified by the 'channel' and 'target' environment variables from the build matrix. This uses
# rustup to install Rust.
#
# For simple configurations, instead of using the build matrix, you can simply set the
# default-toolchain and default-host manually here.
install:
- appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- rustup-init -yv --default-toolchain %channel% --default-host %target%
- set PATH=%PATH%;%USERPROFILE%\.cargo\bin
- rustc -vV
- cargo -vV

## Build Script ##

# 'cargo test' takes care of building for us, so disable Appveyor's build stage. This prevents
# the "directory does not contain a project or solution file" error.
build: false

before_test:
- mkdir bin
- mklink "bin\ld.exe" "C:\Program Files\LLVM\bin\lld.exe"
- set PATH=%CD%\bin;C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin;%PATH%
- rustup component add rust-src
- set RUST_BACKTRACE=1
- if not exist %USERPROFILE%\.cargo\bin\cargo-install-update.exe cargo install cargo-update
- if not exist %USERPROFILE%\.cargo\bin\xargo.exe cargo install xargo
- if not exist %USERPROFILE%\.cargo\bin\bootimage.exe cargo install bootimage
- cargo install-update -a

# Uses 'cargo test' to run tests and build. Alternatively, the project may call compiled programs
# directly or perform other testing commands. Rust will automatically be placed in the PATH
# environment variable.
test_script:
- bootimage --target x86_64-blog_os
54 changes: 38 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,53 @@
language: rust

sudo: false

notifications:
email:
on_success: never
on_failure: change

branches:
except:
# Used by bors
- staging.tmp

rust:
- nightly

os:
- linux
- osx

addons:
apt:
sources:
- llvm-toolchain-trusty-5.0
packages:
- lld-5.0

cache:
directories:
- $HOME/.cargo
- $HOME/.xargo
- $TRAVIS_BUILD_DIR/target
- $HOME/.cargo
- $HOME/.xargo
- $TRAVIS_BUILD_DIR/target

before_install:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
set -e
LLVM_URL="https://releases.llvm.org/5.0.1/clang+llvm-5.0.1-x86_64-apple-darwin.tar.xz"
travis_retry wget -O llvm.tar.xz -nv ${LLVM_URL}
tar -xJ -f llvm.tar.xz
export PATH="`pwd`/clang+llvm-5.0.1-final-x86_64-apple-darwin/bin:$PATH"
fi

before_script:
- rustup component add rust-src
- (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update)
- (test -x $HOME/.cargo/bin/xargo || cargo install xargo)
- (test -x $HOME/.cargo/bin/bootimage || cargo install bootimage)
- cargo install-update -a

sudo: false

notifications:
email:
on_success: never
on_failure: change

addons:
apt:
packages:
- nasm

script:
- make
- bootimage --target x86_64-blog_os
22 changes: 7 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
[package]
authors = ["Philipp Oppermann <dev@phil-opp.com>"]
name = "blog_os"
version = "0.1.0"
version = "0.2.0"

[dependencies]
bit_field = "0.7.0"
bitflags = "0.9.1"
multiboot2 = "0.1.0"
once = "0.3.2"
rlibc = "1.0"
spin = "0.4.5"
volatile = "0.1.0"
x86_64 = "0.1.2"
linked_list_allocator = "0.4.2"

[dependencies.lazy_static]
features = ["spin_no_std"]
version = "0.2.1"
# the profile used for `cargo build`
[profile.dev]
panic = "abort" # disable stack unwinding on panic

[lib]
crate-type = ["staticlib"]
# the profile used for `cargo build --release`
[profile.release]
panic = "abort" # disable stack unwinding on panic
82 changes: 0 additions & 82 deletions Makefile

This file was deleted.

2 changes: 0 additions & 2 deletions Xargo.toml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title = "Catching Exceptions"
order = 1
path = "catching-exceptions"
date = "2016-05-28"
date = 2016-05-28
[extra]
updated = "2016-06-25"
+++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title = "Better Exception Messages"
order = 2
path = "better-exception-messages"
date = "2016-08-03"
date = 2016-08-03
[extra]
updated = "2016-11-01"
+++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title = "Returning from Exceptions"
order = 3
path = "returning-from-exceptions"
date = "2016-09-21"
date = 2016-09-21
[extra]
updated = "2016-11-01"
+++
Expand Down
4 changes: 4 additions & 0 deletions blog/content/first-edition/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
+++
title = "First Edition"
template = "index.html"
+++
2 changes: 1 addition & 1 deletion blog/content/posts/01-multiboot-kernel/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title = "A minimal x86 kernel"
order = 1
path = "multiboot-kernel/"
date = "2015-08-18"
date = 2015-08-18
+++

This post explains how to create a minimal x86 operating system kernel. In fact, it will just boot and print `OK` to the screen. In subsequent blog posts we will extend it using the [Rust] programming language.
Expand Down
2 changes: 1 addition & 1 deletion blog/content/posts/02-entering-longmode/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title = "Entering Long Mode"
order = 2
path = "entering-longmode"
date = "2015-08-25"
date = 2015-08-25
[extra]
updated = "2015-10-29"
+++
Expand Down
2 changes: 1 addition & 1 deletion blog/content/posts/03-set-up-rust/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title = "Set Up Rust"
order = 3
path = "set-up-rust"
date = "2015-09-02"
date = 2015-09-02
[extra]
updated = "2017-04-12"
+++
Expand Down
2 changes: 1 addition & 1 deletion blog/content/posts/04-printing-to-screen/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title = "Printing to Screen"
order = 4
path = "printing-to-screen"
date = "2015-10-23"
date = 2015-10-23
[extra]
updated = "2016-10-31"
+++
Expand Down
2 changes: 1 addition & 1 deletion blog/content/posts/05-allocating-frames/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title = "Allocating Frames"
order = 5
path = "allocating-frames"
date = "2015-11-15"
date = 2015-11-15
+++

In this post we create an allocator that provides free physical frames for a future paging module. To get the required information about available and used memory we use the Multiboot information structure. Additionally, we improve the `panic` handler to print the corresponding message and source line.
Expand Down
2 changes: 1 addition & 1 deletion blog/content/posts/06-page-tables/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title = "Page Tables"
order = 6
path = "page-tables"
date = "2015-12-09"
date = 2015-12-09
+++

In this post we will create a paging module, which allows us to access and modify the 4-level page table. We will explore recursive page table mapping and use some Rust features to make it safe. Finally we will create functions to translate virtual addresses and to map and unmap pages.
Expand Down
2 changes: 1 addition & 1 deletion blog/content/posts/07-remap-the-kernel/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title = "Remap the Kernel"
order = 7
path = "remap-the-kernel"
date = "2016-01-01"
date = 2016-01-01
[extra]
updated = "2016-03-06"
+++
Expand Down
2 changes: 1 addition & 1 deletion blog/content/posts/08-kernel-heap/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title = "Kernel Heap"
order = 8
path = "kernel-heap"
date = "2016-04-11"
date = 2016-04-11
updated = "2017-11-19"
+++

Expand Down
2 changes: 1 addition & 1 deletion blog/content/posts/09-handling-exceptions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title = "Handling Exceptions"
order = 9
path = "handling-exceptions"
date = "2017-03-26"
date = 2017-03-26
+++

In this post, we start exploring CPU exceptions. Exceptions occur in various erroneous situations, for example when accessing an invalid memory address or when dividing by zero. To catch them, we have to set up an _interrupt descriptor table_ that provides handler functions. At the end of this post, our kernel will be able to catch [breakpoint exceptions] and to resume normal execution afterwards.
Expand Down
2 changes: 1 addition & 1 deletion blog/content/posts/10-double-faults/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title = "Double Faults"
order = 10
path = "double-faults"
date = "2017-01-02"
date = 2017-01-02
+++

In this post we explore double faults in detail. We also set up an _Interrupt Stack Table_ to catch double faults on a separate kernel stack. This way, we can completely prevent triple faults, even on kernel stack overflow.
Expand Down
4 changes: 4 additions & 0 deletions blog/content/second-edition/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
+++
title = "Second Edition"
template = "second-edition/index.html"
+++
Loading