Switch ok with debug mode apps, implement sys_exit correctly later.
This commit is contained in:
parent
4e8059e222
commit
3f3e6b2b99
16 changed files with 244 additions and 147 deletions
|
@ -1,5 +1,5 @@
|
|||
TARGET := riscv64gc-unknown-none-elf
|
||||
MODE := release
|
||||
MODE := debug
|
||||
APP_DIR := src/bin
|
||||
TARGET_DIR := target/$(TARGET)/$(MODE)
|
||||
APPS := $(wildcard $(APP_DIR)/*.rs)
|
||||
|
@ -9,7 +9,7 @@ BINS := $(patsubst $(APP_DIR)/%.rs, $(TARGET_DIR)/%.bin, $(APPS))
|
|||
OBJDUMP := rust-objdump --arch-name=riscv64
|
||||
OBJCOPY := rust-objcopy --binary-architecture=riscv64
|
||||
|
||||
elf:
|
||||
elf: $(APPS)
|
||||
@python3 build.py
|
||||
|
||||
binary: elf
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import os
|
||||
|
||||
base_address = 0x80040000
|
||||
base_address = 0x80100000
|
||||
step = 0x20000
|
||||
linker = 'src/linker.ld'
|
||||
|
||||
|
@ -18,7 +18,7 @@ for app in apps:
|
|||
lines.append(line)
|
||||
with open(linker, 'w+') as f:
|
||||
f.writelines(lines)
|
||||
os.system('cargo build --bin %s --release' % app)
|
||||
os.system('cargo build --bin %s' % app)
|
||||
print('[build.py] application %s start with address %s' %(app, hex(base_address+step*app_id)))
|
||||
with open(linker, 'w+') as f:
|
||||
f.writelines(lines_before)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
OUTPUT_ARCH(riscv)
|
||||
ENTRY(_start)
|
||||
|
||||
BASE_ADDRESS = 0x80040000;
|
||||
BASE_ADDRESS = 0x80100000;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue