justfile 933 B

123456789101112131415161718192021222324252627282930
  1. target := "riscv64imac-unknown-none-elf"
  2. mode := "debug"
  3. build-path := "../../target/" + target + "/" + mode + "/"
  4. rustsbi-elf := build-path + "rustsbi-k210"
  5. rustsbi-bin := build-path + "rustsbi-k210.bin"
  6. test-kernel-elf := build-path + "test-kernel"
  7. test-kernel-bin := build-path + "test-kernel.bin"
  8. fused-bin := build-path + "k210-fused.bin"
  9. k210-serialport := "COM17"
  10. objdump := "riscv64-unknown-elf-objdump"
  11. objcopy := "rust-objcopy --binary-architecture=riscv64"
  12. build: rustsbi test-kernel
  13. @{{objcopy}} {{rustsbi-elf}} --strip-all -O binary {{rustsbi-bin}}
  14. rustsbi:
  15. @cargo build --target={{target}}
  16. test-kernel:
  17. @just -f "../../test-kernel/justfile" build
  18. run: build
  19. @cp {{rustsbi-bin}} {{fused-bin}}
  20. @dd if={{test-kernel-bin}} of={{fused-bin}} bs=128k seek=1
  21. @python ./kflash.py --port {{k210-serialport}} -b 1500000 --terminal {{fused-bin}}
  22. asm: build
  23. @{{objdump}} -D {{rustsbi-elf}} | less