diff --git a/.gitignore b/.gitignore index dd4df19..2212e78 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file +/os*/link_app.S diff --git a/Dockerfile b/Dockerfile index 32c12fe..f4049e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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} diff --git a/os1-ref/Makefile b/os1-ref/Makefile index 5cc5762..5c0c11b 100644 --- a/os1-ref/Makefile +++ b/os1-ref/Makefile @@ -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 diff --git a/os1/Makefile b/os1/Makefile index 1094bbd..5c0c11b 100644 --- a/os1/Makefile +++ b/os1/Makefile @@ -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 diff --git a/os1/src/link_app.S b/os1/src/link_app.S deleted file mode 100644 index e69de29..0000000 diff --git a/os2-ref/Makefile b/os2-ref/Makefile index 255aa89..4988036 100644 --- a/os2-ref/Makefile +++ b/os2-ref/Makefile @@ -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) diff --git a/os2/Makefile b/os2/Makefile index 4e8eef1..03ed718 100644 --- a/os2/Makefile +++ b/os2/Makefile @@ -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) diff --git a/os2/src/link_app.S b/os2/src/link_app.S deleted file mode 100644 index e69de29..0000000 diff --git a/os3-ref/Makefile b/os3-ref/Makefile index f85edc8..4066217 100644 --- a/os3-ref/Makefile +++ b/os3-ref/Makefile @@ -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 $@ diff --git a/os3/Makefile b/os3/Makefile index 68d2b4f..4066217 100644 --- a/os3/Makefile +++ b/os3/Makefile @@ -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 $@ diff --git a/os3/src/link_app.S b/os3/src/link_app.S deleted file mode 100644 index e69de29..0000000 diff --git a/os4-ref/Makefile b/os4-ref/Makefile index cb4668c..82cc170 100644 --- a/os4-ref/Makefile +++ b/os4-ref/Makefile @@ -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 \ No newline at end of file +.PHONY: build env kernel clean run-inner diff --git a/os4/Makefile b/os4/Makefile index 7af0b07..4b68301 100644 --- a/os4/Makefile +++ b/os4/Makefile @@ -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 $@ diff --git a/os4/src/link_app.S b/os4/src/link_app.S deleted file mode 100644 index e69de29..0000000 diff --git a/os5-ref/Makefile b/os5-ref/Makefile index b0f391c..3bc993b 100644 --- a/os5-ref/Makefile +++ b/os5-ref/Makefile @@ -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 \ No newline at end of file +.PHONY: build env kernel clean run-inner diff --git a/os5/Makefile b/os5/Makefile index b0f391c..3bc993b 100644 --- a/os5/Makefile +++ b/os5/Makefile @@ -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 \ No newline at end of file +.PHONY: build env kernel clean run-inner diff --git a/os5/src/link_app.S b/os5/src/link_app.S deleted file mode 100644 index e69de29..0000000 diff --git a/os6-ref/Makefile b/os6-ref/Makefile index 39b8a79..31c21bb 100644 --- a/os6-ref/Makefile +++ b/os6-ref/Makefile @@ -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 \ No newline at end of file +opt-level = 0 diff --git a/os6/Makefile b/os6/Makefile index 7e27aa1..feb9ce1 100644 --- a/os6/Makefile +++ b/os6/Makefile @@ -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 $@ diff --git a/os6/src/link_app.S b/os6/src/link_app.S deleted file mode 100644 index 32748e6..0000000 --- a/os6/src/link_app.S +++ /dev/null @@ -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: diff --git a/os7-ref/Makefile b/os7-ref/Makefile index 7c4723e..d68153a 100644 --- a/os7-ref/Makefile +++ b/os7-ref/Makefile @@ -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 $@ diff --git a/os7/Makefile b/os7/Makefile index 7c4723e..d68153a 100644 --- a/os7/Makefile +++ b/os7/Makefile @@ -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 $@ diff --git a/os7/src/link_app.S b/os7/src/link_app.S deleted file mode 100644 index 32748e6..0000000 --- a/os7/src/link_app.S +++ /dev/null @@ -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: diff --git a/os8-ref/Makefile b/os8-ref/Makefile index c6b63f2..7789c15 100644 --- a/os8-ref/Makefile +++ b/os8-ref/Makefile @@ -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 $@ diff --git a/os8/Makefile b/os8/Makefile index c6b63f2..7789c15 100644 --- a/os8/Makefile +++ b/os8/Makefile @@ -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 $@ diff --git a/os8/src/link_app.S b/os8/src/link_app.S deleted file mode 100644 index 32748e6..0000000 --- a/os8/src/link_app.S +++ /dev/null @@ -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: diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index 289fc8e..0000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -nightly-2022-04-11 \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..021659c --- /dev/null +++ b/rust-toolchain.toml @@ -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"]