Slide 1

Slide 1 text

FMP on QEMU 第 7 回 自作 OS もくもく会 会場:東京日本橋タワー 27 階 サイボウズ株式会社 @daromart http://sangorrin.blogspot.com/ https://github.com/sangorrin ダニエル

Slide 2

Slide 2 text

whoami ● スペイン人 ● そして、名古屋人かも ^^ ● 好きな言語 ● Ada, C, ASM, Python ● 仕事は Linux 関係 ● 貢献した OSS ● SafeG, MaRTE OS, FMP, Linux, QEMU

Slide 3

Slide 3 text

● TOPPERS プロジェクト@名古屋大学 ● 組込みシステム用の OS やミドルウェア

Slide 4

Slide 4 text

FMP ● FMP: メモリ管理なしマルチタスク OS – https://www.toppers.jp/fmp-kernel.html

Slide 5

Slide 5 text

FMP の勉強には QEMU ! ● 簡単に試すために QEMU の vexpress-CA9 に ポーティングした

Slide 6

Slide 6 text

Environment ● Host: Ubuntu 16.04 ● Dependencies ● Downloads # apt-get install build-essential autoconf libtool \ gcc-arm-none-eabi gdb-arm-none-eabi qemu-system-arm $ export WORKSPACE=$HOME/qemu-fmp $ mkdir $WORKSPACE $ cd $WORKSPACE $ wget https://www.toppers.jp/download.cgi/cfg-linux-static-1_9_4.gz $ gunzip cfg-linux-static-1_9_4.gz $ git clone https://github.com/ryoon/toppers-fmp-for-qemu-vexpress-a9 $ cp cfg-linux-static-1_9_4 toppers-fmp-for-qemu-vexpress-a9/cfg/cfg/cfg

Slide 7

Slide 7 text

Build and run FMP ● Build (target/vexpressa9_gcc/README-EN.txt) ● Run FMP on QEMU $ cd toppers-fmp-for-qemu-vexpress-a9/ $ mkdir -p obj/obj_sample $ cd obj/obj_sample $ perl ../../configure -T vexpressa9_gcc -f $ make realclean $ make ENABLE_G_SYSLOG=false PRC_NUM=4 KERNEL_FUNCOBJS= $ qemu-system-arm -cpu cortex-a9 -M vexpress-a9 -smp 4 -serial vc:80Cx40C \ -serial vc:80Cx40C -serial vc:80Cx40C -serial vc:80Cx40C -no-reboot \ -icount auto -m 1024M -kernel fmp $ Ctrl+Alt+4,5,6,7 for switching between each virtual console. $ qemu-system-arm -cpu cortex-a9 -M vexpress-a9 -smp 4 -serial vc:80Cx40C \ -serial vc:80Cx40C -serial vc:80Cx40C -serial vc:80Cx40C -no-reboot \ -icount auto -m 1024M -kernel fmp $ Ctrl+Alt+4,5,6,7 for switching between each virtual console.

Slide 8

Slide 8 text

Debugging FMP on QEMU ● Rebuild and run with -s -S ● Debug $ make realclean $ make ENABLE_G_SYSLOG=false PRC_NUM=1 KERNEL_FUNCOBJS= OMIT_OPTIMIZATION=true $ qemu-system-arm -cpu cortex-a9 -M vexpress-a9 -smp 1 -serial vc:80Cx40C \ -serial vc:80Cx40C -serial vc:80Cx40C -serial vc:80Cx40C -no-reboot \ -icount auto -m 1024M -kernel fmp -s -S $ arm-none-eabi-gdb fmp target remote localhost:1234 break sta_ker

Slide 9

Slide 9 text

Example Debugging session $ arm-none-eabi-gdb fmp target remote localhost:1234 break sta_ker c tui enable set target-charset EUC-JP n next s step v info locals u up f finish w where b task c b sample1.c:723 terminate and activate the task print *p_tcb bt info reg info all-reg info reg r5 x/1uw 0x60024508 print _kernel_prc1_pcb