Skip to content

Add initial Rpi4 support #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
**/target/*
**/.gdb_history
**/kernel8.img
**/.idea

node_modules
.bundle
2 changes: 1 addition & 1 deletion 01_wait_forever/Makefile
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -d in_asm -display none
OBJDUMP_BINARY = aarch64-none-elf-objdump
NM_BINARY = aarch64-none-elf-nm
2 changes: 1 addition & 1 deletion 02_runtime_init/Makefile
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -d in_asm -display none
OBJDUMP_BINARY = aarch64-none-elf-objdump
NM_BINARY = aarch64-none-elf-nm
2 changes: 1 addition & 1 deletion 03_hacky_hello_world/Makefile
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
OBJDUMP_BINARY = aarch64-none-elf-objdump
NM_BINARY = aarch64-none-elf-nm
2 changes: 1 addition & 1 deletion 03_hacky_hello_world/README.md
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ diff -uNr 02_runtime_init/Makefile 03_hacky_hello_world/Makefile
@@ -36,7 +36,7 @@
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
- QEMU_RELEASE_ARGS = -d in_asm -display none
+ QEMU_RELEASE_ARGS = -serial stdio -display none
OBJDUMP_BINARY = aarch64-none-elf-objdump
9 changes: 5 additions & 4 deletions 03_hacky_hello_world/src/panic_wait.rs
Original file line number Diff line number Diff line change
@@ -51,13 +51,14 @@ fn panic(info: &PanicInfo) -> ! {
};

println!(
"Kernel panic!\n\n\
Panic location:\n File '{}', line {}, column {}\n\n\
{}",
"Kernel panic!\n\
{space}Panic message:\n{space}{space}{}\n\
{space}Panic location:\n{space}{space}File '{}', line {}, column {}",
info.message().unwrap_or(&format_args!("")),
location,
line,
column,
info.message().unwrap_or(&format_args!("")),
space = " ",
);

cpu::wait_forever()
2 changes: 1 addition & 1 deletion 04_safe_globals/Makefile
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
OBJDUMP_BINARY = aarch64-none-elf-objdump
NM_BINARY = aarch64-none-elf-nm
2 changes: 1 addition & 1 deletion 05_drivers_gpio_uart/Makefile
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
OBJDUMP_BINARY = aarch64-none-elf-objdump
NM_BINARY = aarch64-none-elf-nm
2 changes: 1 addition & 1 deletion 07_timestamps/Makefile
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
OBJDUMP_BINARY = aarch64-none-elf-objdump
NM_BINARY = aarch64-none-elf-nm
2 changes: 1 addition & 1 deletion 08_hw_debug_JTAG/Makefile
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
OBJDUMP_BINARY = aarch64-none-elf-objdump
NM_BINARY = aarch64-none-elf-nm
2 changes: 1 addition & 1 deletion 09_privilege_level/Makefile
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
OBJDUMP_BINARY = aarch64-none-elf-objdump
NM_BINARY = aarch64-none-elf-nm
2 changes: 1 addition & 1 deletion 10_virtual_mem_part1_identity_mapping/Makefile
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
OBJDUMP_BINARY = aarch64-none-elf-objdump
NM_BINARY = aarch64-none-elf-nm
2 changes: 1 addition & 1 deletion 11_exceptions_part1_groundwork/Makefile
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
OBJDUMP_BINARY = aarch64-none-elf-objdump
NM_BINARY = aarch64-none-elf-nm
2 changes: 1 addition & 1 deletion 12_integrated_testing/Makefile
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
QEMU_TEST_ARGS = $(QEMU_RELEASE_ARGS) -semihosting
OBJDUMP_BINARY = aarch64-none-elf-objdump
2 changes: 1 addition & 1 deletion 12_integrated_testing/README.md
Original file line number Diff line number Diff line change
@@ -449,7 +449,7 @@ provided to it by `cargo`, and finally compiles a `docker` command to execute th
reference, here it is fully resolved for an `RPi3 BSP`:

