Skip to content
Daniele Lacamera edited this page Aug 4, 2016 · 16 revisions

#Running on QEMU#

The requirements to test frosted on synthetic target are:

  • a Linux distribution, or a POSIX-compliant OS which supports the tools described below

How to run the QEMU example synthetic target:

  • Create a working directory for your synthetic frosted
mkdir frosted-qemu
cd frosted-qemu
  • Clone frosted
git clone [email protected]:insane-adding-machines/frosted.git
cd frosted
git submodule init
git submodule update
cd frosted-userland
git submodule init
git submodule update
cd ../..
  • get the latest toolchain
wget https://github.com/insane-adding-machines/crosstool-ng/releases/download/v16.07.003/arm-frosted-eabi-5.3.0_16.07.003.tar.bz2
tar xjf arm-frosted-eabi-5.3.0_16.07.003.tar.bz2
export PATH=`pwd`/arm-frosted-eabi/bin:$PATH
  • Ensure that pre-requisites to compile qemu are in place. On a debian system this is:

apt-get build-dep qemu

  • Get insane-adding-machines modified qemu (with lm3s_virtual target 1M Flash, 256K RAM)
git clone [email protected]:insane-adding-machines/qemu.git
cd qemu
./configure --prefix=`pwd`/../qemu-bin --target-list=arm-softmmu
make
make install
cd ..
export PATH=`pwd`/qemu-bin/bin:$PATH
  • Go back to the frosted directory

cd frosted

  • Use the example frosted kernel pre-defined config for qemu, included in defconfig make defconfig TARGET=qemunet

  • Download the example frosted-userland config to frosted-userland/kconfig/.config

wget https://git.io/vKgDR -O frosted-userland/kconfig/.config

  • Compile frosted

make

  • Run the frosted image on qemu

make qemu

  • If you want to enable tun/tap connectivity, run the "net" version (requires root)

make qemunet


  • Debugging the kernel
    • start qemu in debug mode:

make qemudbg

or, for the net version:

make qemunetdbg

  • start the debugger: From another console run arm-frosted-eabi-gdb or arm-none-eabi-gdb and attach to localhost:3333 to start debugging. You can use the following settings in your local .gdbinit script:
 tar ext :3333
 layout src
 file kernel.elf
 stepi
 focus c
Clone this wiki locally