Step by step, learn to develop an operating system on RISC-V

Overview

Step by step, learn to develop an operating system on RISC-V

Introduction

This course is used to teach and demonstrate how to write a simple operating system kernel for the RISC-V platform from scratch. Released under the BSD 2-Clause license (For details, please read the LICENSE file under the root directory of this repository).

Operating environment

All demo codes have been verified under the following equipment environment:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.2 LTS
Release:	20.04
Codename:	focal
$ uname -r
5.8.0-45-generic

There may be dependent libraries that need to be installed manually. If you are prompted that other libraries and dependencies are missing during the operation, please install them by yourself according to the prompts.

$ sudo apt update 
$ sudo apt install build-essential git gitk vim libfdt-dev libsdl2-dev

The experiment requires some running tools, pre-compiled binary files have been provided, the specific installation steps are described as follows:

First, create a working directory, and then enter the directory.

$ mkdir $HOME/ws
$ cd $HOME/ws

Download the development tool package tools.tar.gz, the download address is:https://share.weiyun.com/nyTqAGKh

After downloading, copy the file to $HOME/ws and unzip it.

$ tar xzf tools.tar.gz

Add the following path to $HOME/.bashrc

export PATH="$PATH:$HOME/ws/tools/gcc/bin:$HOME/ws/tools/qemu/bin"

Re-import $HOME/.bashrc or restart the system to make the configuration effective.

Construction and usage

  • make:Compile and build
  • make run:Start qemu and run
  • make debug:Start debugging
  • make code:Disassemble to view binary code
  • make clean:cleanup

For specific use, please refer to the Makefile under the specific sub-project.

References

The design of this course refers to the following network resources, thank you :)

You might also like...
learn how to use BPF/eBPF
learn how to use BPF/eBPF

学习Linux BPF/eBPF 编程 打造学习BPF知识的中文社区。

This repository is a summary of the basic knowledge of recruiting job seekers and beginners in the direction of C/C++ technology, including language, program library, data structure, algorithm, system, network, link loading library, interview experience, recruitment, recommendation, etc.
This repository is a summary of the basic knowledge of recruiting job seekers and beginners in the direction of C/C++ technology, including language, program library, data structure, algorithm, system, network, link loading library, interview experience, recruitment, recommendation, etc.

📚 C/C++ 技术面试基础知识总结,包括语言、程序库、数据结构、算法、系统、网络、链接装载库等知识及面试经验、招聘、内推等信息。This repository is a summary of the basic knowledge of recruiting job seekers and beginners in the direction of C/C++ technology, including language, program library, data structure, algorithm, system, network, link loading library, interview experience, recruitment, recommendation, etc.

System Programming 2021 Spring

sp-labs System Programming Labs 2021 Spring Repo 文件说明 lab: 实验指导书 & 题目。 answer_template: 提供对应 lab 的参考作答模板。建议将图片放至对应的img/文件夹下,使用 Markdown 编写,最后通过 Typora

Background Music, a macOS audio utility: automatically pause your music, set individual apps' volumes and record system audio.
Background Music, a macOS audio utility: automatically pause your music, set individual apps' volumes and record system audio.

Background Music macOS audio utility Overview Auto-pause music Application volume Recording system audio Download Build and Install Uninstall Troubles

Hello, I created a real banking system with creating each customer a private file.

bankingsystem Hello, I created a real banking system for my school project with creating each customer a private file. Your Transaction Code is your l

Open-source graph editor, with built-it step-by-step Dijkstra's Algorithm.
Open-source graph editor, with built-it step-by-step Dijkstra's Algorithm.

Visual Dijkstra - Simple visual graph editor, with built-in step-by-step Dijkstra's algorithm Visual Dijkstra is a free and open-source tool, designed

exp2swift translator which translates STEP schema files described in ISO 10303-11 STEP EXPRESS language to the Swift programing language.

STEPswiftcode/ exp2swift exp2swift translator which translates STEP schema files described in ISO 10303-11 STEP EXPRESS language to the Swift programi

Step-by-step guide through the abstract and complex universe of Fragment Shaders.

The Book of Shaders by Patricio Gonzalez Vivo and Jen Lowe This is a gentle step-by-step guide through the abstract and complex universe of Fragment S

A step by step example of creating your own React Native TurboModule.

Discovering Turbo Modules Note: This example was made in RN 0.63. Some things have changed since then, but the good news is that now the setup should

Operating system model using an assembler RISC-V RV32I instruction set.(development)

General Information Operating system model using an assembler RISC-V RV32I instruction set.(development) С++ Standard - c++17 gcc 9.3.0(Linux,unicode)

An operating system for RISC V, featuring a small microkernel

ilo pali An operating system for RISC V, featuring a small microkernel. Build instructions Install the Newlib GNU RISC-V toolchain and do make to buil

A FREE Windows C development course where we will learn the Win32API and reverse engineer each step utilizing IDA Free in both an x86 and x64 environment.
A FREE Windows C development course where we will learn the Win32API and reverse engineer each step utilizing IDA Free in both an x86 and x64 environment.

FREE Reverse Engineering Self-Study Course HERE Hacking Windows The book and code repo for the FREE Hacking Windows book by Kevin Thomas. FREE Book Do

KePOS is a 64-bit operating system. Design and implement your own operating system
KePOS is a 64-bit operating system. Design and implement your own operating system

