0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

WSL2のubuntu 20.4にQEMU 6.1.0 をコンパイルしてインストール

Posted at

ひさしぶりにQEMUで遊ぼうかと、QEMU 6.1.0 をWSL2 ubuntu 20.4 にインストールしてみました。

x11とかは使ってないです。

QEMUのサイトから、qemu-6.1.0.tar.xzをダウンロードしました。
tarで展開します。

$ tar xf /mnt/c/Users/hoge/Downloads/qemu-6.1.0.tar.xz
$ cd qemu-6.1.0

configureをすると足りないといわれたので下記パッケージを追加しました。(コンパイラとかmakeとかninjaはすでにインストールしてました。)

$ sudo apt install pkg-config libglib2.0-dev libpixman-1-dev

arm とaarch64のターゲットを有効にしてconfigureしました。トレースを有効にしてます。

$ ./configure --prefix=`pwd`/build --target-list=arm-softmmu,aarch64-softmmu  --enable-trace-backend=log

ビルドします。

$ make
...
...
$ ./build/qemu-system-aarch64 --version
QEMU emulator version 6.1.0
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers

以前書いたプログラムを動かしてみました。

git clone https://github.com/eggman/raspberrypi
cd cd qemu-raspi3/int01
make
make run 
$ make run
make kernel.elf
make[1]: Entering directory '/home/sekine/baremetal/raspberrypi/qemu-raspi3/int01'
make[1]: 'kernel.elf' is up to date.
make[1]: Leaving directory '/home/sekine/baremetal/raspberrypi/qemu-raspi3/int01'
qemu-system-aarch64 -M raspi3 -m 1024 -serial mon:stdio -nographic -kernel kernel.elf
int01
a c_irq_handler
a c_irq_handler

(これは動いたけど動かなくなっているのがあるなぁ。)

以上です。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?