-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f7b706
commit 73e89f0
Showing
3 changed files
with
18 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
SRCS ?= loader.c resource.S | ||
NAME ?= loader | ||
_BIN ?= hello.bin | ||
SRCS = loader.c payload.S | ||
NAME = loader | ||
|
||
# Note that the loader should be linked to the start address of flash. | ||
# You should modify your linking option if you want to build the loader yourself. | ||
# Then modify BIN_PATH to a binary starting at 0x80000000 | ||
BIN_PATH = hello-riscv64-mycpu-start-at-0x80000000.bin | ||
ASFLAGS += -DBIN_PATH=\"$(BIN_PATH)\" | ||
|
||
include $(AM_HOME)/Makefile | ||
|
||
payload.S: $(BIN_PATH) | ||
touch $@ | ||
|
||
.PHONY: payload.S |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
.section .rodata | ||
.align 3 | ||
.global program_start, program_end | ||
program_start: | ||
.incbin _BIN | ||
#ifdef BIN_PATH | ||
.incbin BIN_PATH | ||
#endif | ||
program_end: | ||
|