LoginSignup
8
6

More than 5 years have passed since last update.

TOPPERS/athrillをdockerで利用できるようにするまで

Last updated at Posted at 2018-10-28

概要

2018年10月/TOPPERS開発者会議で athrill の紹介をしてきました.その際,現状の TOPPERS/athrill の課題について共有させて頂いたところ,新たに協力をして頂ける方に巡り合えました.とてもありがたい話です(感謝).

TOPPERS/athrill を広めていく上での当面の課題は,以下と考えています.

  • 64bit linux v850/rh850 gccが存在しないこと.
  • athrill環境のインストールに手間がかかること.

上記の内,gcc作成は苦手分野なので,協力者の方にお願いをさせて頂き,私の方では2個目の課題について,やり方を模索し情報共有していきたいと考えています.

前提とする環境

まずは,athrillの実行環境について整理します.

これまでは,Windows/MinGW,WSL, native linux(32bit/64bit)等で動作させてきましたが,
とりあえず WSL を前提にした環境構築方法について模索したいと思います.

WSLは,Windows 10 home/pro 両方で対応したいと思います.また,インストールの手間をなくすために,docker 上で athrillを動作できるようにしたいと思います.

ゴール設定

  1. WSL上で docker をインストールする手順を公開する
  2. docker hub にathrill実行環境を公開する
  3. docker hub に公開された athrill実行環境の利用方法を公開する
  4. 64bit v850 gcc のビルド手順を公開する
  5. 64bit v850 gcc を 公開した docker hub にインストールし,公開する
  6. 64bit linux 対応された cfg を 上記 docker hub にインストールし,公開する
  7. docker hub で athrill の全サンプル動作確認する

進捗状況

  • 2018.10.29 :ゴール1達成

    • Windows10 home/WSL 上で docker をインストール/サンプル動作確認できるようになりました.
    • 手順は,『WSL上でDocker Engineが動くようになっていたっぽいという話』を参照ください(感謝).
    • Windows10 home でもインストールできました.
    • ただし,BIOS設定で仮想化支援機能「Intel VT/AMD-V」を有効にしてから上記手順を実施しました.
  • 2018.11.02 :ゴール2達成

    • 協力者の方の docker image(kaizenjapan/ubuntu-athrill)を使用させて頂き,
    • 自分のdocker hub アカウントに公開しました.
    • 差分は,athrillソースを最新にして,パスを切ったくらいですが‥
  • 2018.11.02 14:19 :ゴール3達成

    • ここにathrill実行環境の利用方法を公開しました!
  • 2018.11.04 17:02 :ゴール4達成

  • 2018.11.14 12:27 :ゴール5達成

    • docker hub に 64bit Linux版v850-gccをインストールしたものを公開しました(kanetugu2015/athrill_asp3:ver3.0).

docker/athrill実行環境のインストール方法

以下のコマンドで,dockerからathrill_asp3のサンプル実行環境をダウンロードできます.

$ docker run -it kanetugu2015/athrill_asp3:ver3.0
Unable to find image 'kanetugu2015/athrill_asp3:latest' locally
latest: Pulling from kanetugu2015/athrill_asp3
d3b478b0a2b0: Already exists
adadd1c561a4: Already exists
5f00b46af26a: Already exists
3d489676f78d: Already exists
777fbb85af61: Already exists
ba59bcea44b9: Pull complete
Digest: sha256:9520a93453ce6f1a997f90189c276aa592eda7c8b6dfb61206b7d9a83d24531d
Status: Downloaded newer image for kanetugu2015/athrill_asp3:ver3.0

ダウンロードが終わると,自動的にログインした状態になります.
v850 gcc もインストール済みです.

root@1d69bbcb9ee0:/# uname -a
Linux 1d69bbcb9ee0 4.4.0-17134-Microsoft #345-Microsoft Wed Sep 19 17:47:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux
root@1d69bbcb9ee0:/# v850-elf-gcc --version
v850-elf-gcc (GCC) 4.9-GNUV850_v14.01
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

docker/athrill_asp3のサンプル実行方法

以下のコマンドで,サンプル実行フォルダに移動します.

root@8114dc33e759:/# cda
root@8114dc33e759:/athrill/sample/os/asp3/OBJ#

次に,athrillを起動します.

# athrill2 -c1 -i -m memory.txt -d device_config.txt asp

成功すると,以下のathrill起動ログが出力されます.

core id num=1
ROM : START=0x0 SIZE=512
RAM : START=0x5ff7000 SIZE=512
Elf loading was succeeded:0x0 - 0x7771 : 29.881 KB
Elf loading was succeeded:0x7774 - 0x1006c : 0.0 KB
ELF SYMBOL SECTION LOADED:index=16
ELF SYMBOL SECTION LOADED:sym_num=550
ELF STRING TABLE SECTION LOADED:index=17
Not supported:unknown typeref(*) debug_offset=0x60f1
Not supported:unknown typeref(*) debug_offset=0x9470
Not supported:unknown typeref(*) debug_offset=0x9a1d
[DBG>

asp3を実行するには,ここで「c」コマンドです!

[DBG>c
[CPU>
TOPPERS/ASP3 Kernel Release 3.2.0 for V850-ESFK3 (Oct 27 2018, 06:49:10)
Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
                            Toyohashi Univ. of Technology, JAPAN
Copyright (C) 2004-2017 by Embedded and Real-Time Systems Laboratory
            Graduate School of Information Science, Nagoya Univ., JAPAN

System logging task is started.
Sample program starts (exinf = 0).
E_OBJ (-1) reported by `serial_opn_por'.
task1 is running (001).   |
task1 is running (002).   |
task1 is running (003).   |
task1 is running (004).   |
task1 is running (005).   |
task1 is running (006).   |
task1 is running (007).   |
task1 is running (008).   |
^C

関連記事

8
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
6