添加rtthread相关代码
This commit is contained in:
@@ -27,12 +27,50 @@ CFLAG=[
|
||||
"-msave-restore"
|
||||
]
|
||||
|
||||
INC=[
|
||||
"-I./riscv/rtthread/libcpu/risc-v/common",
|
||||
"-I./riscv/rtthread/include",
|
||||
"-I./riscv/startup",
|
||||
"-I./riscv/rtthread/components/drivers/include"
|
||||
]
|
||||
|
||||
SRC=[
|
||||
"riscv/main.c",
|
||||
"riscv/test.c",
|
||||
"riscv/interrupt.c",
|
||||
"riscv/start.S",
|
||||
"riscv/trap.S"
|
||||
"riscv/startup/main.c",
|
||||
"riscv/startup/test.c",
|
||||
# "riscv/startup/interrupt.c",
|
||||
"riscv/startup/start.S",
|
||||
# "riscv/startup/trap.S",
|
||||
"riscv/startup/rtthread_irq.c",
|
||||
|
||||
"riscv/rtthread/libcpu/risc-v/common/atomic_riscv.c",
|
||||
"riscv/rtthread/libcpu/risc-v/common/context_gcc.S",
|
||||
"riscv/rtthread/libcpu/risc-v/common/cpuport.c",
|
||||
"riscv/rtthread/libcpu/risc-v/common/interrupt_gcc.S",
|
||||
"riscv/rtthread/libcpu/risc-v/common/trap_common.c",
|
||||
|
||||
"riscv/rtthread/src/clock.c",
|
||||
"riscv/rtthread/src/components.c",
|
||||
"riscv/rtthread/src/cpu.c",
|
||||
"riscv/rtthread/src/idle.c",
|
||||
"riscv/rtthread/src/ipc.c",
|
||||
"riscv/rtthread/src/irq.c",
|
||||
"riscv/rtthread/src/kservice.c",
|
||||
"riscv/rtthread/src/mem.c",
|
||||
"riscv/rtthread/src/memheap.c",
|
||||
"riscv/rtthread/src/mempool.c",
|
||||
"riscv/rtthread/src/object.c",
|
||||
"riscv/rtthread/src/scheduler_comm.c",
|
||||
# "riscv/rtthread/src/scheduler_mp.c",
|
||||
"riscv/rtthread/src/scheduler_up.c",
|
||||
"riscv/rtthread/src/signal.c",
|
||||
"riscv/rtthread/src/slab.c",
|
||||
"riscv/rtthread/src/thread.c",
|
||||
"riscv/rtthread/src/timer.c",
|
||||
|
||||
"riscv/rtthread/src/klibc/kstdio.c",
|
||||
"riscv/rtthread/src/klibc/kstring.c",
|
||||
|
||||
"riscv/rtthread/components/drivers/core/device.c"
|
||||
]
|
||||
|
||||
LD_FILE="riscv.ld"
|
||||
@@ -44,7 +82,9 @@ OUTPUT="output"
|
||||
if __name__ == "__main__":
|
||||
if not os.path.exists(OUTPUT):
|
||||
os.mkdir(OUTPUT)
|
||||
os.system(f"{CC} {' '.join(CFLAG)} {' '.join(SRC)} -T{LD_FILE} -Wall -Wextra -nostartfiles -Wl,-Map,\"{TARGET}.map\" -o {TARGET}.elf")
|
||||
cmd=f"{CC} {' '.join(CFLAG)} {' '.join(INC)} {' '.join(SRC)} -T{LD_FILE} -Wall -Wextra -nostartfiles -Wl,-Map,\"{TARGET}.map\" -o {TARGET}.elf"
|
||||
print(cmd)
|
||||
os.system(cmd)
|
||||
os.system(f"{OBJCPY} -O binary {TARGET}.elf {TARGET}.bin")
|
||||
os.system(f"{OBJCPY} -O ihex {TARGET}.elf {TARGET}.hex")
|
||||
os.system(f"{OBJDUMP} -d {TARGET}.elf > {TARGET}.lst")
|
||||
|
Reference in New Issue
Block a user