diff --git a/01_wait_forever/Makefile b/01_wait_forever/Makefile index 16607fe6..cd0dd8d1 100644 --- a/01_wait_forever/Makefile +++ b/01_wait_forever/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -75,10 +76,10 @@ EXEC_QEMU = $(QEMU_BINARY) -M $(QEMU_MACHINE_TYPE) ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) diff --git a/02_runtime_init/Makefile b/02_runtime_init/Makefile index ea979232..0e2b9906 100644 --- a/02_runtime_init/Makefile +++ b/02_runtime_init/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -75,10 +76,10 @@ EXEC_QEMU = $(QEMU_BINARY) -M $(QEMU_MACHINE_TYPE) ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) diff --git a/02_runtime_init/README.md b/02_runtime_init/README.md index 37e34ec8..36d9f7ef 100644 --- a/02_runtime_init/README.md +++ b/02_runtime_init/README.md @@ -53,7 +53,7 @@ diff -uNr 01_wait_forever/Cargo.toml 02_runtime_init/Cargo.toml diff -uNr 01_wait_forever/Makefile 02_runtime_init/Makefile --- 01_wait_forever/Makefile +++ 02_runtime_init/Makefile -@@ -152,6 +152,8 @@ +@@ -153,6 +153,8 @@ $(call colorecho, "\nLaunching objdump") @$(DOCKER_TOOLS) $(OBJDUMP_BINARY) --disassemble --demangle \ --section .text \ diff --git a/03_hacky_hello_world/Makefile b/03_hacky_hello_world/Makefile index 19e50b33..586daf99 100644 --- a/03_hacky_hello_world/Makefile +++ b/03_hacky_hello_world/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -76,11 +77,11 @@ EXEC_TEST_DISPATCH = ruby ../common/tests/dispatch.rb ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) diff --git a/03_hacky_hello_world/README.md b/03_hacky_hello_world/README.md index 22805fb3..c9c5862a 100644 --- a/03_hacky_hello_world/README.md +++ b/03_hacky_hello_world/README.md @@ -47,7 +47,7 @@ diff -uNr 02_runtime_init/Cargo.toml 03_hacky_hello_world/Cargo.toml diff -uNr 02_runtime_init/Makefile 03_hacky_hello_world/Makefile --- 02_runtime_init/Makefile +++ 03_hacky_hello_world/Makefile -@@ -23,7 +23,7 @@ +@@ -24,7 +24,7 @@ KERNEL_BIN = kernel8.img QEMU_BINARY = qemu-system-aarch64 QEMU_MACHINE_TYPE = raspi3 @@ -56,7 +56,7 @@ diff -uNr 02_runtime_init/Makefile 03_hacky_hello_world/Makefile OBJDUMP_BINARY = aarch64-none-elf-objdump NM_BINARY = aarch64-none-elf-nm READELF_BINARY = aarch64-none-elf-readelf -@@ -34,7 +34,7 @@ +@@ -35,7 +35,7 @@ KERNEL_BIN = kernel8.img QEMU_BINARY = qemu-system-aarch64 QEMU_MACHINE_TYPE = @@ -65,7 +65,7 @@ diff -uNr 02_runtime_init/Makefile 03_hacky_hello_world/Makefile OBJDUMP_BINARY = aarch64-none-elf-objdump NM_BINARY = aarch64-none-elf-nm READELF_BINARY = aarch64-none-elf-readelf -@@ -70,17 +70,20 @@ +@@ -71,17 +71,20 @@ --strip-all \ -O binary @@ -76,21 +76,20 @@ diff -uNr 02_runtime_init/Makefile 03_hacky_hello_world/Makefile ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ --DOCKER_IMAGE = rustembedded/osdev-utils -DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial -DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i -+DOCKER_IMAGE = rustembedded/osdev-utils +DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial +DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i +DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common + # DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) +DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) -@@ -168,3 +171,28 @@ +@@ -169,3 +172,28 @@ ##------------------------------------------------------------------------------ check: @RUSTFLAGS="$(RUSTFLAGS)" $(CHECK_CMD) --message-format=json diff --git a/04_safe_globals/Makefile b/04_safe_globals/Makefile index 19e50b33..586daf99 100644 --- a/04_safe_globals/Makefile +++ b/04_safe_globals/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -76,11 +77,11 @@ EXEC_TEST_DISPATCH = ruby ../common/tests/dispatch.rb ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) diff --git a/05_drivers_gpio_uart/Makefile b/05_drivers_gpio_uart/Makefile index c38e049e..cd09a540 100644 --- a/05_drivers_gpio_uart/Makefile +++ b/05_drivers_gpio_uart/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -80,12 +81,12 @@ EXEC_MINITERM = ruby ../common/serial/miniterm.rb ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common DOCKER_ARG_DEV = --privileged -v /dev:/dev +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) diff --git a/05_drivers_gpio_uart/README.md b/05_drivers_gpio_uart/README.md index cbfd06fe..00d23212 100644 --- a/05_drivers_gpio_uart/README.md +++ b/05_drivers_gpio_uart/README.md @@ -145,7 +145,7 @@ diff -uNr 04_safe_globals/Cargo.toml 05_drivers_gpio_uart/Cargo.toml diff -uNr 04_safe_globals/Makefile 05_drivers_gpio_uart/Makefile --- 04_safe_globals/Makefile +++ 05_drivers_gpio_uart/Makefile -@@ -11,6 +11,9 @@ +@@ -12,6 +12,9 @@ # Default to the RPi3. BSP ?= rpi3 @@ -155,7 +155,7 @@ diff -uNr 04_safe_globals/Makefile 05_drivers_gpio_uart/Makefile ##-------------------------------------------------------------------------------------------------- -@@ -72,6 +75,7 @@ +@@ -73,6 +76,7 @@ EXEC_QEMU = $(QEMU_BINARY) -M $(QEMU_MACHINE_TYPE) EXEC_TEST_DISPATCH = ruby ../common/tests/dispatch.rb @@ -163,12 +163,13 @@ diff -uNr 04_safe_globals/Makefile 05_drivers_gpio_uart/Makefile ##------------------------------------------------------------------------------ ## Dockerization -@@ -80,17 +84,25 @@ +@@ -80,18 +84,26 @@ DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common +DOCKER_ARG_DEV = --privileged -v /dev:/dev + # DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) @@ -190,7 +191,7 @@ diff -uNr 04_safe_globals/Makefile 05_drivers_gpio_uart/Makefile all: $(KERNEL_BIN) -@@ -130,6 +142,12 @@ +@@ -131,6 +143,12 @@ endif ##------------------------------------------------------------------------------ diff --git a/06_uart_chainloader/Makefile b/06_uart_chainloader/Makefile index 3064e67a..e4f94ad1 100644 --- a/06_uart_chainloader/Makefile +++ b/06_uart_chainloader/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -82,12 +83,12 @@ EXEC_MINIPUSH = ruby ../common/serial/minipush.rb ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common DOCKER_ARG_DEV = --privileged -v /dev:/dev +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) diff --git a/06_uart_chainloader/README.md b/06_uart_chainloader/README.md index baeb9236..8a927389 100644 --- a/06_uart_chainloader/README.md +++ b/06_uart_chainloader/README.md @@ -137,7 +137,7 @@ Binary files 05_drivers_gpio_uart/demo_payload_rpi4.img and 06_uart_chainloader/ diff -uNr 05_drivers_gpio_uart/Makefile 06_uart_chainloader/Makefile --- 05_drivers_gpio_uart/Makefile +++ 06_uart_chainloader/Makefile -@@ -22,27 +22,29 @@ +@@ -23,27 +23,29 @@ # BSP-specific arguments. ifeq ($(BSP),rpi3) @@ -187,7 +187,7 @@ diff -uNr 05_drivers_gpio_uart/Makefile 06_uart_chainloader/Makefile endif QEMU_MISSING_STRING = "This board is not yet supported for QEMU." -@@ -74,8 +76,8 @@ +@@ -75,8 +77,8 @@ -O binary EXEC_QEMU = $(QEMU_BINARY) -M $(QEMU_MACHINE_TYPE) @@ -198,7 +198,7 @@ diff -uNr 05_drivers_gpio_uart/Makefile 06_uart_chainloader/Makefile ##------------------------------------------------------------------------------ ## Dockerization -@@ -94,7 +96,7 @@ +@@ -95,7 +97,7 @@ ifeq ($(shell uname -s),Linux) DOCKER_CMD_DEV = $(DOCKER_CMD_INTERACT) $(DOCKER_ARG_DEV) @@ -207,7 +207,7 @@ diff -uNr 05_drivers_gpio_uart/Makefile 06_uart_chainloader/Makefile endif -@@ -102,7 +104,7 @@ +@@ -103,7 +105,7 @@ ##-------------------------------------------------------------------------------------------------- ## Targets ##-------------------------------------------------------------------------------------------------- @@ -216,7 +216,7 @@ diff -uNr 05_drivers_gpio_uart/Makefile 06_uart_chainloader/Makefile all: $(KERNEL_BIN) -@@ -131,7 +133,7 @@ +@@ -132,7 +134,7 @@ ##------------------------------------------------------------------------------ ifeq ($(QEMU_MACHINE_TYPE),) # QEMU is not supported for the board. @@ -225,7 +225,7 @@ diff -uNr 05_drivers_gpio_uart/Makefile 06_uart_chainloader/Makefile $(call colorecho, "\n$(QEMU_MISSING_STRING)") else # QEMU is supported. -@@ -139,13 +141,18 @@ +@@ -140,13 +142,18 @@ qemu: $(KERNEL_BIN) $(call colorecho, "\nLaunching QEMU") @$(DOCKER_QEMU) $(EXEC_QEMU) $(QEMU_RELEASE_ARGS) -kernel $(KERNEL_BIN) @@ -247,7 +247,7 @@ diff -uNr 05_drivers_gpio_uart/Makefile 06_uart_chainloader/Makefile ##------------------------------------------------------------------------------ ## Run clippy -@@ -209,7 +216,8 @@ +@@ -210,7 +217,8 @@ ##------------------------------------------------------------------------------ test_boot: $(KERNEL_BIN) $(call colorecho, "\nBoot test - $(BSP)") diff --git a/07_timestamps/Makefile b/07_timestamps/Makefile index 8336ccb7..d5023b03 100644 --- a/07_timestamps/Makefile +++ b/07_timestamps/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -80,12 +81,12 @@ EXEC_MINIPUSH = ruby ../common/serial/minipush.rb ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common DOCKER_ARG_DEV = --privileged -v /dev:/dev +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) diff --git a/07_timestamps/README.md b/07_timestamps/README.md index f081733b..d1c53574 100644 --- a/07_timestamps/README.md +++ b/07_timestamps/README.md @@ -62,7 +62,7 @@ Binary files 06_uart_chainloader/demo_payload_rpi4.img and 07_timestamps/demo_pa diff -uNr 06_uart_chainloader/Makefile 07_timestamps/Makefile --- 06_uart_chainloader/Makefile +++ 07_timestamps/Makefile -@@ -22,29 +22,27 @@ +@@ -23,29 +23,27 @@ # BSP-specific arguments. ifeq ($(BSP),rpi3) @@ -112,7 +112,7 @@ diff -uNr 06_uart_chainloader/Makefile 07_timestamps/Makefile endif QEMU_MISSING_STRING = "This board is not yet supported for QEMU." -@@ -76,7 +74,7 @@ +@@ -77,7 +75,7 @@ -O binary EXEC_QEMU = $(QEMU_BINARY) -M $(QEMU_MACHINE_TYPE) @@ -121,7 +121,7 @@ diff -uNr 06_uart_chainloader/Makefile 07_timestamps/Makefile EXEC_MINIPUSH = ruby ../common/serial/minipush.rb ##------------------------------------------------------------------------------ -@@ -133,7 +131,7 @@ +@@ -134,7 +132,7 @@ ##------------------------------------------------------------------------------ ifeq ($(QEMU_MACHINE_TYPE),) # QEMU is not supported for the board. @@ -130,7 +130,7 @@ diff -uNr 06_uart_chainloader/Makefile 07_timestamps/Makefile $(call colorecho, "\n$(QEMU_MISSING_STRING)") else # QEMU is supported. -@@ -142,17 +140,13 @@ +@@ -143,17 +141,13 @@ $(call colorecho, "\nLaunching QEMU") @$(DOCKER_QEMU) $(EXEC_QEMU) $(QEMU_RELEASE_ARGS) -kernel $(KERNEL_BIN) @@ -149,7 +149,7 @@ diff -uNr 06_uart_chainloader/Makefile 07_timestamps/Makefile ##------------------------------------------------------------------------------ ## Run clippy -@@ -216,8 +210,7 @@ +@@ -217,8 +211,7 @@ ##------------------------------------------------------------------------------ test_boot: $(KERNEL_BIN) $(call colorecho, "\nBoot test - $(BSP)") diff --git a/08_hw_debug_JTAG/Makefile b/08_hw_debug_JTAG/Makefile index 0a2443ac..dd739e13 100644 --- a/08_hw_debug_JTAG/Makefile +++ b/08_hw_debug_JTAG/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -84,7 +85,6 @@ EXEC_MINIPUSH = ruby ../common/serial/minipush.rb ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common @@ -92,6 +92,7 @@ DOCKER_ARG_DIR_JTAG = -v $(shell pwd)/../X1_JTAG_boot:/work/X1_JTAG_boot DOCKER_ARG_DEV = --privileged -v /dev:/dev DOCKER_ARG_NET = --network host +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) diff --git a/08_hw_debug_JTAG/README.md b/08_hw_debug_JTAG/README.md index 355b2d3d..0742cdf1 100644 --- a/08_hw_debug_JTAG/README.md +++ b/08_hw_debug_JTAG/README.md @@ -320,7 +320,7 @@ diff -uNr 07_timestamps/Cargo.toml 08_hw_debug_JTAG/Cargo.toml diff -uNr 07_timestamps/Makefile 08_hw_debug_JTAG/Makefile --- 07_timestamps/Makefile +++ 08_hw_debug_JTAG/Makefile -@@ -30,6 +30,8 @@ +@@ -31,6 +31,8 @@ OBJDUMP_BINARY = aarch64-none-elf-objdump NM_BINARY = aarch64-none-elf-nm READELF_BINARY = aarch64-none-elf-readelf @@ -329,7 +329,7 @@ diff -uNr 07_timestamps/Makefile 08_hw_debug_JTAG/Makefile LINKER_FILE = src/bsp/raspberrypi/link.ld RUSTC_MISC_ARGS = -C target-cpu=cortex-a53 else ifeq ($(BSP),rpi4) -@@ -41,6 +43,8 @@ +@@ -42,6 +44,8 @@ OBJDUMP_BINARY = aarch64-none-elf-objdump NM_BINARY = aarch64-none-elf-nm READELF_BINARY = aarch64-none-elf-readelf @@ -338,7 +338,7 @@ diff -uNr 07_timestamps/Makefile 08_hw_debug_JTAG/Makefile LINKER_FILE = src/bsp/raspberrypi/link.ld RUSTC_MISC_ARGS = -C target-cpu=cortex-a72 endif -@@ -84,17 +88,24 @@ +@@ -84,18 +88,25 @@ DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common @@ -346,6 +346,7 @@ diff -uNr 07_timestamps/Makefile 08_hw_debug_JTAG/Makefile DOCKER_ARG_DEV = --privileged -v /dev:/dev +DOCKER_ARG_NET = --network host + # DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) @@ -363,7 +364,7 @@ diff -uNr 07_timestamps/Makefile 08_hw_debug_JTAG/Makefile endif -@@ -193,6 +204,35 @@ +@@ -194,6 +205,35 @@ diff --git a/09_privilege_level/Makefile b/09_privilege_level/Makefile index 0a2443ac..dd739e13 100644 --- a/09_privilege_level/Makefile +++ b/09_privilege_level/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -84,7 +85,6 @@ EXEC_MINIPUSH = ruby ../common/serial/minipush.rb ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common @@ -92,6 +92,7 @@ DOCKER_ARG_DIR_JTAG = -v $(shell pwd)/../X1_JTAG_boot:/work/X1_JTAG_boot DOCKER_ARG_DEV = --privileged -v /dev:/dev DOCKER_ARG_NET = --network host +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) diff --git a/10_virtual_mem_part1_identity_mapping/Makefile b/10_virtual_mem_part1_identity_mapping/Makefile index 0a2443ac..dd739e13 100644 --- a/10_virtual_mem_part1_identity_mapping/Makefile +++ b/10_virtual_mem_part1_identity_mapping/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -84,7 +85,6 @@ EXEC_MINIPUSH = ruby ../common/serial/minipush.rb ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common @@ -92,6 +92,7 @@ DOCKER_ARG_DIR_JTAG = -v $(shell pwd)/../X1_JTAG_boot:/work/X1_JTAG_boot DOCKER_ARG_DEV = --privileged -v /dev:/dev DOCKER_ARG_NET = --network host +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) diff --git a/11_exceptions_part1_groundwork/Makefile b/11_exceptions_part1_groundwork/Makefile index 0a2443ac..dd739e13 100644 --- a/11_exceptions_part1_groundwork/Makefile +++ b/11_exceptions_part1_groundwork/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -84,7 +85,6 @@ EXEC_MINIPUSH = ruby ../common/serial/minipush.rb ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common @@ -92,6 +92,7 @@ DOCKER_ARG_DIR_JTAG = -v $(shell pwd)/../X1_JTAG_boot:/work/X1_JTAG_boot DOCKER_ARG_DEV = --privileged -v /dev:/dev DOCKER_ARG_NET = --network host +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) diff --git a/12_integrated_testing/Makefile b/12_integrated_testing/Makefile index 08004986..492d3069 100644 --- a/12_integrated_testing/Makefile +++ b/12_integrated_testing/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -94,7 +95,6 @@ EXEC_MINIPUSH = ruby ../common/serial/minipush.rb ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common @@ -102,6 +102,7 @@ DOCKER_ARG_DIR_JTAG = -v $(shell pwd)/../X1_JTAG_boot:/work/X1_JTAG_boot DOCKER_ARG_DEV = --privileged -v /dev:/dev DOCKER_ARG_NET = --network host +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) diff --git a/12_integrated_testing/README.md b/12_integrated_testing/README.md index a7fc3969..607c5b5d 100644 --- a/12_integrated_testing/README.md +++ b/12_integrated_testing/README.md @@ -938,7 +938,7 @@ diff -uNr 11_exceptions_part1_groundwork/Cargo.toml 12_integrated_testing/Cargo. diff -uNr 11_exceptions_part1_groundwork/Makefile 12_integrated_testing/Makefile --- 11_exceptions_part1_groundwork/Makefile +++ 12_integrated_testing/Makefile -@@ -14,6 +14,13 @@ +@@ -15,6 +15,13 @@ # Default to a serial device name that is common in Linux. DEV_SERIAL ?= /dev/ttyUSB0 @@ -952,7 +952,7 @@ diff -uNr 11_exceptions_part1_groundwork/Makefile 12_integrated_testing/Makefile ##-------------------------------------------------------------------------------------------------- -@@ -27,6 +34,7 @@ +@@ -28,6 +35,7 @@ QEMU_BINARY = qemu-system-aarch64 QEMU_MACHINE_TYPE = raspi3 QEMU_RELEASE_ARGS = -serial stdio -display none @@ -960,7 +960,7 @@ diff -uNr 11_exceptions_part1_groundwork/Makefile 12_integrated_testing/Makefile OBJDUMP_BINARY = aarch64-none-elf-objdump NM_BINARY = aarch64-none-elf-nm READELF_BINARY = aarch64-none-elf-readelf -@@ -40,6 +48,7 @@ +@@ -41,6 +49,7 @@ QEMU_BINARY = qemu-system-aarch64 QEMU_MACHINE_TYPE = QEMU_RELEASE_ARGS = -serial stdio -display none @@ -968,7 +968,7 @@ diff -uNr 11_exceptions_part1_groundwork/Makefile 12_integrated_testing/Makefile OBJDUMP_BINARY = aarch64-none-elf-objdump NM_BINARY = aarch64-none-elf-nm READELF_BINARY = aarch64-none-elf-readelf -@@ -73,6 +82,7 @@ +@@ -74,6 +83,7 @@ DOC_CMD = cargo doc $(COMPILER_ARGS) CLIPPY_CMD = cargo clippy $(COMPILER_ARGS) CHECK_CMD = cargo check $(COMPILER_ARGS) @@ -976,7 +976,7 @@ diff -uNr 11_exceptions_part1_groundwork/Makefile 12_integrated_testing/Makefile OBJCOPY_CMD = rust-objcopy \ --strip-all \ -O binary -@@ -236,11 +246,11 @@ +@@ -237,11 +247,11 @@ ##-------------------------------------------------------------------------------------------------- ## Testing targets ##-------------------------------------------------------------------------------------------------- @@ -990,7 +990,7 @@ diff -uNr 11_exceptions_part1_groundwork/Makefile 12_integrated_testing/Makefile $(call colorecho, "\n$(QEMU_MISSING_STRING)") else # QEMU is supported. -@@ -252,6 +262,45 @@ +@@ -253,6 +263,45 @@ $(call colorecho, "\nBoot test - $(BSP)") @$(DOCKER_TEST) $(EXEC_TEST_DISPATCH) $(EXEC_QEMU) $(QEMU_RELEASE_ARGS) -kernel $(KERNEL_BIN) diff --git a/13_exceptions_part2_peripheral_IRQs/Makefile b/13_exceptions_part2_peripheral_IRQs/Makefile index e860f00d..777031a1 100644 --- a/13_exceptions_part2_peripheral_IRQs/Makefile +++ b/13_exceptions_part2_peripheral_IRQs/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -94,7 +95,6 @@ EXEC_MINIPUSH = ruby ../common/serial/minipush.rb ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common @@ -102,6 +102,7 @@ DOCKER_ARG_DIR_JTAG = -v $(shell pwd)/../X1_JTAG_boot:/work/X1_JTAG_boot DOCKER_ARG_DEV = --privileged -v /dev:/dev DOCKER_ARG_NET = --network host +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) diff --git a/13_exceptions_part2_peripheral_IRQs/README.md b/13_exceptions_part2_peripheral_IRQs/README.md index f1f3f1a7..1bc3ed7f 100644 --- a/13_exceptions_part2_peripheral_IRQs/README.md +++ b/13_exceptions_part2_peripheral_IRQs/README.md @@ -761,7 +761,7 @@ diff -uNr 12_integrated_testing/Cargo.toml 13_exceptions_part2_peripheral_IRQs/C diff -uNr 12_integrated_testing/Makefile 13_exceptions_part2_peripheral_IRQs/Makefile --- 12_integrated_testing/Makefile +++ 13_exceptions_part2_peripheral_IRQs/Makefile -@@ -291,7 +291,7 @@ +@@ -292,7 +292,7 @@ test_unit: $(call colorecho, "\nCompiling unit test(s) - $(BSP)") $(call test_prepare) diff --git a/14_virtual_mem_part2_mmio_remap/Makefile b/14_virtual_mem_part2_mmio_remap/Makefile index e860f00d..777031a1 100644 --- a/14_virtual_mem_part2_mmio_remap/Makefile +++ b/14_virtual_mem_part2_mmio_remap/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -94,7 +95,6 @@ EXEC_MINIPUSH = ruby ../common/serial/minipush.rb ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common @@ -102,6 +102,7 @@ DOCKER_ARG_DIR_JTAG = -v $(shell pwd)/../X1_JTAG_boot:/work/X1_JTAG_boot DOCKER_ARG_DEV = --privileged -v /dev:/dev DOCKER_ARG_NET = --network host +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) diff --git a/15_virtual_mem_part3_precomputed_tables/Makefile b/15_virtual_mem_part3_precomputed_tables/Makefile index 86a64ee5..f484b21a 100644 --- a/15_virtual_mem_part3_precomputed_tables/Makefile +++ b/15_virtual_mem_part3_precomputed_tables/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -95,7 +96,6 @@ EXEC_MINIPUSH = ruby ../common/serial/minipush.rb ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common @@ -103,6 +103,7 @@ DOCKER_ARG_DIR_JTAG = -v $(shell pwd)/../X1_JTAG_boot:/work/X1_JTAG_boot DOCKER_ARG_DEV = --privileged -v /dev:/dev DOCKER_ARG_NET = --network host +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) diff --git a/15_virtual_mem_part3_precomputed_tables/README.md b/15_virtual_mem_part3_precomputed_tables/README.md index f786f1e8..3e7ca4bd 100644 --- a/15_virtual_mem_part3_precomputed_tables/README.md +++ b/15_virtual_mem_part3_precomputed_tables/README.md @@ -777,7 +777,7 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/Cargo.toml 15_virtual_mem_part3_precom diff -uNr 14_virtual_mem_part2_mmio_remap/Makefile 15_virtual_mem_part3_precomputed_tables/Makefile --- 14_virtual_mem_part2_mmio_remap/Makefile +++ 15_virtual_mem_part3_precomputed_tables/Makefile -@@ -88,6 +88,7 @@ +@@ -89,6 +89,7 @@ -O binary EXEC_QEMU = $(QEMU_BINARY) -M $(QEMU_MACHINE_TYPE) @@ -785,7 +785,7 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/Makefile 15_virtual_mem_part3_precompu EXEC_TEST_DISPATCH = ruby ../common/tests/dispatch.rb EXEC_MINIPUSH = ruby ../common/serial/minipush.rb -@@ -133,6 +134,7 @@ +@@ -134,6 +135,7 @@ $(KERNEL_ELF): $(call colorecho, "\nCompiling kernel - $(BSP)") @RUSTFLAGS="$(RUSTFLAGS_PEDANTIC)" $(RUSTC_CMD) @@ -793,7 +793,7 @@ diff -uNr 14_virtual_mem_part2_mmio_remap/Makefile 15_virtual_mem_part3_precompu ##------------------------------------------------------------------------------ ## Build the stripped kernel binary -@@ -271,6 +273,7 @@ +@@ -272,6 +274,7 @@ TEST_ELF=$$(echo $$1 | sed -e 's/.*target/target/g') TEST_BINARY=$$(echo $$1.img | sed -e 's/.*target/target/g') diff --git a/16_virtual_mem_part4_higher_half_kernel/Makefile b/16_virtual_mem_part4_higher_half_kernel/Makefile index 86a64ee5..f484b21a 100644 --- a/16_virtual_mem_part4_higher_half_kernel/Makefile +++ b/16_virtual_mem_part4_higher_half_kernel/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -95,7 +96,6 @@ EXEC_MINIPUSH = ruby ../common/serial/minipush.rb ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common @@ -103,6 +103,7 @@ DOCKER_ARG_DIR_JTAG = -v $(shell pwd)/../X1_JTAG_boot:/work/X1_JTAG_boot DOCKER_ARG_DEV = --privileged -v /dev:/dev DOCKER_ARG_NET = --network host +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) diff --git a/X1_JTAG_boot/Makefile b/X1_JTAG_boot/Makefile index 8336ccb7..d5023b03 100644 --- a/X1_JTAG_boot/Makefile +++ b/X1_JTAG_boot/Makefile @@ -2,7 +2,8 @@ ## ## Copyright (c) 2018-2021 Andre Richter -include ../common/color.mk.in +include ../common/color.mk +include ../common/docker.mk ##-------------------------------------------------------------------------------------------------- ## Optional, user-provided configuration values @@ -80,12 +81,12 @@ EXEC_MINIPUSH = ruby ../common/serial/minipush.rb ##------------------------------------------------------------------------------ ## Dockerization ##------------------------------------------------------------------------------ -DOCKER_IMAGE = rustembedded/osdev-utils DOCKER_CMD = docker run -t --rm -v $(shell pwd):/work/tutorial -w /work/tutorial DOCKER_CMD_INTERACT = $(DOCKER_CMD) -i DOCKER_ARG_DIR_COMMON = -v $(shell pwd)/../common:/work/common DOCKER_ARG_DEV = --privileged -v /dev:/dev +# DOCKER_IMAGE defined in include file (see top of this file). DOCKER_QEMU = $(DOCKER_CMD_INTERACT) $(DOCKER_IMAGE) DOCKER_TOOLS = $(DOCKER_CMD) $(DOCKER_IMAGE) DOCKER_TEST = $(DOCKER_CMD) $(DOCKER_ARG_DIR_COMMON) $(DOCKER_IMAGE) diff --git a/common/color.mk.in b/common/color.mk similarity index 100% rename from common/color.mk.in rename to common/color.mk diff --git a/common/docker.mk b/common/docker.mk new file mode 100644 index 00000000..c4b92f73 --- /dev/null +++ b/common/docker.mk @@ -0,0 +1 @@ +DOCKER_IMAGE = rustembedded/osdev-utils:2021.11 diff --git a/docker/rustembedded-osdev-utils/Dockerfile b/docker/rustembedded-osdev-utils/Dockerfile index 1366abf2..981f3da7 100644 --- a/docker/rustembedded-osdev-utils/Dockerfile +++ b/docker/rustembedded-osdev-utils/Dockerfile @@ -41,12 +41,13 @@ RUN set -ex; \ ruby-dev \ ; \ # Ruby dependencies - gem install bundler; \ - bundle install --retry 3 --without development; \ + gem install bundler; \ + bundle config set --local without 'development'; \ + bundle install --retry 3; \ # QEMU - git clone https://git.qemu.org/git/qemu.git; \ + git clone https://gitlab.com/qemu-project/qemu.git; \ cd qemu; \ - git checkout tags/v5.2.0; \ + git checkout tags/v6.1.0; \ ./configure --target-list=aarch64-softmmu --enable-modules \ --enable-tcg-interpreter --enable-debug-tcg \ --python=/usr/bin/python3; \ @@ -81,8 +82,8 @@ RUN set -ex; \ # Locales RUN locale-gen en_US.UTF-8 -ENV LANG=en_US.UTF-8 \ - LANGUAGE=en_US:en \ +ENV LANG=en_US.UTF-8 \ + LANGUAGE=en_US:en \ LC_ALL=en_US.UTF-8 \ RUBYOPT=-W0 diff --git a/docker/rustembedded-osdev-utils/Makefile b/docker/rustembedded-osdev-utils/Makefile index e40b5ac4..9418ee87 100644 --- a/docker/rustembedded-osdev-utils/Makefile +++ b/docker/rustembedded-osdev-utils/Makefile @@ -6,6 +6,6 @@ default: docker_build docker_build: cp ../../Gemfile . - docker build -t rustembedded/osdev-utils \ + docker build -t rustembedded/osdev-utils:2021.11 \ --build-arg VCS_REF=`git rev-parse --short HEAD` . rm Gemfile