80 lines
2.3 KiB
TOML
80 lines
2.3 KiB
TOML
#
|
|
# SPDX-License-Identifier: BlueOak-1.0.0
|
|
#
|
|
# Copyright (c) Berkus Decker <berkus+vesper@metta.systems>
|
|
#
|
|
# Build nucleus
|
|
#
|
|
[env]
|
|
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
|
|
|
|
[tasks.build-kernel-binary]
|
|
workspace = false
|
|
dependencies = ["build-device"]
|
|
env = { "BINARY_FILE" = "${KERNEL_ELF}" }
|
|
run_task = "build-custom-binary"
|
|
|
|
[tasks.kernel]
|
|
alias = "build-kernel-binary"
|
|
|
|
[tasks.build]
|
|
alias = "build-kernel-binary"
|
|
|
|
[tasks.qemu]
|
|
clear = true
|
|
alias = "qemu-kernel"
|
|
|
|
[tasks.qemu-kernel]
|
|
env = { "QEMU_RUNNER_OPTS" = "${QEMU_SERIAL_OPTS}", "TARGET_DTB" = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/targets/bcm2710-rpi-3-b-plus.dtb" }
|
|
extend = "qemu-runner"
|
|
|
|
[tasks.qemu-gdb]
|
|
env = { "QEMU_RUNNER_OPTS" = "${QEMU_SERIAL_OPTS} ${QEMU_DISASM_OPTS} ${QEMU_GDB_OPTS}", "TARGET_DTB" = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/targets/bcm2710-rpi-3-b-plus.dtb" }
|
|
extend = "qemu-runner"
|
|
|
|
[tasks.zellij-nucleus]
|
|
env = { "KERNEL_BIN" = "${KERNEL_BIN}" }
|
|
run_task = "zellij-config"
|
|
|
|
[tasks.gdb]
|
|
dependencies = ["build", "build-kernel-binary", "gdb-config"]
|
|
env = { "RUST_GDB" = "${GDB}" }
|
|
script = [
|
|
"exec < /dev/tty && pipx run gdbgui -g \"rust-gdb -x ${GDB_CONNECT_FILE} ${KERNEL_ELF}\""
|
|
]
|
|
|
|
[tasks.install-nm]
|
|
install_crate = { crate_name = "cargo-binutils", binary = "rust-nm", test_arg = ["--help"] }
|
|
|
|
[tasks.install-rustfilt]
|
|
install_crate = { crate_name = "rustfilt", binary = "rustfilt", test_arg = ["--help"] }
|
|
|
|
[tasks.nm]
|
|
dependencies = ["build", "kernel-binary", "install-nm", "install-rustfilt"]
|
|
script = [
|
|
"${NM} ${KERNEL_ELF} | sort -k 1 | rustfilt"
|
|
]
|
|
|
|
[tasks.sdcard] # kernel-sdcard ?
|
|
dependencies = ["build", "build-kernel-binary"]
|
|
script_runner = "@duckscript"
|
|
script = [
|
|
'''
|
|
kernelImage = set "kernel8.img"
|
|
cp ${KERNEL_BIN} ${VOLUME}/${kernelImage}
|
|
echo 🔄 Copied nucleus to ${VOLUME}/${kernelImage}
|
|
'''
|
|
]
|
|
|
|
[tasks.hopper]
|
|
clear = true
|
|
alias = "kernel-hopper"
|
|
|
|
[tasks.kernel-hopper]
|
|
dependencies = ["build", "build-kernel-binary"]
|
|
# The cmd line below causes a bug in hopper, see https://www.dropbox.com/s/zyw5mfx0bepcjb1/hopperv4-RAW-bug.mov?dl=0
|
|
#"hopperv4 --loader RAW --base-address 0x80000 --entrypoint 0x80000 --file-offset 0 --plugin arm --cpu aarch64 --variant generic --contains-code true --executable ${KERNEL_BIN}"
|
|
script = [
|
|
"hopperv4 --loader ELF --executable ${KERNEL_ELF}"
|
|
]
|