fix: update rust-toolchain file

fix: remove link_app.S
Signed-off-by: YdrMaster <ydrml@hotmail.com>
This commit is contained in:
YdrMaster
2022-10-20 11:02:23 +08:00
parent 5e7f0d1d43
commit 1b44ff002c
28 changed files with 27 additions and 481 deletions

6
.gitignore vendored
View File

@@ -2,11 +2,7 @@
.idea
Cargo.lock
target
os/src/link_app.S
os/last-*
tools
workplace/
os2-ref/src/link_app.S
os3-ref/src/link_app.S
os4-ref/src/link_app.S
os5-ref/src/link_app.S
/os*/link_app.S

View File

@@ -77,9 +77,7 @@ RUN rustup --version && \
# See os1/Makefile `env:` for example.
# This avoids having to wait for these steps each time using a new container.
RUN rustup target add riscv64gc-unknown-none-elf && \
cargo install cargo-binutils --vers ~0.2 && \
rustup component add rust-src && \
rustup component add llvm-tools-preview
cargo install cargo-binutils
# Ready to go
WORKDIR ${HOME}

View File

@@ -23,9 +23,7 @@ $(KERNEL_BIN): kernel
env:
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils --vers ~0.3
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-binutils
kernel:
@cargo build --release

View File

@@ -23,9 +23,7 @@ $(KERNEL_BIN): kernel
env:
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils --vers ~0.2
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-binutils
kernel:
@cargo build --release

View File

View File

@@ -31,9 +31,7 @@ disasm:
env:
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils --vers ~0.3
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-binutils
kernel:
@make -C ../user build TEST=$(TEST) CHAPTER=$(CHAPTER) BASE=$(BASE)

View File

@@ -31,9 +31,7 @@ disasm:
env:
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils --vers ~0.2
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-binutils
kernel:
@make -C ../user build TEST=$(TEST) CHAPTER=$(CHAPTER) BASE=$(BASE)

View File

View File

@@ -29,9 +29,7 @@ $(KERNEL_BIN): kernel
env:
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils --vers ~0.3
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-binutils
$(KERNEL_BIN): kernel
@$(OBJCOPY) $(KERNEL_ELF) --strip-all -O binary $@

View File

@@ -29,9 +29,7 @@ $(KERNEL_BIN): kernel
env:
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils --vers ~0.2
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-binutils
$(KERNEL_BIN): kernel
@$(OBJCOPY) $(KERNEL_ELF) --strip-all -O binary $@

View File

View File

@@ -29,9 +29,7 @@ $(KERNEL_BIN): kernel
env:
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils --vers ~0.3
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-binutils
$(KERNEL_BIN): kernel
@$(OBJCOPY) $(KERNEL_ELF) --strip-all -O binary $@
@@ -59,4 +57,4 @@ debug: build
dbg: build
qemu-system-riscv64 -machine virt -nographic -bios $(BOOTLOADER) -device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA) -s -S
.PHONY: build env kernel clean run-inner
.PHONY: build env kernel clean run-inner

View File

@@ -24,9 +24,7 @@ build: env $(KERNEL_BIN)
env:
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils --vers ~0.2
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-binutils
$(KERNEL_BIN): kernel
@$(OBJCOPY) $(KERNEL_ELF) --strip-all -O binary $@

View File

View File

@@ -25,9 +25,7 @@ build: env $(KERNEL_BIN)
env:
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils --vers ~0.3
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-binutils
$(KERNEL_BIN): kernel
@$(OBJCOPY) $(KERNEL_ELF) --strip-all -O binary $@
@@ -55,4 +53,4 @@ debug: build
dbg: build
qemu-system-riscv64 -machine virt -nographic -bios $(BOOTLOADER) -device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA) -s -S
.PHONY: build env kernel clean run-inner
.PHONY: build env kernel clean run-inner

View File