```bash
docker run -t --rm -v /opt/rust-raspberrypi-OS-tutorials/12_integrated_testing:/work/tutorial -w /work/tutorial -v /opt/rust-raspberrypi-OS-tutorials/12_integrated_testing/../common:/work/common rustembedded/osdev-utils:2021.12 ruby ../common/tests/dispatch.rb qemu-system-aarch64 -M raspi3 -serial stdio -display none -semihosting -kernel $TEST_BINARY
docker run -t --rm -v /opt/rust-raspberrypi-OS-tutorials/12_integrated_testing:/work/tutorial -w /work/tutorial -v /opt/rust-raspberrypi-OS-tutorials/12_integrated_testing/../common:/work/common u007d/osdev-utils-rpi4:2023.09 ruby ../common/tests/dispatch.rb qemu-system-aarch64 -M raspi3 -serial stdio -display none -semihosting -kernel $TEST_BINARY
```

This command is quite similar to the one used in the `make test_boot` target that we have since
2 changes: 1 addition & 1 deletion 13_exceptions_part2_peripheral_IRQs/Makefile
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
QEMU_TEST_ARGS = $(QEMU_RELEASE_ARGS) -semihosting
OBJDUMP_BINARY = aarch64-none-elf-objdump
2 changes: 1 addition & 1 deletion 14_virtual_mem_part2_mmio_remap/Makefile
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
QEMU_TEST_ARGS = $(QEMU_RELEASE_ARGS) -semihosting
OBJDUMP_BINARY = aarch64-none-elf-objdump
2 changes: 1 addition & 1 deletion 15_virtual_mem_part3_precomputed_tables/Makefile
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
QEMU_TEST_ARGS = $(QEMU_RELEASE_ARGS) -semihosting
OBJDUMP_BINARY = aarch64-none-elf-objdump
2 changes: 1 addition & 1 deletion 16_virtual_mem_part4_higher_half_kernel/Makefile
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
QEMU_TEST_ARGS = $(QEMU_RELEASE_ARGS) -semihosting
OBJDUMP_BINARY = aarch64-none-elf-objdump
2 changes: 1 addition & 1 deletion 17_kernel_symbols/Makefile
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
QEMU_TEST_ARGS = $(QEMU_RELEASE_ARGS) -semihosting
OBJDUMP_BINARY = aarch64-none-elf-objdump
2 changes: 1 addition & 1 deletion 18_backtrace/Makefile
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
QEMU_TEST_ARGS = $(QEMU_RELEASE_ARGS) -semihosting
OBJDUMP_BINARY = aarch64-none-elf-objdump
2 changes: 1 addition & 1 deletion 19_kernel_heap/Makefile
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
QEMU_TEST_ARGS = $(QEMU_RELEASE_ARGS) -semihosting
OBJDUMP_BINARY = aarch64-none-elf-objdump
2 changes: 1 addition & 1 deletion 20_timer_callbacks/Makefile
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
QEMU_TEST_ARGS = $(QEMU_RELEASE_ARGS) -semihosting
OBJDUMP_BINARY = aarch64-none-elf-objdump
2 changes: 1 addition & 1 deletion X1_JTAG_boot/Makefile
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ else ifeq ($(BSP),rpi4)
TARGET = aarch64-unknown-none-softfloat
KERNEL_BIN = kernel8.img
QEMU_BINARY = qemu-system-aarch64
QEMU_MACHINE_TYPE =
QEMU_MACHINE_TYPE = raspi4
QEMU_RELEASE_ARGS = -serial stdio -display none
OBJDUMP_BINARY = aarch64-none-elf-objdump
NM_BINARY = aarch64-none-elf-nm
2 changes: 1 addition & 1 deletion common/docker.mk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DOCKER_IMAGE := rustembedded/osdev-utils:2021.12
DOCKER_IMAGE := u007d/osdev-utils-rpi4:2023.09
6 changes: 3 additions & 3 deletions docker/rustembedded-osdev-utils/Makefile
Original file line number Diff line number Diff line change
@@ -4,14 +4,14 @@

# Reference followed: https://www.docker.com/blog/getting-started-with-docker-for-arm-on-linux

TAG := 2021.12
TAG := 2023.09

default: build_local

build_local:
cp ../../Gemfile .
docker build \
--tag rustembedded/osdev-utils:$(TAG) \
--tag u007d/osdev-utils-rpi4:$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` .
rm Gemfile

@@ -20,6 +20,6 @@ buildx_push:
docker buildx build \
--push \
--platform linux/arm64/v8,linux/amd64 \
--tag rustembedded/osdev-utils:$(TAG) \
--tag u007d/osdev-utils-rpi4:$(TAG) \
--build-arg VCS_REF=`git rev-parse --short HEAD` .
rm Gemfile