Skip to content
CK Kashyap edited this page Jan 18, 2015 · 13 revisions

Welcome to the unix wiki!

A human readable kernel that can be used for experimentation and potentially some real world scenarios.

Building on Mac

Binutils

  1. Download binutils-2.24 from ftp://ftp.gnu.org/gnu/binutils

  2. Untar the contents - say at /path/to/binutils-2.24

  3. Go to /path/to/binutils-2.24 and run the configure script as follows

./configure --prefix=/path/to/binutils/install --target=x86_64-linux-gnu --disable-nls --disable-werror
make
make install
  1. Set the following environment variables (assuming that build went through successfully in step 3)
ARCHIVE=/path/to/binutils/install/bin/x86_64-linux-gnu-ar
LINKEDITOR=/path/to/binutils/install/bin/x86_64-linux-gnu-ld

I have not tried with it but pre-built binutils can be found here - http://crossgcc.rts-software.org/doku.php?id=compiling_for_linux

RUST

  1. Download both Linux and Mac nightly binaries from http://www.rust-lang.org/install.html

  2. Uzip the contents under a common directory - say, /path/to/RUST. So, /path/to/RUST will contain the following subdirectories rust-nightly-x86_64-unknown-linux-gnu and rust-nightly-x86_64-apple-darwin

  3. Edit Rules.inc and update RUST_ROOT=/path/to/RUST

That's it, just hit make and kernel build should go through.

Building on Linux

RUST

  1. Download Linux nightly binaries from http://www.rust-lang.org/install.html

  2. Uzip the contents under a common directory - say, /path/to/RUST. So, /path/to/RUST will contain the following subdirectory rust-nightly-x86_64-unknown-linux-gnu

  3. Edit Rules.inc and update RUST_ROOT=/path/to/RUST

That's it, just hit make and kernel build should go through.

Running the kernel

make run

make run assumes that qemu-system-x86_64 is present in the path. You can get qemu from here