Git Product home page Git Product logo

bare_metal_uefi's Introduction

Bare Metal Samples (UEFI application)

ベアメタルプログラミングでUEFIアプリケーションを作成してみたサンプル集です。

「ベアメタルプログラミング」ということで、EDKやgnu-efiといった開発環境やツールチェイン無しで作成しています。

各サンプルの内容については、各サンプルのディレクトリ内のREADME.mdで説明しています。

使い方

1. 準備

1.1. 必要なパッケージのインストール

makex86_64-w64-mingw32-gccqemu-system-x86_64といったコマンドを使用します。

UbuntuやDebian等のAPTが使用できる環境であれば、以下のパッケージをインストールしてください。

  • make
  • gcc-mingw-w64-x86-64
  • qemu-system-x86_64

1.2. このリポジトリのclone

git clone https://github.com/cupnes/bare_metal_uefi.git

1.3. QEMU用のUEFIイメージファイルをリポジトリ直下へ配置

QEMUでUEFIの動作確認を行うためには、UEFIのイメージファイル(OVMF.fd)が必要です。

このリポジトリ内の各サンプルのMakefileはリポジトリ直下のOVMF.fdを参照するので、OVMF.fdをリポジトリ直下へ配置してください。

以下のURLからダウンロード可能です。

ダウンロード後、zipを展開し、このリポジトリ直下へ配置してください。

$ wget http://downloads.sourceforge.net/project/edk2/OVMF/OVMF-X64-r15214.zip
$ unzip OVMF-X64-r15214.zip
$ mv OVMF.fd bare_metal_uefi/
$ rm BUILD_INFO LICENSE README OVMF-X64-r15214.zip

2. ビルド・動作確認

各サンプルのディレクトリへ移動し、 make runでビルドからQEMU上での動作確認までを行えます。

終了方法は以下のとおりです。

  • QEMUを端末内で実行している(Makefileでqemu実行時に-nographicオプションを付けている) -- Ctrl + aの後、x
  • QEMUを別ウィンドウで実行している -- ウィンドウを閉じる -- あるいは、Ctrl + Alt + 2でQEMUモニターに入り、quitコマンドを実行

なお、実機で動作させる場合は、 USBフラッシュメモリ等の第1パーティションをFATでフォーマットし、 ビルド時に生成されるfsディレクトリの中身をコピーしてください。

■ コマンド例

# mount /dev/sdb1 /mnt/storage
# cp -r fs/* /mnt/storage/
# umount /mnt/storage

起動ディスク設定を変更し、ここで作成したUSBフラッシュメモリ等でブートすると、 UEFIアプリを試すことができます。 終了する際は、電源ボタンでPCごと終了させて下さい。

参考情報

以下の情報を参考にさせてもらい、作成しました。

bare_metal_uefi's People

Contributors

cupnes avatar

Stargazers

Shuhuai Cao avatar  avatar  avatar Ziling avatar Masya avatar Nekobuta avatar zhubo avatar Cybertum avatar invoker__qq avatar  avatar Taillook avatar  avatar Andy Wo avatar  avatar .-A-. avatar Kenji Mouri (Qi Lu) avatar Nestor Wheelock avatar  avatar Curie avatar  avatar Susan Calvin avatar Kensuke Masatani avatar Shunsuke Mie avatar Kouji Matsui avatar sksat avatar Ryo Nakabayashi avatar  avatar

Watchers

James Cloos avatar  avatar  avatar Yuki Takezawa 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.