QEMU platform SBI support implementation, using RustSBI

Overview

QEMU support using RustSBI

Compile and run with:

cargo qemu

When running cargo qemu, the test kernel will build and run. Expected output should be:

xtask: mode: Debug
   Compiling rustsbi-qemu v0.1.0 (D:\RustProjects\rustsbi-qemu\rustsbi-qemu)
    Finished dev [unoptimized + debuginfo] target(s) in 1.09s
    Finished dev [unoptimized + debuginfo] target(s) in 0.23s
[rustsbi] RustSBI version 0.2.0-alpha.3
.______       __    __      _______.___________.  _______..______   __
|   _  \     |  |  |  |    /       |           | /       ||   _  \ |  |
|  |_)  |    |  |  |  |   |   (----`---|  |----`|   (----`|  |_)  ||  |
|      /     |  |  |  |    \   \       |  |      \   \    |   _  < |  |
|  |\  \----.|  `--'  |.----)   |      |  |  .----)   |   |  |_)  ||  |
| _| `._____| \______/ |_______/       |__|  |_______/    |______/ |__|

[rustsbi] Implementation: RustSBI-QEMU Version 0.0.1
[rustsbi-dtb] Hart count: cluster0 with 1 cores
[rustsbi] misa: RV64ACDFIMSU
[rustsbi] mideleg: ssoft, stimer, sext (0x222)
[rustsbi] medeleg: ima, ia, bkpt, la, sa, uecall, ipage, lpage, spage (0xb1ab)
[rustsbi] pmp0: 0x80000000 ..= 0x800fffff (rwx)
[rustsbi] pmp1: 0x80200000 ..= 0x802fffff (rwx)
[rustsbi] pmp2: 0x0 ..= 0xfffffffffffffffc (---)
[rustsbi] enter supervisor 0x80200000
<< Test-kernel: Hart id = 0, DTB physical address = 0x87e00000
>> Test-kernel: Testing base extension
<< Test-kernel: Base extension version: 1
<< Test-kernel: SBI specification version: 2
<< Test-kernel: SBI implementation Id: 4
<< Test-kernel: SBI implementation version: 200
<< Test-kernel: Device mvendorid: 0
<< Test-kernel: Device marchid: 0
<< Test-kernel: Device mimpid: 0
>> Test-kernel: Testing SBI instruction emulation
<< Test-kernel: Current time: 31918a
>> Test-kernel: Trigger illegal exception
<< Test-kernel: Value of scause: Exception(IllegalInstruction)
<< Test-kernel: Illegal exception delegate success
<< Test-kernel: SBI test SUCCESS, shutdown

Run test kernel

Run with:

cargo test

It will run RustSBI-QEMU with a test kernel. The test kernel will test all SBI functions, its command emulation and other features. If it succeeds, there would be output like:

running 1 test
    Finished dev [unoptimized + debuginfo] target(s) in 0.14s
   Compiling test-kernel v0.1.0 (D:\RustProjects\rustsbi-qemu\test-kernel)
    Finished dev [unoptimized + debuginfo] target(s) in 0.61s
test run_test_kernel ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.31s

License

This project is licensed under Mulan PSL v2.

Copyright (c) 2021 Wuxiang Zhi Feng Team
RustSBI-QEMU is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
         http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
Releases(v0.0.1)
  • v0.0.1(May 23, 2021)

    This is the first release of rearranged RustSBI-QEMU project. It fully supports RISC-V Privileged Specification v1.11, and adapts to RISC-V SBI specification v0.2.

    This project targets to provide an SBI environment and a test suite on QEMU, hereby provided as an example for further RustSBI implementations.

    Each release contains an ELF file and a binary file. Install the binary into target, and use the ELF to help debugging if needed.

    Source code(tar.gz)
    Source code(zip)
    rustsbi-qemu(2.32 MB)
    rustsbi-qemu.bin(107.94 KB)
Owner
RustSBI
Extensible, 100% Rust RISC-V bootloader environment
RustSBI
Mirror of https://gitlab.redox-os.org/redox-os/redox

Redox is an operating system written in Rust, a language with focus on safety and high performance. Redox, following the microkernel design, aims to b

Redox OS 13.3k Jun 13, 2021
A tiny 32 bit kernel written in Rust

rustboot A tiny 32 bit kernel written in Rust. I was inspired to download Rust and try to do this after seeing zero.rs - a stub that lets Rust program

Charlie Somerville 1.4k Jun 10, 2021
💻 An x86_64 kernel in the works

BruhOS a basic x86_64 kernel in the works. cool stuff written in rust boots with any stivale2-compliant bootloader framebuffer bitmap font renderer pm

Safin Singh 9 Jun 8, 2021
A language-based OS to run Rust on bare metal

RustOS A simple, language-based OS. Current features: Simple VGA for seeing output Some Rust libraries (core, alloc, collections) already in Working (

null 68 Jan 24, 2021
A language-based OS to run Rust on bare metal

RustOS A simple, language-based OS. Current features: Simple VGA for seeing output Some Rust libraries (core, alloc, collections) already in Working (

null 388 May 7, 2021
Aero is a new modern, unix based operating system. It is being developed for educational purposes.

Areo Aero is a new modern, unix based operating system written in Rust and is being developed for educational purposes. Aero follows the monolithic ke

Anhad Singh 16 Jun 13, 2021
Open Source Rust kernel; Runs WASM and WASI as lightweight containers.

?? etheryal Kernel etheryal kernel is an Open Source capability-based Kernel written in the Rust programming language. The kernel allows implementing

null 15 Jun 4, 2021
A new operating system kernel with Linux binary compatibility written in Rust.

Kerla Kerla is a monolithic operating system kernel from scratch in Rust which aims to be compatible with the Linux ABI, that is, runs Linux binaries

Seiya Nuta 28 Jun 8, 2021
Basic Rust kernel using Limine

Rust Limine Barebones This is a small kernel that boots using Limine. Build First of all, download Rust ! (I guess you already did it if you are here

Quentincestino 10 Jun 5, 2021
(Going to be) A microkernel that implements a WebAssembly "usermode" that runs in Ring 0.

Read this (from the creator of Nebulet) Hi everyone, It's been a while since I've looked at this repository. Nebulet is not in active development, and

Nebulet 2.2k Jun 8, 2021
A Rust version of the Weenix OS

Reenix This is the start of a unix like operating system written in Rust. It is based on the Weenix Operating system written for Brown's CS167/9. At t

Alex Light 293 May 26, 2021
The Stupid Operating System

Stupid Operating System SOS is a simple, tiny toy OS implemented in Rust. I'm writing this mostly for fun, to learn more about OS design and kernel ha

SOS 224 Jun 7, 2021
A comparison of operating systems written in Rust

Rust OS comparison A comparison of operating systems written in Rust. There are several open source operating systems written in Rust. Most of them ar

Markus Kohlhase 312 Jun 5, 2021
Experimental kernel for embedded devices written in Rust

bkernel is an experimental kernel for embedded devices written in Rust. I'm mostly trying out Rust now to see how it applies to kernel development. Pr

Alexey Shmalko 77 Apr 15, 2021