From 6461f0fa63e4c77ff4d76f1f2cb778cb1302daab Mon Sep 17 00:00:00 2001 From: Rose Thompson Date: Tue, 21 Nov 2023 17:59:22 -0600 Subject: [PATCH 1/2] Fix to linux makefile to support disassembly and creating vmlinux automatically. --- linux/Makefile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/linux/Makefile b/linux/Makefile index 373142615..c3d8b5cb0 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -1,5 +1,5 @@ -RISCV := /opt/riscv -BUILDROOT := ${RISCV}/buildroot +RISCV := /home/rose/repos/ +BUILDROOT := ${RISCV}/buildroot-test IMAGES := ${BUILDROOT}/output/images WALLY := $(shell dirname $(shell pwd)) WALLYLINUX := $(shell pwd) @@ -55,10 +55,23 @@ $(RISCV): # Disassembly rules --------------------------------------------------- +vmlinux: + sed 's/BR2_LINUX_KERNEL_IMAGE=y/\# BR2_LINUX_KERNEL_IMAGE is not set/g' ${BR2023}/main.config > ${BR2023}/main-vmlinux.config + sed -i 's/\# BR2_LINUX_KERNEL_VMLINUX is not set/BR2_LINUX_KERNEL_VMLINUX=y/g' ${BR2023}/main-vmlinux.config + sed -i 's/\# BR2_TARGET_OPENSBI_LINUX_PAYLOAD is not set//g' ${BR2023}/main-vmlinux.config + cp $(BR2023)/main-vmlinux.config $(WALLYBOARD)/main.config + cp $(BR2023)/main-vmlinux.config $(BUILDROOT)/.config + make -C $(BUILDROOT) --jobs + disassemble: mkdir -p $(DIS) make -j $(OBJDUMPS) +Image: + cp $(BR2023)/main.config $(WALLYBOARD)/main.config + cp $(BR2023)/main.config $(BUILDROOT)/.config + make -C $(BUILDROOT) --jobs + $(DIS)/%.objdump: $(IMAGES)/%.elf riscv64-unknown-elf-objdump -DS $< >> $@ From a7f35179816cbe63eb912f2943515ac497b34e2d Mon Sep 17 00:00:00 2001 From: Rose Thompson Date: Tue, 21 Nov 2023 18:24:45 -0600 Subject: [PATCH 2/2] Removed testing hack. --- linux/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/Makefile b/linux/Makefile index c3d8b5cb0..bcf967bb8 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -1,5 +1,5 @@ -RISCV := /home/rose/repos/ -BUILDROOT := ${RISCV}/buildroot-test +RISCV := /opt/riscv +BUILDROOT := ${RISCV}/buildroot IMAGES := ${BUILDROOT}/output/images WALLY := $(shell dirname $(shell pwd)) WALLYLINUX := $(shell pwd)