KePOS is a 64-bit operating system. The purpose of this system is to combine the theoretical knowledge and practice of the operating system, and to deepen the understanding of the operating system.

Hobby operating system I'm making to learn OS development.

NewKern A 64-bit, higher half kernel I'm making to learn OS dev. Features Right now not so many: runtime undefined behavior checking higher half (-2GB

Learn basic elements in C++ and learn CMake

learn-cpp-cmake Learn basic elements in C++ and learn CMake This repo has code from several sources. If you think we have violated any copyright law o

Dining philosophers problem is a problem created by Edsger Wybe Dijkstra in 1965 to explain the deadlock state of an operating system, which is traditionally commonly introduced in lectures on operating systems
Dining philosophers problem is a problem created by Edsger Wybe Dijkstra in 1965 to explain the deadlock state of an operating system, which is traditionally commonly introduced in lectures on operating systems

42-philosophers Dining philosophers problem is a problem created by Edsger Wybe Dijkstra in 1965 to explain the deadlock state of an operating system,

GCC/gcov code coverage data extraction from the actual embedded system, without requiring a file system, or an operating system, or standard C libraries.

GCC/gcov code coverage data extraction from the actual embedded system, without requiring a file system, or an operating system, or standard C libraries.

oneAPI DPC++ Library (oneDPL) https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/dpc-library.html

oneAPI DPC++ Library (oneDPL) The oneAPI DPC++ Library (oneDPL) aims to work with the oneAPI DPC++ Compiler to provide high-productivity APIs to devel

A library to develop kernel level Windows payloads for post HVCI era
A library to develop kernel level Windows payloads for post HVCI era

A library to develop kernel level Windows payloads for post HVCI era

Comments
  • 關於 External Interrupt

    關於 External Interrupt

    Hi there!

    關於外部中斷,我有一些疑惑,還望各位指教,在介紹第 11 章的外部中斷時,提到了我們可以對 PLIC 設置外部中斷做到 UART 輸入的功能,針對這個地方,我有兩點疑問:

    1. 我參考這一資訊,將外部中斷的處理方式移植到了 mini-riscv-os 上,但是我發現即使不在 OS 開機時也能使用 UART 輸入,想請問我是不是遺漏了什麼重要觀念
    2. 呈上題,如果不開啟外部中斷也能使用 UART 輸入,那在什麼情況下才會產出 IRQ = 10 的情況呢?

    謝謝。

    opened by ianchen0119 2
  • 在task_yield()调用r_mhartid()导致非法指令异常

    在task_yield()调用r_mhartid()导致非法指令异常

    Hi, 我正在尝试使用Rust实现RVOS。在实现第13章抢占式多任务的时候,在task_yield()中调用r_mhartid()导致 illegal instruction ,通过调试发现是csrr $0, mhartid这条指令导致的异常。 应该是与csrr这个指令有关,因为在测试csrw的时候也不行。 我的代码在这:https://github.com/RobotHuang/rvos-rust/blob/master/os/src/sched.rs#L145 Thanks

    opened by uran0sH 1
Owner
null
Educational Operating System

Educational Operating System

Kota UCHIDA 412 Sep 13, 2022
An operating system, but it only plays Tetris.

TETRIS-OS: An operating system that only plays Tetris. Video with an explanation of the development process. Features: It's Tetris. 32-bit (x86) Fully

null 3.5k Jul 13, 2021
A unix operating system written from scratch in c++

A unix operating system made from scratch using c++

pranaOS 138 Aug 14, 2022
Tutorial: Writing a "bare metal" operating system for Raspberry Pi 4

Tutorial: Writing a "bare metal" operating system for Raspberry Pi 4

Adam Greenwood-Byrne 2.4k Sep 20, 2022
📘 CHAPTER-6 📘 10 days of C++. Learn the basics of C++. Other topics will be covered in chapter-7

CPP-BOOK CHAPTER - 6: 10 days of C++. Learn the basics of C++. Other topics will be covered in the next chapter(premium) /* Multi-line Comment */ // S

CodeMacrocosm 8 Oct 25, 2021
I am planning to add a beginner friendly path for my Juniors to Learn DSA and I will try to provide solutions of every problem also. We can add codeChef Challenge solutions also

DSA-Path-And-Important-Questions I am planning to add a beginner friendly path for my Juniors to Learn DSA Are you a Newbie in programming and want to

Arpit Jain 30 Sep 7, 2022
C++ OpenGL 3D Game Tutorial Series - Learn to code an OpenGL 3D Game in C++ from scratch

C++ OpenGL 3D Game Tutorial Series is a YouTube Tutorial Series, whose purpose is to help all those who want to take their first steps in the game dev

 PardCode 101 Sep 19, 2022
My projects while i learn C language.

Coding Exercises Projects that i made while i am learning C language. Exercise 1: prime-numbers.c It is a program that checks whether the given number

Berkay Şahin 2 Apr 12, 2022
A place where you can learn and practise various Problems and algorithms

Problem-Solving Problem solving is an art of solving some real time challenges. And this is a place to get started, you can find many problems to solv

Google DSC, GVP Chapter 10 Apr 22, 2022
A project uses for beginners, who wants to learn basic Cpp.

Learning Basic Cpp The basic project for who wants to learn Cpp. Notes: All the files are coded using Microsoft Visual Studio 2019. If you want to cod

null 1 Jan 28, 2022