This project uses a sh to automate the build process and generate the kernel8.img
file. Follow the steps below to successfully compile the project:
-
GCC Toolchain: The Makefile uses the
aarch64-elf
cross-compiler. Ensure that this toolchain is installed.- You can download the toolchain from the official Arm website.
-
ARMGNU Variable: The Makefile defines the cross-compiler prefix with the
ARMGNU
variable. If your toolchain has a different prefix, adjust theARMGNU
variable in the Makefile:ARMGNU ?= aarch64-elf
By following these steps and adjusting the Makefile variables and paths as necessary, you should be able to compile and build your project successfully.
To build the project, run the following command:
./build.sh
To enable UART communication on your Raspberry Pi 4, follow these steps to correctly connect the TTL-to-USB adapter to the Pi’s GPIO pins.
Use the following GPIO pins on the Raspberry Pi 4 for UART:
- TX (Transmit): GPIO 14 (Pin 8)
- RX (Receive): GPIO 15 (Pin 10)
- GND (Ground): Pin 6
Now, connect the TTL-to-USB adapter cables as follows:
- Adapter TX (usually an green wire) → Raspberry Pi RX (GPIO 15, Pin 10)
- Adapter RX (usually a white wire) → Raspberry Pi TX (GPIO 14, Pin 8)
- Adapter GND (usually a black wire) → Raspberry Pi GND (Pin 6)
To enable UART on the Pi, follow these steps:
-
Edit the config.txt file on the sd card:
-
Add the following lines to enable UART:
enable_uart=1 enable_gic=1 hdmi_group=1 hdmi_mode=16 core_freq_min=500
Once connected, you can use a terminal application (like Putty
on Windows or minicom
on Linux) to interface with the Raspberry Pi via the UART connection. Ensure you set the baud rate to 115200.