mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
A bunch of tiny fixes
This commit is contained in:
@@ -1110,9 +1110,9 @@ wc -l trace-boot.txt
|
||||
gem5:
|
||||
|
||||
....
|
||||
./run -a arm -g -e 'init=/eval.sh - lkmc_eval="m5 exit"' -n
|
||||
./run -a arm -g -e 'init=/eval.sh - lkmc_eval="m5 exit"'
|
||||
# Or:
|
||||
# ./run -a arm -g -e 'init=/eval.sh - lkmc_eval="m5 exit"' -n -- --cpu-type=HPI --caches
|
||||
# ./run -a arm -g -e 'init=/eval.sh - lkmc_eval="m5 exit"' -- --cpu-type=HPI --caches
|
||||
grep sim_insts m5out/stats.txt
|
||||
....
|
||||
|
||||
|
||||
3
build
3
build
@@ -114,6 +114,9 @@ BR2_ROOTFS_POST_SCRIPT_ARGS=\"$post_script_args\"
|
||||
# http://lists.busybox.net/pipermail/buildroot/2017-August/201053.html
|
||||
sed -Ei 's/^BR2_PACKAGE_LINUX_TOOLS_GPIO/BR2_PACKAGE_LINUX_TOOLS_GPIO=n/' "${config_file}"
|
||||
fi
|
||||
# TODO why is this needed. Otherwise kernel .config does not change, even though Buildroot
|
||||
# .config did due to -K. even if we are running linux-kernel-reconfigure!
|
||||
rm -f "${out_dir}/build/linux-custom/.config"
|
||||
if [ -n "$linux_kernel_custom_config_file" ]; then
|
||||
printf "BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=\"../${linux_kernel_custom_config_file}\"\n" >> "${config_file}"
|
||||
fi
|
||||
|
||||
16
gem5/build
16
gem5/build
@@ -1,12 +1,16 @@
|
||||
#/usr/bin/env bash
|
||||
set -eu
|
||||
arch=x86_64
|
||||
cross_compile=''
|
||||
j=''
|
||||
while getopts a:j: OPT; do
|
||||
while getopts a:c:j: OPT; do
|
||||
case "$OPT" in
|
||||
a)
|
||||
arch="$OPTARG"
|
||||
;;
|
||||
c)
|
||||
cross_compile="CROSS_COMPILE=$OPTARG"
|
||||
;;
|
||||
j)
|
||||
j="$OPTARG"
|
||||
;;
|
||||
@@ -22,6 +26,9 @@ binaries_dir="${system_dir}/binaries"
|
||||
disks_dir="${system_dir}/disks"
|
||||
mkdir -p "$binaries_dir" "$disks_dir"
|
||||
cd "${top}/gem5"
|
||||
|
||||
TARGET_CROSS=
|
||||
|
||||
if [ "$arch" = x86_64 ]; then
|
||||
CC=gcc-6 CXX=g++-6 scons -j"$j" --ignore-style build/X86/gem5.opt
|
||||
f="${disks_dir}/linux-bigswap2.img"
|
||||
@@ -34,11 +41,12 @@ elif [ "$arch" = arm ] || [ "$arch" = aarch64 ]; then
|
||||
# Compilation fails with gcc 7 on that commit.
|
||||
# There were some recent portability patches, so it will likely get there soon.
|
||||
CC=gcc-6 CXX=g++-6 scons -j"$j" --ignore-style build/ARM/gem5.opt
|
||||
make -C ./system/arm/dt
|
||||
make -C ./system/arm/dt/
|
||||
# TODO use the buildroot cross compiler here, and remove the dependencies from configure.
|
||||
make -C ./system/arm/simple_bootloader
|
||||
make -C ./system/arm/aarch64_bootloader/
|
||||
make -C ./system/arm/simple_bootloader/ $cross_compile
|
||||
cp ./system/arm/simple_bootloader/boot_emm.arm "$binaries_dir"
|
||||
# TODO cross_compile is ignored because the make does not use CC...
|
||||
make -C ./system/arm/aarch64_bootloader/ $cross_compile
|
||||
cp ./system/arm/aarch64_bootloader/boot_emm.arm64 "$binaries_dir"
|
||||
fi
|
||||
# TODO vs telnet?
|
||||
|
||||
@@ -15,7 +15,7 @@ ARCH_MAKE = $(ARCH)
|
||||
endif
|
||||
|
||||
define GEM5_BUILD_CMDS
|
||||
cd '$(@D)' && ./build -a '$(ARCH)' -j '$(BR2_JLEVEL)'
|
||||
cd '$(@D)' && ./build -a '$(ARCH)' -c '$(TARGET_CROSS)' -j '$(BR2_JLEVEL)'
|
||||
cd '$(@D)/gem5/util/m5' && $(MAKE) -f 'Makefile.$(ARCH_MAKE)' CC='$(TARGET_CC)' LD='$(TARGET_LD)'
|
||||
endef
|
||||
|
||||
|
||||
4
run
4
run
@@ -8,7 +8,6 @@ cpus=1
|
||||
debug_vm=''
|
||||
kgdb=false
|
||||
kvm=false
|
||||
nographic=false
|
||||
# norandmaps: Don't use address space randomization. Equivalent to echo 0 > /proc/sys/kernel/randomize_va_space.
|
||||
# printk.time=y: log in format: "[time ] msg" for all printk messages.
|
||||
# nokaslr: https://unix.stackexchange.com/questions/397939/turning-off-kaslr-to-debug-linux-kernel-using-qemu-and-gdb
|
||||
@@ -59,7 +58,6 @@ while getopts a:c:Dde:G:giKknt:x OPT; do
|
||||
n)
|
||||
extra_append="$extra_append console=ttyS0"
|
||||
extra_flags_qemu="$extra_flags -nographic"
|
||||
nographic=true
|
||||
;;
|
||||
esac
|
||||
done
|
||||
@@ -115,7 +113,7 @@ else
|
||||
extra_flags="${extra_flags_qemu} ${extra_flags}"
|
||||
images_dir="${out_dir}/images"
|
||||
qemu_common="\
|
||||
'${debug_vm}' \
|
||||
${debug_vm} \
|
||||
'${out_dir}/host/usr/bin/qemu-system-${arch}' \
|
||||
-m 128M \
|
||||
-monitor telnet::45454,server,nowait \
|
||||
|
||||
Reference in New Issue
Block a user