From db0c174f524589fc8ee36f3e07c358a7ff2349c8 Mon Sep 17 00:00:00 2001 From: Yifan Wu Date: Wed, 18 Nov 2020 14:48:13 +0800 Subject: [PATCH] Add first user program hello_world.rs --- user/.cargo/config | 7 + user/.idea/modules.xml | 8 ++ user/.idea/user.iml | 11 ++ user/.idea/vcs.xml | 6 + user/.idea/workspace.xml | 126 ++++++++++++++++++ user/Cargo.lock | 5 + user/Cargo.toml | 9 ++ user/src/bin/hello_world.rs | 11 ++ user/src/console.rs | 29 ++++ user/src/lang_items.rs | 10 ++ user/src/lib.rs | 23 ++++ user/src/linker.ld | 26 ++++ user/src/syscall.rs | 20 +++ user/target/.rustc_info.json | 1 + user/target/CACHEDIR.TAG | 3 + user/target/debug/.cargo-lock | 0 user/target/release/.cargo-lock | 0 .../riscv64gc-unknown-none-elf/CACHEDIR.TAG | 3 + .../debug/.cargo-lock | 0 .../dep-lib-user_lib | Bin 0 -> 83 bytes .../invoked.timestamp | 1 + .../user_lib-ac05933ae451745f/lib-user_lib | 1 + .../lib-user_lib.json | 1 + .../user_lib-b4124dce0aef8d75/bin-hello_world | 1 + .../bin-hello_world.json | 1 + .../dep-bin-hello_world | Bin 0 -> 35 bytes .../invoked.timestamp | 1 + .../debug/deps/hello_world-b4124dce0aef8d75 | Bin 0 -> 36472 bytes .../debug/deps/hello_world-b4124dce0aef8d75.d | 5 + .../deps/libuser_lib-ac05933ae451745f.rlib | Bin 0 -> 164604 bytes .../deps/libuser_lib-ac05933ae451745f.rmeta | Bin 0 -> 7010 bytes .../debug/deps/user_lib-ac05933ae451745f.d | 10 ++ .../debug/hello_world | Bin 0 -> 36472 bytes .../debug/hello_world.d | 1 + .../1cyby92ahhct29sj.o | Bin 0 -> 9688 bytes .../255pyf8oqm5o60pl.o | Bin 0 -> 4008 bytes .../dep-graph.bin | Bin 0 -> 25790 bytes .../query-cache.bin | Bin 0 -> 6510 bytes .../work-products.bin | Bin 0 -> 151 bytes .../s-ft6035czf2-st25v7.lock | 0 .../10az8widxhjxhgtx.o | Bin 0 -> 5976 bytes .../147k6ue95x1syi05.o | Bin 0 -> 6544 bytes .../2d9zyaaiobk4zurh.o | Bin 0 -> 13160 bytes .../2fjxqfs0exyqds3t.o | Bin 0 -> 4816 bytes .../2u1772ea9ier1rws.o | Bin 0 -> 9680 bytes .../2zryyes59x4c5kja.o | Bin 0 -> 9656 bytes .../3axu0toiprwvp1ss.o | Bin 0 -> 16368 bytes .../44k5o6bbhtowka37.o | Bin 0 -> 4136 bytes .../4payedb2d7c3qhja.o | Bin 0 -> 5432 bytes .../4xy4bjb8bpitqt95.o | Bin 0 -> 6760 bytes .../4yg7fz2yw8qkqegw.o | Bin 0 -> 10664 bytes .../51exv9oflntflb3a.o | Bin 0 -> 5248 bytes .../57i3fcg2ujvn6o85.o | Bin 0 -> 12320 bytes .../5azlg8fuivp6rnzc.o | Bin 0 -> 4144 bytes .../5db448brgvcabcw0.o | Bin 0 -> 16136 bytes .../dep-graph.bin | Bin 0 -> 291706 bytes .../fg8sfd226batyv8.o | Bin 0 -> 5168 bytes .../l0mj1km0wl40coo.o | Bin 0 -> 16528 bytes .../query-cache.bin | Bin 0 -> 52180 bytes .../work-products.bin | Bin 0 -> 942 bytes .../s-ft6035cacm-q0p3wr.lock | 0 .../debug/libuser_lib.d | 1 + .../debug/libuser_lib.rlib | Bin 0 -> 164604 bytes .../release/.cargo-lock | 0 .../dep-lib-user_lib | Bin 0 -> 83 bytes .../invoked.timestamp | 1 + .../user_lib-0fdba27c1d499ab2/lib-user_lib | 1 + .../lib-user_lib.json | 1 + .../user_lib-65513b09835dd0af/bin-hello_world | 1 + .../bin-hello_world.json | 1 + .../dep-bin-hello_world | Bin 0 -> 35 bytes .../invoked.timestamp | 1 + .../release/deps/hello_world-65513b09835dd0af | Bin 0 -> 24016 bytes .../deps/hello_world-65513b09835dd0af.d | 5 + .../deps/libuser_lib-0fdba27c1d499ab2.rlib | Bin 0 -> 23362 bytes .../deps/libuser_lib-0fdba27c1d499ab2.rmeta | Bin 0 -> 6735 bytes .../release/deps/user_lib-0fdba27c1d499ab2.d | 10 ++ .../release/hello_world | Bin 0 -> 24016 bytes .../release/hello_world.d | 1 + 79 files changed, 343 insertions(+) create mode 100644 user/.cargo/config create mode 100644 user/.idea/modules.xml create mode 100644 user/.idea/user.iml create mode 100644 user/.idea/vcs.xml create mode 100644 user/.idea/workspace.xml create mode 100644 user/Cargo.lock create mode 100644 user/Cargo.toml create mode 100644 user/src/bin/hello_world.rs create mode 100644 user/src/console.rs create mode 100644 user/src/lang_items.rs create mode 100644 user/src/lib.rs create mode 100644 user/src/linker.ld create mode 100644 user/src/syscall.rs create mode 100644 user/target/.rustc_info.json create mode 100644 user/target/CACHEDIR.TAG create mode 100644 user/target/debug/.cargo-lock create mode 100644 user/target/release/.cargo-lock create mode 100644 user/target/riscv64gc-unknown-none-elf/CACHEDIR.TAG create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/.cargo-lock create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/.fingerprint/user_lib-ac05933ae451745f/dep-lib-user_lib create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/.fingerprint/user_lib-ac05933ae451745f/invoked.timestamp create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/.fingerprint/user_lib-ac05933ae451745f/lib-user_lib create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/.fingerprint/user_lib-ac05933ae451745f/lib-user_lib.json create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/.fingerprint/user_lib-b4124dce0aef8d75/bin-hello_world create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/.fingerprint/user_lib-b4124dce0aef8d75/bin-hello_world.json create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/.fingerprint/user_lib-b4124dce0aef8d75/dep-bin-hello_world create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/.fingerprint/user_lib-b4124dce0aef8d75/invoked.timestamp create mode 100755 user/target/riscv64gc-unknown-none-elf/debug/deps/hello_world-b4124dce0aef8d75 create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/deps/hello_world-b4124dce0aef8d75.d create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/deps/libuser_lib-ac05933ae451745f.rlib create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/deps/libuser_lib-ac05933ae451745f.rmeta create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/deps/user_lib-ac05933ae451745f.d create mode 100755 user/target/riscv64gc-unknown-none-elf/debug/hello_world create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/hello_world.d create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/hello_world-v11id1s4qxvx/s-ft6035czf2-st25v7-2h0amvxnf2nxj/1cyby92ahhct29sj.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/hello_world-v11id1s4qxvx/s-ft6035czf2-st25v7-2h0amvxnf2nxj/255pyf8oqm5o60pl.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/hello_world-v11id1s4qxvx/s-ft6035czf2-st25v7-2h0amvxnf2nxj/dep-graph.bin create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/hello_world-v11id1s4qxvx/s-ft6035czf2-st25v7-2h0amvxnf2nxj/query-cache.bin create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/hello_world-v11id1s4qxvx/s-ft6035czf2-st25v7-2h0amvxnf2nxj/work-products.bin create mode 100755 user/target/riscv64gc-unknown-none-elf/debug/incremental/hello_world-v11id1s4qxvx/s-ft6035czf2-st25v7.lock create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/10az8widxhjxhgtx.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/147k6ue95x1syi05.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/2d9zyaaiobk4zurh.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/2fjxqfs0exyqds3t.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/2u1772ea9ier1rws.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/2zryyes59x4c5kja.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/3axu0toiprwvp1ss.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/44k5o6bbhtowka37.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/4payedb2d7c3qhja.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/4xy4bjb8bpitqt95.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/4yg7fz2yw8qkqegw.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/51exv9oflntflb3a.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/57i3fcg2ujvn6o85.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/5azlg8fuivp6rnzc.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/5db448brgvcabcw0.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/dep-graph.bin create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/fg8sfd226batyv8.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/l0mj1km0wl40coo.o create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/query-cache.bin create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr-u07fqb241s45/work-products.bin create mode 100755 user/target/riscv64gc-unknown-none-elf/debug/incremental/user_lib-1rlqc1v49k4ja/s-ft6035cacm-q0p3wr.lock create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/libuser_lib.d create mode 100644 user/target/riscv64gc-unknown-none-elf/debug/libuser_lib.rlib create mode 100644 user/target/riscv64gc-unknown-none-elf/release/.cargo-lock create mode 100644 user/target/riscv64gc-unknown-none-elf/release/.fingerprint/user_lib-0fdba27c1d499ab2/dep-lib-user_lib create mode 100644 user/target/riscv64gc-unknown-none-elf/release/.fingerprint/user_lib-0fdba27c1d499ab2/invoked.timestamp create mode 100644 user/target/riscv64gc-unknown-none-elf/release/.fingerprint/user_lib-0fdba27c1d499ab2/lib-user_lib create mode 100644 user/target/riscv64gc-unknown-none-elf/release/.fingerprint/user_lib-0fdba27c1d499ab2/lib-user_lib.json create mode 100644 user/target/riscv64gc-unknown-none-elf/release/.fingerprint/user_lib-65513b09835dd0af/bin-hello_world create mode 100644 user/target/riscv64gc-unknown-none-elf/release/.fingerprint/user_lib-65513b09835dd0af/bin-hello_world.json create mode 100644 user/target/riscv64gc-unknown-none-elf/release/.fingerprint/user_lib-65513b09835dd0af/dep-bin-hello_world create mode 100644 user/target/riscv64gc-unknown-none-elf/release/.fingerprint/user_lib-65513b09835dd0af/invoked.timestamp create mode 100755 user/target/riscv64gc-unknown-none-elf/release/deps/hello_world-65513b09835dd0af create mode 100644 user/target/riscv64gc-unknown-none-elf/release/deps/hello_world-65513b09835dd0af.d create mode 100644 user/target/riscv64gc-unknown-none-elf/release/deps/libuser_lib-0fdba27c1d499ab2.rlib create mode 100644 user/target/riscv64gc-unknown-none-elf/release/deps/libuser_lib-0fdba27c1d499ab2.rmeta create mode 100644 user/target/riscv64gc-unknown-none-elf/release/deps/user_lib-0fdba27c1d499ab2.d create mode 100755 user/target/riscv64gc-unknown-none-elf/release/hello_world create mode 100644 user/target/riscv64gc-unknown-none-elf/release/hello_world.d diff --git a/user/.cargo/config b/user/.cargo/config new file mode 100644 index 00000000..d55502a6 --- /dev/null +++ b/user/.cargo/config @@ -0,0 +1,7 @@ +[build] +target = "riscv64gc-unknown-none-elf" + +[target.riscv64gc-unknown-none-elf] +rustflags = [ + "-Clink-args=-Tsrc/linker.ld", +] \ No newline at end of file diff --git a/user/.idea/modules.xml b/user/.idea/modules.xml new file mode 100644 index 00000000..d9fb14e4 --- /dev/null +++ b/user/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/user/.idea/user.iml b/user/.idea/user.iml new file mode 100644 index 00000000..c254557e --- /dev/null +++ b/user/.idea/user.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/user/.idea/vcs.xml b/user/.idea/vcs.xml new file mode 100644 index 00000000..6c0b8635 --- /dev/null +++ b/user/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/user/.idea/workspace.xml b/user/.idea/workspace.xml new file mode 100644 index 00000000..e8abb271 --- /dev/null +++ b/user/.idea/workspace.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + +