Code Monkey home page Code Monkey logo

waros's Introduction

WARos

コードネームWARosは日本発の超軽量カーネルとして開発中の実験的プロジェクトです。アプリケーションをOSとして構築でき、超軽量な組み込み開発を可能とします。

このプロジェクトには以下の特徴があります。

  • Linuxなどの既存OSをベースとしておらず、ほぼ完全にフルスクラッチで構築されています。
  • 必要な機能のみを取捨選択することによりバイナリサイズ・実行速度を極限まで最適化できます。
    • 実際にRaspberry Pi B+のような貧弱な環境においても起動は一瞬です。
  • Rust言語の採用により実行速度と安全性を保ったまま高効率な開発が可能です。

前提環境

binutils

クロスコンパイルのため、コンパイルするターゲット環境のbinutilsが必須です。
具体的にはi686-elf-ldといったコマンドが必要となります。

rustc

Rustのコンパイラです。
一部のunstableな機能を利用するためにRustのNightlyビルドが必要です。 現在ビルドを確認しているバージョンはrustc 1.6.0-nightly (52d95e644 2015-11-30)です。

grub

x86向けのビルドには起動用のディスクイメージの生成のため、grub-mkrescueコマンドを使用しています。

ビルド

MakefileはKernelディレクトリにあります。

  1. 依存モジュールのダウンロードのため、先にmake UPDATEが必要です。 ただし、rustcのバージョンにあったソースコードが必要なため、手動でダウンロードすることをおすすめします。
  2. Kernelディレクトリ内でmakeしてください。環境が揃っていればx86向けのバイナリがkernel.x86.bin及びgrub.x86.isoとして出力されます。
    ARM(Raspberry Pi)向けにビルドする際はARCH=arm makeとしてください。この場合のバイナリはkernel.arm.binです。

注意

Mac OS Xでのビルドにおいてリンクエラーの発生を確認しています。依存ライブラリのビルドに失敗しているだけのようで、一度Linux環境でビルドすることで再ビルドが可能となります。

エミュレーション

デバッグにはQEMUが便利です。

x86

以下のコマンドで起動します。

qemu-system-i386 -cdrom grub.x86.iso -vga std -m 256 -serial stdio

Raspberry Pi

Raspberry Pi環境のQEMUはTorlus/qemuにあります。 ただし、メモリの容量が取得できないためkmainにて手動でメモリ領域を指定する必要があります。

qemu-system-arm -kernel kernel.arm.bin.elf -cpu arm1176 -m 256 -M raspi -nographic

この場合 Ctrl-A X で終了します。

デバッグ

QEMUの起動コマンドの最後に-s -Sを付加するとデバッガの接続を待機することができます。 ターゲット環境用のgdbを接続してデバッグが可能です。この時のgdbコマンドのサンプルがgdb.scrにあります。x86環境でgdb -x gdb.scrとすることでデバッグを開始します。

waros's People

Contributors

aznhe21 avatar ericson2314 avatar liamzdenek avatar steveklabnik avatar thepowersgang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.