lab1报错集锦
root@b347e8e9e0d1:/lab0/os# cargo build
Updating git repository `https://github.com/rcore-os/riscv`
error: failed to get `riscv` as a dependency of package `os v0.1.0 (/lab0/os)`
Caused by:
failed to load source for dependency `riscv`
Caused by:
Unable to update https://github.com/rcore-os/riscv
Caused by:
failed to fetch into: /root/.cargo/git/db/riscv-ab2abd16c438337b
If your environment requires git authentication or proxying, try enabling `git-fetch-with-cli`
https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli
Caused by:
SSL error: received early EOF; class=Ssl (16); code=Eof (-20)
因为挂了vpn,似乎连不上GitHub?(雾
断掉后,报错消失
error[E0412]: cannot find type `Scause` in this scope
--> src/interrupt/handler.rs:25:56
|
25 | pub fn handle_interrupt(context: &mut Context, scause: Scause, stval: usize) {
| ^^^^^^ not found in this scope
|
help: consider importing one of these items
|
1 | use crate::interrupt::context::Scause;
|
1 | use riscv::register::scause::Scause;
|
warning: unused import: `scause::Scause`
--> src/interrupt/context.rs:1:41
|
1 | use riscv::register::{sstatus::Sstatus, scause::Scause};
| ^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
error: aborting due to previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0412`.
error: could not compile `os`.
To learn more, run the command again with --verbose.
Makefile:20: recipe for target 'kernel' failed
make: *** [kernel] Error 101
参考云微的解决办法加入“use riscv::register::scause::Scause;”后继续报错
root@b347e8e9e0d1:/lab0/os# cargo build
Compiling os v0.1.0 (/lab0/os)
warning: unused import: `scause::Scause`
--> src/interrupt/context.rs:1:41
|
1 | use riscv::register::{sstatus::Sstatus, scause::Scause};
| ^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused variable: `context`
--> src/interrupt/handler.rs:25:25
|
25 | pub fn handle_interrupt(context: &mut Context, scause: Scause, stval: usize) {
| ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_context`
|
= note: `#[warn(unused_variables)]` on by default
warning: unused variable: `stval`
--> src/interrupt/handler.rs:25:64
|
25 | pub fn handle_interrupt(context: &mut Context, scause: Scause, stval: usize) {
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_stval`
error: linking with `rust-lld` failed: exit code: 1
|
= note: "...
>>> referenced by 9acqm0oomv27yz6
>>> /lab0/os/target/riscv64imac-unknown-none-elf/debug/deps/os-93c809aeb6888d3a.9acqm0oomv27yz6.rcgu.o:(.text.entry+0x8)
error: aborting due to previous error; 3 warnings emitted
error: could not compile `os`.
To learn more, run the command again with --verbose.