threadx icon indicating copy to clipboard operation
threadx copied to clipboard

riscv : add riscv qemu virt support and fix fs bit error in mstatus

Open Jer6y opened this issue 1 year ago • 0 comments

Hi , I port threadx to qemu-riscv64-virt and run the demo

I also add toolchain cmake scripts , so we can use cmake like arm to generated libthreadx.a

To Test it

First , Maksure riscv64-unknown-elf- binutils and make is installed , and qemu-system-riscv64 is also required

cd into example_build work

cd ports/risc-v64/gnu/example_build/qemu_virt

use make to compile the demo (make clean can clean the output)

make

If done successfully, we will find A ELF FILE kernel.elf , use qemu to load it

qemu-system-riscv64 -nographic -smp 1 -bios none -m 128M -machine virt -kernel kernel.elf

If success , you will get different thread output the message like this

[UART0] : Uart Init Done, this is Test output!
[Thread] : thread_0_entry is here!
[Thread] : thread_5_entry is here!
[Thread] : thread_3_and_4_entry is here!
[Thread] : thread_3_and_4_entry is here!
[Thread] : thread_6_and_7_entry is here!
[Thread] : thread_6_and_7_entry is here!
[Thread] : thread_1_entry is here!
[Thread] : thread_2_entry is here!
[Thread] : thread_3_and_4_entry is here!
[Thread] : thread_6_and_7_entry is here!
[Thread] : thread_3_and_4_entry is here!
[Thread] : thread_6_and_7_entry is here!
[Thread] : thread_3_and_4_entry is here!
[Thread] : thread_6_and_7_entry is here!
[Thread] : thread_3_and_4_entry is here!
[Thread] : thread_6_and_7_entry is here!
[Thread] : thread_0_entry is here!
[Thread] : thread_5_entry is here!
[Thread] : thread_3_and_4_entry is here!
[Thread] : thread_6_and_7_entry is here!
[Thread] : thread_3_and_4_entry is here!
[Thread] : thread_6_and_7_entry is here!
[Thread] : thread_3_and_4_entry is here!
[Thread] : thread_6_and_7_entry is here!
[Thread] : thread_3_and_4_entry is here!
[Thread] : thread_6_and_7_entry is here!
[Thread] : thread_3_and_4_entry is here!
[Thread] : thread_6_and_7_entry is here!
[Thread] : thread_0_entry is here!
[Thread] : thread_5_entry is here!
[Thread] : thread_3_and_4_entry is here!
[Thread] : thread_6_and_7_entry is here!
[Thread] : thread_3_and_4_entry is here!
[Thread] : thread_6_and_7_entry is here!
[Thread] : thread_3_and_4_entry is here!
[Thread] : thread_6_and_7_entry is here!
[Thread] : thread_3_and_4_entry is here!
[Thread] : thread_6_and_7_entry is here!
[Thread] : thread_3_and_4_entry is here!
[Thread] : thread_6_and_7_entry is here!

PR checklist

  • [x] add riscv qemu virt support , add cmake toolchain script to generate libthreadx.a
  • [x] fix riscv64 contex_resotre bug (when f/d isa is enable)
  • [x] use weak symbol to invalidate _tx_initialize_low_level function

Jer6y avatar Oct 25 '24 12:10 Jer6y