diff options
author | Jeremy Soller <jeremy@system76.com> | 2021-01-19 12:13:02 -0700 |
---|---|---|
committer | Jeremy Soller <jeremy@system76.com> | 2021-01-19 12:13:02 -0700 |
commit | e47ba0615d47e5ebbf93c69234c56fb0d9a28daf (patch) | |
tree | ffb8b0027fe5a7b704d5af493c4be2dd441e795f | |
parent | 03c66042b2fc9892fb6801243ad92e3abfa81ceb (diff) |
Build kernel_live for aarch64
-rwxr-xr-x | aarch64.sh | 10 | ||||
-rw-r--r-- | initfs_live.toml | 16 | ||||
-rw-r--r-- | mk/kernel.mk | 12 |
3 files changed, 28 insertions, 10 deletions
@@ -5,6 +5,7 @@ set -ex MACHINE=virt U_BOOT="build/u-boot/${MACHINE}.bin" +IMAGE="build/kernel_live.uimage" case "${MACHINE}" in raspi3) U_BOOT_CONFIG=rpi_3_defconfig @@ -13,7 +14,7 @@ case "${MACHINE}" in IMAGE_ADDR=0x01000000 QEMU_ARGS=( -M raspi3 - -device "loader,file=build/kernel.uimage,addr=${IMAGE_ADDR},force-raw=on" + -device "loader,file=${IMAGE},addr=${IMAGE_ADDR},force-raw=on" -kernel "${U_BOOT}" -nographic -serial null @@ -30,7 +31,7 @@ case "${MACHINE}" in -M virt -cpu cortex-a57 -bios "${U_BOOT}" - -device "loader,file=build/kernel.uimage,addr=${IMAGE_ADDR},force-raw=on" + -device "loader,file=${IMAGE},addr=${IMAGE_ADDR},force-raw=on" -nographic -serial mon:stdio -s @@ -67,6 +68,7 @@ touch kernel/src/arch/aarch64/init/pre_kstart/early_init.S make build/kernel make build/initfs.tag make build/filesystem.bin +make build/kernel_live mkimage \ -A arm64 \ @@ -76,8 +78,8 @@ mkimage \ -a "${LOAD_ADDR}" \ -e "${ENTRY_ADDR}" \ -n "Redox kernel (qemu AArch64 ${MACHINE})" \ - -d build/kernel \ - build/kernel.uimage + -d build/kernel_live \ + "${IMAGE}" qemu-system-aarch64 "${QEMU_ARGS[@]}" "$@" diff --git a/initfs_live.toml b/initfs_live.toml index e088f80..03a56d7 100644 --- a/initfs_live.toml +++ b/initfs_live.toml @@ -7,7 +7,7 @@ prompt = false # Package settings [packages] -drivers = {} +#drivers = {} init = {} nulld = {} #pciids = {} @@ -21,15 +21,21 @@ path="/etc/init.rc" data=""" export PATH /bin export TMPDIR /tmp +stdio debug: +echo Post stdio! nulld +echo Post nulld! zerod +echo Post zerod! randd -vesad T T G -stdio display:1 -ps2d us +echo Post randd! +# vesad T T G +# ps2d us ramfs logging -pcid /etc/pcid/initfs.toml +echo Post ramfs! +# pcid /etc/pcid/initfs.toml redoxfs disk/live: file +echo Post redoxfs! cd file: export PATH file:/bin run.d /etc/init.d diff --git a/mk/kernel.mk b/mk/kernel.mk index b6634bd..ea67bf0 100644 --- a/mk/kernel.mk +++ b/mk/kernel.mk @@ -34,10 +34,20 @@ build/kernel_live: kernel/linkers/$(ARCH).ld build/libkernel_live.a build/live.o $(OBJCOPY) --only-keep-debug $@ $@.sym && \ $(OBJCOPY) --strip-debug $@ +#TODO: More general use of $(ARCH) +ifeq ($(ARCH),aarch64) +build/live.o: build/filesystem.bin + export PATH="$(PREFIX_PATH):$$PATH" && \ + $(OBJCOPY) -I binary -O elf64-littleaarch64 -B aarch64 $< $@ \ + --redefine-sym _binary_build_filesystem_bin_start=__live_start \ + --redefine-sym _binary_build_filesystem_bin_end=__live_end \ + --redefine-sym _binary_build_filesystem_bin_size=__live_size +endif +ifeq ($(ARCH),x86_64) build/live.o: build/filesystem.bin - #TODO: More general use of $(ARCH) export PATH="$(PREFIX_PATH):$$PATH" && \ $(OBJCOPY) -I binary -O elf64-x86-64 -B i386:x86-64 $< $@ \ --redefine-sym _binary_build_filesystem_bin_start=__live_start \ --redefine-sym _binary_build_filesystem_bin_end=__live_end \ --redefine-sym _binary_build_filesystem_bin_size=__live_size +endif |