···1414 I changed some things were I found it appropritate, but at the end of the day I think Thanos did a great job and since I'm just trying to learn more about the subject, this project was a godsend!
1515 Also, a good chunk of the documentation is taken from him... Looking up all the GPIO-addresses etc. must have been a nightmare.
1616* [Bare metal Raspberry Pi 3 tutorials (*Zoltan Baldaszti*)](https://github.com/bztsrc/raspi3-tutorial/): Really nice tutorial that introduces the basic ways of how HW and SW should interact with each other.
1717+* [Building an Operating System for the RaspberryPi (*Jake Sandler*)](https://jsandler18.github.io) Has a nice introduction to setting up dynamic memeory allocation for 32-bit systems, but seems a little bit light on some things.
1818+* [Raspberry Pi bare metal experiments (*Brian Widdas*)](https://github.com/brianwiddas/pi-baremetal)
1919+* [Learning operating system development using Linux kernel and Raspberry Pi (*Sergey Matyukevich*)](https://github.com/s-matyukevich/raspberry-pi-os) Lots of explenations about concepts related to OS developement using the Linux kernel and RPi OS as an example. Helps to understand some of the code out there doing things/solving things and seeing the bigger picture!
17201821## How to build the project?
1922As often with embedded projects, the toolchain hassle is real. The tricky part for this project is the compiler. Since we are writing code that is supposed to run on an ARM processor, you will need the corresponding compiler. All compilers to build for ARM CPU's can be found on [ARM's website](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads). You will most probably have to cross-compile (`x86`->`arm`) and you will need to be careful if you are compiling the kernel for a `32-bit` or a `64-bit` CPU (`arm-none-eabi` vs `aarch64-none-elf`).
···2326cmake -G Ninja -B ./build -S .
2427cmake --build ./build
2528```
2626-If you like to use docker, you can also use this minimal `Dockerfile` (for the `32-bit` version):
2727-```docker
2828-FROM rushmash/gcc-arm-embedded-docker:latest AS base
2929-3030-ARG BUILD_DIR=build
3131-3232-WORKDIR /home/piOS
3333-3434-COPY . .
3535-3636-FROM base AS build
3737-3838-RUN rm -rf ./${BUILD_DIR}
3939-RUN cmake -G Ninja -B ./${BUILD_DIR} -S .
4040-RUN cmake --build ./${BUILD_DIR}
4141-4242-FROM scratch AS export-stage
4343-COPY --from=build ./home/piOS/build/bin .
4444-4545-```
4646-and run it via
2929+... or you can use Docker
4730```bash
4831DOCKER_BUILDKIT=1 docker build --progress=plain -f Dockerfile --rm -t pi_os:latest . --output ${PATH_TO_WHERE_YOU_WANT_THE_ELF_AND_IMG}
4932```