Skip to content

Commit

Permalink
Improve Dockerfile and update dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Spinale <[email protected]>
  • Loading branch information
nspin committed May 2, 2024
1 parent ccbecf7 commit d48c6ef
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 87 deletions.
78 changes: 39 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,39 @@ BUILD ?= build

build_dir := $(BUILD)

.PHONY: none
none:

.PHONY: clean
clean:
rm -rf $(build_dir)

sel4_prefix := $(SEL4_INSTALL_DIR)

# Kernel loader binary artifacts provided by Docker container:
# - `sel4-kernel-loader`: The loader binary, which expects to have a payload appended later via
# binary patch.
# - `sel4-kernel-loader-add-payload`: CLI which appends a payload to the loader.
loader_artifacts_dir := /deps/bin
loader_artifacts_dir := $(SEL4_INSTALL_DIR)/bin
loader := $(loader_artifacts_dir)/sel4-kernel-loader
loader_cli := $(loader_artifacts_dir)/sel4-kernel-loader-add-payload

.PHONY: none
none:

.PHONY: clean
clean:
rm -rf $(build_dir)

app_crate := example
app := $(build_dir)/$(app_crate).elf
app_intermediate := $(build_dir)/$(app_crate).intermediate

$(app): $(app_intermediate)
$(app): $(app).intermediate

# SEL4_TARGET_PREFIX is used by build.rs scripts of various rust-sel4 crates to locate seL4
# configuration and libsel4 headers.
.INTERMDIATE: $(app_intermediate)
$(app_intermediate):
.INTERMDIATE: $(app).intermediate
$(app).intermediate:
SEL4_PREFIX=$(sel4_prefix) \
cargo build \
-Z build-std=core,alloc,compiler_builtins \
-Z build-std-features=compiler-builtins-mem \
--target aarch64-sel4 \
--target-dir $(abspath $(build_dir)/target) \
--target-dir $(build_dir)/target \
--out-dir $(build_dir) \
--target aarch64-sel4 \
-p $(app_crate)

image := $(build_dir)/image.elf
Expand All @@ -56,8 +55,9 @@ $(image): $(app) $(loader) $(loader_cli)

qemu_cmd := \
qemu-system-aarch64 \
-machine virt,virtualization=on -cpu cortex-a57 -m 1024 \
-nographic -serial mon:stdio \
-machine virt,virtualization=on -cpu cortex-a57 -m size=1G \
-serial mon:stdio \
-nographic \
-kernel $(image)

.PHONY: run
Expand Down
Loading

0 comments on commit d48c6ef

Please sign in to comment.