Giter VIP home page Giter VIP logo

evisor's Introduction

eVisor

Build

eVisor is a light-weight Bare Metal Hypervisor (Type 1) written in C++. This project is aimed for embedded use (ARM64 devices) and educational purposes.

eVisor demo video @ Youtube - NuttX runs on Raspberry Pi4

eVisor demo

Supported devices

  • Raspberry Pi 4 Model B (BCM2711 / aarch64 only)
  • QEMU (ARM64)

TODOs

  • Switch to clang/llvm from gcc
  • Support multi CPU cores
  • Fix temporary implementation of memory management APIs like kmm_malloc
  • Add Hypervisor system call APIs like KVM
  • Full support for vCPU interrupts
  • Support GIC version 3 and 4
  • Improve scheduling algorithm
  • Improve mmc device driver (SD data transfer speed)
  • Support Linux OS
  • Restructuring / refactoring source code

System requrements

$ sudo apt install cmake g++-aarch64-linux-gnu

How to build

Cross-building for ARM64 on x86_64

mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/cross-toolchain-gcc-aarch64.cmake \
      -DCMAKE_BUILD_TYPE={Debug|Release} \
      -DBOARD={raspi4|qemu} \
      -DTEST_GUEST={serial|test_app|nuttx|linux}

Examples

Raspberry Pi4 + NuttX (Guest OS)

Building

mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/cross-toolchain-gcc-aarch64.cmake \
         -DCMAKE_BUILD_TYPE=Release -DBOARD=raspi4 -DTEST_GUEST=nuttx
cmake --build .

Running

Setup SD card for Rasberry Pi4 (See config/raspi4/config.txt for the detail settings):

cp config/raspi4/config.txt <path_to_sdcard>/boot

Copy NuttX image file to the SD card:

cp examples/nuttx/nuttx.bin <path_to_sdcard>/boot

Copy eVisor image file to the SD card:

cp build/kernel.bin <path_to_sdcard>/boot/kernel.bin

QEMU + NuttX (Guest OS)

Install QEMU

sudo apt install qemu-system-arm 

Building

mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/cross-toolchain-gcc-aarch64.cmake \
         -DCMAKE_BUILD_TYPE=Release -DBOARD=qemu -DTEST_GUEST=nuttx
cmake --build .

Running

qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \
  -machine virt,virtualization=on,gic-version=2 -net none \
  -chardev stdio,id=con,mux=on -serial chardev:con -mon chardev=con,mode=readline \
  -kernel ./kernel.elf -m 1G

How to debug on QEMU

qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \
  -machine virt,virtualization=on,gic-version=2 -net none \
  -chardev stdio,id=con,mux=on -serial chardev:con -mon chardev=con,mode=readline \
  -kernel ./kernel.elf -m 1G \
  -d mmu,in_asm,guest_errors,int,exec,page -D qemu_trace.log

Special thanks!

Special thanks the followings since I particularly referred to them in the early stage of development.

evisor's People

Contributors

hidenorimatsubayashi avatar yangshunyong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.