-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ivan Velickovic <[email protected]>
- Loading branch information
1 parent
e135a26
commit 5574001
Showing
6 changed files
with
103 additions
and
2 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
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
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,55 @@ | ||
# | ||
# Copyright 2021, Breakaway Consulting Pty. Ltd. | ||
# | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
# | ||
ifeq ($(strip $(BUILD_DIR)),) | ||
$(error BUILD_DIR must be specified) | ||
endif | ||
|
||
ifeq ($(strip $(MICROKIT_SDK)),) | ||
$(error MICROKIT_SDK must be specified) | ||
endif | ||
|
||
ifeq ($(strip $(MICROKIT_BOARD)),) | ||
$(error MICROKIT_BOARD must be specified) | ||
endif | ||
|
||
ifeq ($(strip $(MICROKIT_CONFIG)),) | ||
$(error MICROKIT_CONFIG must be specified) | ||
endif | ||
|
||
TOOLCHAIN := aarch64-none-elf | ||
|
||
CPU := cortex-a53 | ||
|
||
CC := $(TOOLCHAIN)-gcc | ||
LD := $(TOOLCHAIN)-ld | ||
AS := $(TOOLCHAIN)-as | ||
MICROKIT_TOOL ?= $(MICROKIT_SDK)/bin/microkit | ||
|
||
HELLO_OBJS := hello.o | ||
|
||
BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) | ||
|
||
IMAGES := hello.elf | ||
CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g3 -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include | ||
LDFLAGS := -L$(BOARD_DIR)/lib | ||
LIBS := -lmicrokit -Tmicrokit.ld | ||
|
||
IMAGE_FILE = $(BUILD_DIR)/loader.img | ||
REPORT_FILE = $(BUILD_DIR)/report.txt | ||
|
||
all: $(IMAGE_FILE) | ||
|
||
$(BUILD_DIR)/%.o: %.c Makefile | ||
$(CC) -c $(CFLAGS) $< -o $@ | ||
|
||
$(BUILD_DIR)/%.o: %.s Makefile | ||
$(AS) -g3 -mcpu=$(CPU) $< -o $@ | ||
|
||
$(BUILD_DIR)/hello.elf: $(addprefix $(BUILD_DIR)/, $(HELLO_OBJS)) | ||
$(LD) $(LDFLAGS) $^ $(LIBS) -o $@ | ||
|
||
$(IMAGE_FILE) $(REPORT_FILE): $(addprefix $(BUILD_DIR)/, $(IMAGES)) hello.system | ||
$(MICROKIT_TOOL) hello.system --search-path $(BUILD_DIR) --board $(MICROKIT_BOARD) --config $(MICROKIT_CONFIG) -o $(IMAGE_FILE) -r $(REPORT_FILE) |
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,16 @@ | ||
/* | ||
* Copyright 2021, Breakaway Consulting Pty. Ltd. | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
#include <stdint.h> | ||
#include <microkit.h> | ||
|
||
void init(void) | ||
{ | ||
microkit_dbg_puts("hello, world\n"); | ||
} | ||
|
||
void notified(microkit_channel ch) | ||
{ | ||
} |
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,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright 2021, Breakaway Consulting Pty. Ltd. | ||
SPDX-License-Identifier: BSD-2-Clause | ||
--> | ||
<system> | ||
<protection_domain name="hello" priority="254"> | ||
<program_image path="hello.elf" /> | ||
</protection_domain> | ||
</system> |
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