os-workshop
os-workshop copied to clipboard
Rust timer example
OK, I think this branch is reasonably ready to merge into main, provided @dbt signs off on being able to build it on his system.
Still failing for me, I'm guessing I'm missing a weird path dependency because I still have all the necessary compiler packages installed to build the C stuff.
% cargo clean
% git clean -fdx
% cargo build
Compiling libc v0.2.126
Compiling memchr v2.5.0
Compiling glob v0.3.0
Compiling proc-macro2 v1.0.39
Compiling cfg-if v1.0.0
Compiling unicode-ident v1.0.0
Compiling log v0.4.17
Compiling regex-syntax v0.6.26
Compiling minimal-lexical v0.2.1
Compiling compiler_builtins v0.1.71
Compiling unicode-width v0.1.9
Compiling humantime v2.1.0
Compiling vec_map v0.8.2
Compiling ansi_term v0.12.1
Compiling strsim v0.8.0
Compiling bitflags v1.3.2
Compiling either v1.6.1
Compiling termcolor v1.1.3
Compiling bindgen v0.59.2
Compiling cc v1.0.73
Compiling rustc-hash v1.1.0
Compiling peeking_take_while v0.1.2
Compiling shlex v1.1.0
Compiling lazy_static v1.4.0
Compiling syn v1.0.95
Compiling core v0.0.0 (/home/dbt/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
Compiling lazycell v1.3.0
Compiling libloading v0.7.3
Compiling textwrap v0.11.0
Compiling clang-sys v1.3.2
Compiling quote v1.0.18
Compiling aho-corasick v0.7.18
Compiling nom v7.1.1
Compiling ex-timer v0.1.0 (/home/dbt/Projects/OS/os-workshop/rust/ex-timer)
Compiling atty v0.2.14
Compiling which v4.2.5
Compiling clap v2.34.0
Compiling regex v1.5.6
Compiling env_logger v0.9.0
Compiling cexpr v0.6.0
Compiling tiny-rt-macros v0.1.0 (/home/dbt/Projects/OS/os-workshop/rust/tiny-rt-macros)
Compiling tiny-rt v0.1.0 (/home/dbt/Projects/OS/os-workshop/rust/tiny-rt)
Compiling rustc-std-workspace-core v1.99.0 (/home/dbt/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
Compiling cty v0.2.2
error: failed to run custom build command for `tiny-rt v0.1.0 (/home/dbt/Projects/OS/os-workshop/rust/tiny-rt)`
Caused by:
process didn't exit successfully: `/home/dbt/Projects/OS/os-workshop/rust/target/debug/build/tiny-rt-d299a17e28995c0f/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-changed=../../external/vgafonts.c
cargo:rerun-if-changed=platform_bindings.h
cargo:rerun-if-changed=build.rs
cargo:rustc-link-arg=-Tmake/app.ram.ld
cargo:rustc-link-arg=-melf32lriscv
cargo:rustc-link-search=/home/dbt/Projects/OS/os-workshop/rust/target/riscv32ima-unknown-none-elf/debug/build/tiny-rt-7eb4ad6a0c5dd89c/out
--- stderr
./../../hw/inc/hw/platform.h:43:10: fatal error: 'stdint.h' file not found
./../../hw/inc/hw/platform.h:43:10: fatal error: 'stdint.h' file not found, err: true
thread 'main' panicked at 'Could not generate Rust bindings from platform_bindings.h: ()', tiny-rt/build.rs:38:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
%
Well, telling bindgen to pretend to be an assembler didn't break anything, so if you can verify that works for you, call it good?