You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After compiling a complete Fuchsia OS, we can execute the following commands to run the native emulator FEMU : cd $FUCHSIA_DIR fx emu -N
But this way we don't know what FEMU is actually doing, and we can't run FEMU outside the Fuchsia build environment.
So I picked out these files and directories FEMU needs. And organized into LIST A below.
Copy the Fuchsia files and directories in LIST A to LinuxOS without Fuchsia build environment. Keep the directory structure.
Setup network: sudo ip tuntap add dev qemu mode tap user $USER sudo ifconfig qemu up
Then run Fuchsia Emulator(FEMU) with ssh access:
tools/devshell/emu -N
You can also add parameters to accelerate graphic: --host-gpu , using the host GPU --software-gpu ,software rendering using SwiftShader
prebuilt/third_party/aemu/linux-x64/emulator will be called. See the detailed operating parameters:
Normally, the following command can run the Fuchsia QEMU: fx qemu -- -s
Alternatively, We can construct a QEMU excution environment for Zircon.
Add these files and directories in LIST B below. Keep the directory structure.
Run the following command to be able to attach with GDB later:
tools/devshell/qemu -- -s
fuchsia/prebuilt/third_party/qemu/linux-x64/bin/qemu-system-x86_64 will be called.
The detailed QEMU operating parameters:
According to the detailed QEMU operating parameters, we can manually generate the required files.
Generate initrd file and drive file: fuchsia/out/default.zircon/tools/zbi --compressed=zstd -o ./fuchsia-ssh.zbi fuchsia/out/default/fuchsia.zbi --entry data/ssh/authorized_keys=fuchsia/.ssh/authorized_keys
At this time we can manually modify the QEMU parameters. For example, to replace kernel or file system. fuchsia/prebuilt/third_party/qemu/linux-x64/bin/qemu-system-x86_64 -kernel fuchsia/out/default.zircon/multiboot.bin -initrd ./fuchsia-ssh.zbi -m 2G -display none -drive file=./fvm.blk,format=raw,if=none,id=mydisk -device ich9-ahci,id=ahci -device ide-drive,drive=mydisk,bus=ahci.0 -serial stdio -append 'kernel.serial=legacy kernel.halt-on-panic=true ' -s
The text was updated successfully, but these errors were encountered:
elliott10
changed the title
Cherry-pick standalone Fuchsia/Zircon Emulator/QEMU from the Fuchsia source code
Cherry-pick standalone Fuchsia/Zircon Emulator/QEMU from the Fuchsia build environment
Jul 7, 2020
A Standalone Fuchsia Emulator
After compiling a complete Fuchsia OS, we can execute the following commands to run the native emulator FEMU :
cd $FUCHSIA_DIR
fx emu -N
But this way we don't know what FEMU is actually doing, and we can't run FEMU outside the Fuchsia build environment.
So I picked out these files and directories FEMU needs. And organized into LIST A below.
Copy the Fuchsia files and directories in LIST A to LinuxOS without Fuchsia build environment. Keep the directory structure.
Setup network:
sudo ip tuntap add dev qemu mode tap user $USER
sudo ifconfig qemu up
Then run Fuchsia Emulator(FEMU) with ssh access:
You can also add parameters to accelerate graphic:
--host-gpu
, using the host GPU--software-gpu
,software rendering using SwiftShaderprebuilt/third_party/aemu/linux-x64/emulator
will be called. See the detailed operating parameters:Run&Debug Zircon under QEMU
Normally, the following command can run the Fuchsia QEMU:
fx qemu -- -s
Alternatively, We can construct a QEMU excution environment for Zircon.
Add these files and directories in LIST B below. Keep the directory structure.
Run the following command to be able to attach with GDB later:
fuchsia/prebuilt/third_party/qemu/linux-x64/bin/qemu-system-x86_64
will be called.The detailed QEMU operating parameters:
According to the detailed QEMU operating parameters, we can manually generate the required files.
Generate initrd file and drive file:
fuchsia/out/default.zircon/tools/zbi --compressed=zstd -o ./fuchsia-ssh.zbi fuchsia/out/default/fuchsia.zbi --entry data/ssh/authorized_keys=fuchsia/.ssh/authorized_keys
source fuchsia/tools/devshell/lib/fvm.sh HOST_OUT_DIR=$PWD/fuchsia/out/default/host_x64 fx-fvm-extend-image fuchsia/out/default/obj/build/images/fvm.blk ./fvm.blk
At this time we can manually modify the QEMU parameters. For example, to replace kernel or file system.
fuchsia/prebuilt/third_party/qemu/linux-x64/bin/qemu-system-x86_64 -kernel fuchsia/out/default.zircon/multiboot.bin -initrd ./fuchsia-ssh.zbi -m 2G -display none -drive file=./fvm.blk,format=raw,if=none,id=mydisk -device ich9-ahci,id=ahci -device ide-drive,drive=mydisk,bus=ahci.0 -serial stdio -append 'kernel.serial=legacy kernel.halt-on-panic=true ' -s
Now we can debug the kernel with "-s" parameter.
zircon.elf-gdb.py
is gdb's Zircon debugging script.LIST A for FEMU
LIST B for Zircon using QEMU
The text was updated successfully, but these errors were encountered: