From dd7614cbcef33c7d44f34c4a38575f8b6a6b47a4 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Sat, 8 Sep 2018 08:54:39 +0100 Subject: [PATCH] some more docs, retore full Linux configs, wont touch that now --- README.adoc | 27 ++++++++++++++++++++++----- build | 3 ++- kernel_config/default | 31 ++++++++++++++++--------------- kernel_config/min | 2 +- 4 files changed, 41 insertions(+), 22 deletions(-) diff --git a/README.adoc b/README.adoc index 6eb0567..615da71 100644 --- a/README.adoc +++ b/README.adoc @@ -193,7 +193,24 @@ We tend to support the following Ubuntu host versions at least: ==== About the QEMU Buildroot setup -link:https://en.wikipedia.org/wiki/Buildroot[] is a set of `make` scripts that downloads everything from source +link:https://en.wikipedia.org/wiki/Buildroot[] is a set of `make` scripts that downloads from source and compiles compatible versions of: + +* GCC +* Linux kernel +* glibc +* BusyBox + +It therefore produces a pristine, blob-less and debuggable setup. + +The price that you pay is that the first build takes a while, but it is well worth it. + +link:https://en.wikipedia.org/wiki/QEMU[QEMU] is a system simulator: it simulates a CPU and devices such as interrupt handlers, timers, UART, screen, keyboard, etc. + +QEMU is the leading cross arch system simulator as of 2018. It is even the default Android simulator that developers get with Android Studio 3 to develop apps without real hardware. + +QEMU is also supported by Buildroot in-tree, see e.g.: https://github.com/buildroot/buildroot/blob/2018.05/configs/qemu_aarch64_virt_defconfig + +All of this makes QEMU the natural choice of system simulator. === gem5 Buildroot setup @@ -2574,9 +2591,9 @@ We also have one letter shorthand names for the architectures and `--arch` optio .... # aarch64 -./run --arch aarch64 +./run -a A # arm -./run --arch arm +./run -a a # x86_64 ./run -a x .... @@ -9665,10 +9682,10 @@ This directory has the following structure: Every directory inside it is a Buildroot package. -Those packages get automatically added to Buildroot's `BR2_EXTERNAL` so you just need to turn them on during build, e.g.: +Those packages get automatically added to Buildroot's `BR2_EXTERNAL`, so all you need to do is to turn them on during build, e.g.: .... -BR2_SAMPLE_PACKAGE=y +./build --buildroot-config BR2_SAMPLE_PACKAGE=y .... ==== patches diff --git a/build b/build index 3d26cd0..0251577 100755 --- a/build +++ b/build @@ -12,6 +12,7 @@ import re import common defaults = { + 'buildroot_bare_kernel': False, 'buildroot_config': [], 'buildroot_config_fragment': [], 'initramfs': False, @@ -146,7 +147,7 @@ def main(args, extra_args=None): default_kernel_config_fragments = [] else: kernel_config_fragment_dir = os.path.join(common.root_dir, 'kernel_config') - default_kernel_config_fragments = ['min'] + default_kernel_config_fragments = ['min', 'default'] if args.linux_reconfigure: # https://stackoverflow.com/questions/49260466/why-when-i-change-br2-linux-kernel-custom-config-file-and-run-make-linux-reconfi pathlib.Path(os.path.join(kernel_config_fragment_dir, 'min')).touch() diff --git a/kernel_config/default b/kernel_config/default index a91c8b0..0486eb9 100644 --- a/kernel_config/default +++ b/kernel_config/default @@ -1,28 +1,16 @@ +# Misc. CONFIG_BLK_DEV_INITRD=y -CONFIG_STRICT_DEVMEM=n +CONFIG_DEBUG_FS=y CONFIG_DYNAMIC_DEBUG=y CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_OVERLAY_FS=y +CONFIG_STRICT_DEVMEM=n # GDB debugging. -CONFIG_DEBUG_FS=y CONFIG_DEBUG_INFO=y CONFIG_DEBUG_KERNEL=y CONFIG_GDB_SCRIPTS=y -# Non-static variables show up on /proc/kallsyms -# https://stackoverflow.com/questions/20196636/does-kallsyms-have-all-the-symbol-of-kernel-functions/44614878#44614878 -CONFIG_KALLSYMS_ALL=y - -# /proc/config.gz -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y - -# TODO make example. -# This seems to allow userspace to create arbitrary configuration trees, -# which kernel modules can then read and interpret. -CONFIG_CONFIGFS_FS=y - # KGDB CONFIG_CONSOLE_POLL=y CONFIG_KDB_CONTINUE_CATASTROPHIC=0 @@ -38,6 +26,19 @@ CONFIG_MAGIC_SYSRQ=y CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1 CONFIG_SERIAL_KGDB_NMI=n +# Non-static variables show up on /proc/kallsyms +# https://stackoverflow.com/questions/20196636/does-kallsyms-have-all-the-symbol-of-kernel-functions/44614878#44614878 +CONFIG_KALLSYMS_ALL=y + +# /proc/config.gz +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y + +# TODO make example. +# This seems to allow userspace to create arbitrary configuration trees, +# which kernel modules can then read and interpret. +CONFIG_CONFIGFS_FS=y + # Module.symvers in kernel tree and modules tree contains CRC of signatures. # TODO: I think the CRC are stored in the built kernel and module, and checked # at insmod, but bgrep did not find it in kernel image. diff --git a/kernel_config/min b/kernel_config/min index 1ee8bd4..88d5731 100644 --- a/kernel_config/min +++ b/kernel_config/min @@ -1,4 +1,4 @@ -# This file contains only configs which are required to boot all configurations. +# This file contains only configs which are required to boot all configurations and get a shell. ## gem5 x86