Giter Club home page Giter Club logo

book.rvemu's Introduction

Writing a RISC-V Emulator from Scratch in 10 Steps

Introduction

This is the book for writing a 64-bit RISC-V emulator from scratch in Rust. It shows us how to implement an emulator in 10 steps. You can run xv6, a simple Unix-like OS, in your emulator in the final step.

You'll learn the following basic computer architecture from making an emulator in Rust:

  • Basic RISC-V architecture
  • How to write code in Rust language
  • Privilege levels
  • Exceptions
  • Interrupts
  • Peripheral devices
  • Virtual memory system

The source code is available at d0iasm/rvemu-for-book.

Step Content
Step 1 Setup and Implement Two Instructions
Step 2 RV64I Base Integer Instruction Set
Step 3 Control and Status Registers
Step 4 Privileged Instruction Set
Step 5 Exceptions
Step 6 PLIC (a platform-level interrupt controller) and CLINT (a core-local interrupter)
Step 7 UART (a universal asynchronous receiver-transmitter)
Step 8 Interrupts
Step 9 Virtio
Step 10 Virtual Memory System

Congratulations🎉 Now you can run xv6 in your emulator!

The author is @d0iasm and please feel free to ask and request anything to me via Twitter or GitHub issues!

book.rvemu's People

Contributors

d0iasm avatar horie1024 avatar ichikaway avatar

Watchers

 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.