Git Product home page Git Product logo

rustsbi-k210's Introduction

RustSBI K210 平台支持包

这个平台支持包包含较多的平台兼容功能,允许在K210上运行1.12版本标准的操作系统内核。

二进制包下载

请参阅发行页面:这里

使用说明

请先下载ktool.py,放置在xtask目录下,即文件位置为xtask/ktool.py

运行以下指令,来直接在目标开发板运行代码。

cargo k210

这个平台支持包会启动位于0x80020000的操作系统内核,并在a1寄存器提供一个简单的设备树。 操作系统内核应当使用《RISC-V指令集架构 第二卷:特权级指令》的1.12版本,而非芯片支持的1.9.1版本。

兼容性使用文档

稍后放出。包括sfence.vma指令、页异常编号转发等等。

立即体验

先下载代码,然后直接运行内核测试:

cargo test

版权声明

项目的测试框架使用了KTool。这个项目使用Apache 2.0协议开源,感谢KTool项目和它的维护者们!

Reference implementaion K210 includes Kendryte K210 DTS file from Western Digital, this file is (C) Western Digital Corporation or its affiliates under BSD-2-Clause license.

rustsbi-k210's People

Contributors

luojia65 avatar wyfcyx avatar yztz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rustsbi-k210's Issues

Handle Load/StoreMisalignment Exception in RustSBI manually on k210 platform

Due to the hardware limit of Kendryte k210 chip(it is okay on qemu), when we want to load a 64-bit value in to a general-purpose register(using ld instruction), we have to guarantee that the address is aligned to 8 bytes. However, it is somehow strict so that many librarys do not consider it, leading to some incompatibility(e.g. xmas-elf crate). The same issue may occurs in other instructions, such as lh/lw/sh/sw/sd, but I have not try them yet.

Should we handle them in RustSBI by performing some aligned memory access manually and then merging the results?

version 0.0.2终端输出存在异常

以rCore-Tutorial-v3 ch5为例,在sipeed的maix bit开发板上测试:
图片
使用原版本rustsbi在shell中输入不存在的文件时,回显如下:
图片
使用新版本rustsbi:
图片
在shell中输入不存在的文件时,终端回显异常字符,且此后每次回车都会回显:
图片

非法访问M模式寄存器时,RustSBI不能输出报错信息

非法访问M模式寄存器时,RustSBI不能输出报错信息

背景&预期

处于S/U模式的程序,是不能直接访问M模式寄存器的。SBI应该在非法访问时,提供报错信息。
0.0.1版本的k210支持包已经实现了该功能。但是在0.0.2版本的支持包里,这个功能消失了。

复现步骤

1.使用RustSBI支持包(bin)作为程序的bootloader
2.在程序的入口点直接访问M模式的寄存器 (可以直接在uCoreRV64的代码上改)
csrr a5, mstatus
3.打包k210支持包和自己的程序,烧录到k210
4.如果是 这个支持包(0.1.0),会输出以下报错信息:

ICB3LKU `(KFD5INA369O

5.如果是0.0.1/0.0.2版本的支持包,则没有报错信息,程序也会卡住。

MFQ_@3MX7}T(CP7D_GGPQ

麻烦洛佳大佬有时间看看,感谢

xtask size 没实现

看了源码,发现 xtask size 没实现出来

这个 offset 一定得是 0x2000 吗?

0x2000是怎么计算出来的?

我不会写rust,只会看,不然就直接提PR了hhh

另外,大佬再写一个 指定内核project目录,直接生成需要烧写的bin文件咯。(如果内核编译环境 和 烧录环境不是同一个环境,就还要手动合并一次)

xv6-k210

在运行xv6-k210 os时,出现下面错误

$ make run platform=qemu
[rustsbi] RustSBI version 0.1.1
.______ __ __ .___________. .. __
| _ \ | | | | / | | / || _ \ | |
| |
) | | | | | | (-------| |----| (----| |_) || | | / | | | | \ \ | | \ \ | _ < | | | |\ \----.| --' |.----) | | | .----) | | |
) || |
| | `.| _/ |
/ || |_/ |/ ||

[rustsbi] Platform: QEMU (Version 0.1.0)
[rustsbi] misa: RV64ACDFIMSU
[rustsbi] mideleg: 0x222
[rustsbi] medeleg: 0xb1ab
[rustsbi-dtb] Hart count: cluster0 with 2 cores
[rustsbi] Kernel entry: 0x80200000
[rustsbi-panic] hart 0 panicked at 'invalid instruction, mepc: 0000000080200000, instruction: 0000000000000000', src/main.rs:459:17
[rustsbi-panic] system shutdown scheduled due to RustSBI panic

请问一下是哪里的问题呢,谢谢

no serial port found

➜ rustsbi-k210 ls /dev/ttyUSB0
/dev/ttyUSB0
➜ rustsbi-k210 cargo k210
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running target/debug/xtask k210
xtask: no serial port found; program exit

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.