@@ -25,9 +25,7 @@ build: env $(KERNEL_BIN)
env:
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils --vers ~0.3
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-binutils
$(KERNEL_BIN): kernel
@$(OBJCOPY) $(KERNEL_ELF) --strip-all -O binary $@
@@ -55,4 +53,4 @@ debug: build
dbg: build
qemu-system-riscv64 -machine virt -nographic -bios $(BOOTLOADER) -device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA) -s -S
.PHONY: build env kernel clean run-inner
.PHONY: build env kernel clean run-inner

View File

View File

@@ -31,9 +31,7 @@ fs-img: $(APPS)
env:
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils --vers ~0.3
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-binutils
$(KERNEL_BIN): kernel
@$(OBJCOPY) $(KERNEL_ELF) --strip-all -O binary $@
@@ -68,4 +66,4 @@ dbg: build
[profile.release]
debug = true
opt-level = 0
opt-level = 0

View File

@@ -31,9 +31,7 @@ fs-img: $(APPS)
env:
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils --vers ~0.3
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-binutils
$(KERNEL_BIN): kernel
@$(OBJCOPY) $(KERNEL_ELF) --strip-all -O binary $@

View File

@@ -1,140 +0,0 @@
.align 3
.section .data
.global _num_app
_num_app:
.quad 13
.quad app_0_start
.quad app_1_start
.quad app_2_start
.quad app_3_start
.quad app_4_start
.quad app_5_start
.quad app_6_start
.quad app_7_start
.quad app_8_start
.quad app_9_start
.quad app_10_start
.quad app_11_start
.quad app_12_start
.quad app_12_end
.global _app_names
_app_names:
.string "ch2b_bad_address"
.string "ch2b_bad_instructions"
.string "ch2b_bad_register"
.string "ch2b_hello_world"
.string "ch2b_power_3"
.string "ch2b_power_5"
.string "ch2b_power_7"
.string "ch3_taskinfo"
.string "ch3b_sleep"
.string "ch3b_sleep1"
.string "ch3b_yield0"
.string "ch3b_yield1"
.string "ch3b_yield2"
.section .data
.global app_0_start
.global app_0_end
.align 3
app_0_start:
.incbin "../ci-user/user/build/bin/ch2b_bad_address.bin"
app_0_end:
.section .data
.global app_1_start
.global app_1_end
.align 3
app_1_start:
.incbin "../ci-user/user/build/bin/ch2b_bad_instructions.bin"
app_1_end:
.section .data
.global app_2_start
.global app_2_end
.align 3
app_2_start:
.incbin "../ci-user/user/build/bin/ch2b_bad_register.bin"
app_2_end:
.section .data
.global app_3_start
.global app_3_end
.align 3
app_3_start:
.incbin "../ci-user/user/build/bin/ch2b_hello_world.bin"
app_3_end:
.section .data
.global app_4_start
.global app_4_end
.align 3
app_4_start:
.incbin "../ci-user/user/build/bin/ch2b_power_3.bin"
app_4_end:
.section .data
.global app_5_start
.global app_5_end
.align 3
app_5_start:
.incbin "../ci-user/user/build/bin/ch2b_power_5.bin"
app_5_end:
.section .data
.global app_6_start
.global app_6_end
.align 3
app_6_start:
.incbin "../ci-user/user/build/bin/ch2b_power_7.bin"
app_6_end:
.section .data
.global app_7_start
.global app_7_end
.align 3
app_7_start:
.incbin "../ci-user/user/build/bin/ch3_taskinfo.bin"
app_7_end:
.section .data
.global app_8_start
.global app_8_end
.align 3
app_8_start:
.incbin "../ci-user/user/build/bin/ch3b_sleep.bin"
app_8_end:
.section .data
.global app_9_start
.global app_9_end
.align 3
app_9_start:
.incbin "../ci-user/user/build/bin/ch3b_sleep1.bin"
app_9_end:
.section .data
.global app_10_start
.global app_10_end
.align 3
app_10_start:
.incbin "../ci-user/user/build/bin/ch3b_yield0.bin"
app_10_end:
.section .data
.global app_11_start
.global app_11_end
.align 3
app_11_start:
.incbin "../ci-user/user/build/bin/ch3b_yield1.bin"
app_11_end:
.section .data
.global app_12_start
.global app_12_end
.align 3
app_12_start:
.incbin "../ci-user/user/build/bin/ch3b_yield2.bin"
app_12_end:

View File

@@ -31,9 +31,7 @@ fs-img: $(APPS)
env:
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils --vers ~0.3
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-binutils
$(KERNEL_BIN): kernel
@$(OBJCOPY) $(KERNEL_ELF) --strip-all -O binary $@

View File

@@ -31,9 +31,7 @@ fs-img: $(APPS)
env:
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils --vers ~0.3
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-binutils
$(KERNEL_BIN): kernel
@$(OBJCOPY) $(KERNEL_ELF) --strip-all -O binary $@

View File

@@ -1,140 +0,0 @@
.align 3
.section .data
.global _num_app
_num_app:
.quad 13
.quad app_0_start
.quad app_1_start
.quad app_2_start
.quad app_3_start
.quad app_4_start
.quad app_5_start
.quad app_6_start
.quad app_7_start
.quad app_8_start
.quad app_9_start
.quad app_10_start
.quad app_11_start
.quad app_12_start
.quad app_12_end
.global _app_names
_app_names:
.string "ch2b_bad_address"
.string "ch2b_bad_instructions"
.string "ch2b_bad_register"
.string "ch2b_hello_world"
.string "ch2b_power_3"
.string "ch2b_power_5"
.string "ch2b_power_7"
.string "ch3_taskinfo"
.string "ch3b_sleep"
.string "ch3b_sleep1"
.string "ch3b_yield0"
.string "ch3b_yield1"
.string "ch3b_yield2"
.section .data
.global app_0_start
.global app_0_end
.align 3
app_0_start:
.incbin "../ci-user/user/build/bin/ch2b_bad_address.bin"
app_0_end:
.section .data
.global app_1_start
.global app_1_end
.align 3
app_1_start:
.incbin "../ci-user/user/build/bin/ch2b_bad_instructions.bin"
app_1_end:
.section .data
.global app_2_start
.global app_2_end
.align 3
app_2_start:
.incbin "../ci-user/user/build/bin/ch2b_bad_register.bin"
app_2_end:
.section .data
.global app_3_start
.global app_3_end
.align 3
app_3_start:
.incbin "../ci-user/user/build/bin/ch2b_hello_world.bin"
app_3_end:
.section .data
.global app_4_start
.global app_4_end
.align 3
app_4_start:
.incbin "../ci-user/user/build/bin/ch2b_power_3.bin"
app_4_end:
.section .data
.global app_5_start
.global app_5_end
.align 3
app_5_start:
.incbin "../ci-user/user/build/bin/ch2b_power_5.bin"
app_5_end:
.section .data
.global app_6_start
.global app_6_end
.align 3
app_6_start:
.incbin "../ci-user/user/build/bin/ch2b_power_7.bin"
app_6_end:
.section .data
.global app_7_start
.global app_7_end
.align 3
app_7_start:
.incbin "../ci-user/user/build/bin/ch3_taskinfo.bin"
app_7_end:
.section .data
.global app_8_start
.global app_8_end
.align 3
app_8_start:
.incbin "../ci-user/user/build/bin/ch3b_sleep.bin"
app_8_end:
.section .data
.global app_9_start
.global app_9_end
.align 3
app_9_start:
.incbin "../ci-user/user/build/bin/ch3b_sleep1.bin"
app_9_end:
.section .data
.global app_10_start
.global app_10_end
.align 3
app_10_start:
.incbin "../ci-user/user/build/bin/ch3b_yield0.bin"
app_10_end:
.section .data
.global app_11_start
.global app_11_end
.align 3
app_11_start:
.incbin "../ci-user/user/build/bin/ch3b_yield1.bin"
app_11_end:
.section .data
.global app_12_start
.global app_12_end
.align 3
app_12_start:
.incbin "../ci-user/user/build/bin/ch3b_yield2.bin"
app_12_end:

View File

