Zak at Zak’s Electronics Blog is working on a network router using the Raspberry Pi Compute Module 4 and a custom base board with a Realtek RTL8111H PCIe Ethernet controller. Raspberry Pi OS doesn’t come pre-installed with the r8168 or r8169 driver needed for the RTL8111, but getting it compiled and installed is pretty easy. Or at least until Zak found out that it’s possible switch to a 64-bit kernel by adding arm_64bit=1
to /boot/config.txt!
The kernel is 64-bit, but all of the user space programs are still 32-bit. This is fine since all of the routing hard work stays within the kernel anyway. The full 64-bit Raspberry Pi OS is still in development so I wanted to stick with the 32-bit version for now.
I’ve never really touched Linux kernel stuff before. The first hurdle was that the Raspbian repository doesn’t have a cross-compiler for 64-bit ARM (aarch64) or headers for the 64-bit kernel. However, the kernel source which includes the headers can be downloaded from the Raspberry Pi GitHub repo. After more googling I found that the best way of getting an aarch64 compiler would be download the ubuntu arm64 base from http://cdimage.ubuntu.com/ubuntu-base/releases/ and follow the steps described here and here.
Zak posts a full set of commands to compile things including a command or two found to not be regularly documented.
See the details in the post here.
No comments:
Post a Comment