Git Product home page Git Product logo

nemu's Introduction

NEMU

NEMU(NJU Emulator) is a simple but complete full-system emulator designed for teaching purpose. Currently it supports x86, mips32, and riscv32. To build programs run above NEMU, refer to the AM project.

The main features of NEMU include

  • a small monitor with a simple debugger
    • single step
    • register/memory examination
    • expression evaluation without the support of symbols
    • watch point
    • differential testing with reference design (e.g. QEMU)
    • snapshot
  • CPU core with support of most common used instructions
    • x86
      • real mode is not supported
      • x87 floating point instructions are not supported
    • mips32
      • CP1 floating point instructions are not supported
    • riscv32
      • only RV32IM
  • memory
  • paging
    • TLB is optional (but necessary for mips32)
    • protection is not supported
  • interrupt and exception
    • protection is not supported
  • 5 devices
    • Args Rom, serial, timer, keyboard, VGA
    • most of them are simplified and unprogrammable
  • 2 types of I/O
    • port-mapped I/O and memory-mapped I/O

Howto

Run OpenSBI and Linux

All steps below use source code in RISCVERS

  1. Compile a Linux kernel, with proper SD card driver integrated if you want to run Debian or Fedora. Currently Kernel v4.18 is verified to work.
  2. Convert vmlinux to binary format using objcopy.
  3. Compile OpenSBI using build_linux.sh where vmlinux and dtb path may need a modification. dtb can be compiled with dts files located in dts subdirectory of OpenSBI.
  4. Compile NEMU intepreter. You may want to change default sdcard image path in src/devices/sdcard.c to boot Debian or Fedora.
  5. launch NEMU intepreter and load fw_payload.bin generated by OpenSBI. e.g. ./build/riscv64-nemu-interpreter ~/Xiangshan_Linux/opensbi/build/platform/generic/firmware/fw_payload.bin
  6. If you are using a vmlinux with initramfs, you will likely be greeted with a Hello, otherwise you may see startup logs and finally a login prompt from Debian or Fedora if SD card is configured properly.

nemu's People

Contributors

augustuswilliswang avatar bigwhitedog avatar chenguokai avatar jiangyy avatar lemover avatar ljwljwljwljw avatar poemonsense avatar sashimi-yzh avatar wakafa1 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.