@@ -31,9 +31,7 @@ fs-img: $(APPS)
env:
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils --vers ~0.3
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-binutils
$(KERNEL_BIN): kernel
@$(OBJCOPY) $(KERNEL_ELF) --strip-all -O binary $@

View File

@@ -31,9 +31,7 @@ fs-img: $(APPS)
env:
(rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET)
cargo install cargo-binutils --vers ~0.3
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-binutils
$(KERNEL_BIN): kernel
@$(OBJCOPY) $(KERNEL_ELF) --strip-all -O binary $@

View File

@@ -1,140 +0,0 @@
.align 3
.section .data
.global _num_app
_num_app:
.quad 13
.quad app_0_start
.quad app_1_start
.quad app_2_start
.quad app_3_start
.quad app_4_start
.quad app_5_start
.quad app_6_start
.quad app_7_start
.quad app_8_start
.quad app_9_start
.quad app_10_start
.quad app_11_start
.quad app_12_start
.quad app_12_end
.global _app_names
_app_names:
.string "ch2b_bad_address"
.string "ch2b_bad_instructions"
.string "ch2b_bad_register"
.string "ch2b_hello_world"
.string "ch2b_power_3"
.string "ch2b_power_5"
.string "ch2b_power_7"
.string "ch3_taskinfo"
.string "ch3b_sleep"
.string "ch3b_sleep1"
.string "ch3b_yield0"
.string "ch3b_yield1"
.string "ch3b_yield2"
.section .data
.global app_0_start
.global app_0_end
.align 3
app_0_start:
.incbin "../ci-user/user/build/bin/ch2b_bad_address.bin"
app_0_end:
.section .data
.global app_1_start
.global app_1_end
.align 3
app_1_start:
.incbin "../ci-user/user/build/bin/ch2b_bad_instructions.bin"
app_1_end:
.section .data
.global app_2_start
.global app_2_end
.align 3
app_2_start:
.incbin "../ci-user/user/build/bin/ch2b_bad_register.bin"
app_2_end:
.section .data
.global app_3_start
.global app_3_end
.align 3
app_3_start:
.incbin "../ci-user/user/build/bin/ch2b_hello_world.bin"
app_3_end:
.section .data
.global app_4_start
.global app_4_end
.align 3
app_4_start:
.incbin "../ci-user/user/build/bin/ch2b_power_3.bin"
app_4_end:
.section .data
.global app_5_start
.global app_5_end
.align 3
app_5_start:
.incbin "../ci-user/user/build/bin/ch2b_power_5.bin"
app_5_end:
.section .data
.global app_6_start
.global app_6_end
.align 3
app_6_start:
.incbin "../ci-user/user/build/bin/ch2b_power_7.bin"
app_6_end:
.section .data
.global app_7_start
.global app_7_end
.align 3
app_7_start:
.incbin "../ci-user/user/build/bin/ch3_taskinfo.bin"
app_7_end:
.section .data
.global app_8_start
.global app_8_end
.align 3
app_8_start:
.incbin "../ci-user/user/build/bin/ch3b_sleep.bin"
app_8_end:
.section .data
.global app_9_start
.global app_9_end
.align 3
app_9_start:
.incbin "../ci-user/user/build/bin/ch3b_sleep1.bin"
app_9_end:
.section .data
.global app_10_start
.global app_10_end
.align 3
app_10_start:
.incbin "../ci-user/user/build/bin/ch3b_yield0.bin"
app_10_end:
.section .data
.global app_11_start
.global app_11_end
.align 3
app_11_start:
.incbin "../ci-user/user/build/bin/ch3b_yield1.bin"
app_11_end:
.section .data
.global app_12_start
.global app_12_end
.align 3
app_12_start:
.incbin "../ci-user/user/build/bin/ch3b_yield2.bin"
app_12_end:

View File

@@ -1 +0,0 @@
nightly-2022-04-11

5
rust-toolchain.toml Normal file
View File

@@ -0,0 +1,5 @@
[toolchain]
profile = "minimal"
channel = "nightly-2022-08-05"
components = ["rust-src", "llvm-tools-preview", "rustfmt", "clippy"]
targets = ["riscv64gc-unknown-none-elf"]