Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

动态内存分配 · GitBook #14

Open
wyfcyx opened this issue Dec 7, 2019 · 7 comments
Open

动态内存分配 · GitBook #14

wyfcyx opened this issue Dec 7, 2019 · 7 comments

Comments

@wyfcyx
Copy link
Collaborator

wyfcyx commented Dec 7, 2019

https://wyfcyx.github.io/rCore_tutorial_doc/chapter3/part2.html

@chyyuu
Copy link
Member

chyyuu commented Dec 10, 2019

可以有一道小题目,kernel截获除零异常。

@wangrunji0408
Copy link
Member

@chyyuu
可以有一道小题目,kernel截获除零异常。

RISC-V 中除零不会触发异常,可以改为截获非法指令异常(例如 mret

@jiegec
Copy link
Member

jiegec commented Mar 8, 2020

这里直接用 trap_handler 可能会有 trap_handler 并非四字节对齐的问题。

@qwtsc
Copy link

qwtsc commented May 25, 2020

文档中riscv依赖也还是没有支持rustc1.45.0 nightly,fork修改了一下由于是rustc版本问题就不pr了,将git依赖替换成如下https://github.com/qwtsc/riscv 即可,Rust丢弃asm宏相关的PR

@luojia65
Copy link

luojia65 commented Jun 5, 2020

Rust 会在函数的开始和结尾加入一些额外的指令,控制栈寄存器等。

这个你可以用#[naked]函数。比如我这个abort函数:https://rust.godbolt.org/z/MYvZR4

@wtyytw0
Copy link

wtyytw0 commented Jun 26, 2020

使用nightly 2020-01-26版本的话,一直显示cannot find llvm_asm macro(感觉理论上不应该),后来用了最新的nightly(06-24),再把sbi.rs, init.rs等里面的asm!(..)改成llvm_asm!(..)就好了

@ghost
Copy link

ghost commented Jul 22, 2020

注意 该依赖似乎放弃了riscv = { git = "https://github.com/rcore-os/riscv", features = ["inline-asm"] } 中 asm!的写法,而转成了llvm_asm! @wtyytw0 的意见修改可以成功运行,但同时需要在lib.rs 中加入 #![feature(llvm_asm)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants