[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
howtos:hardware:arm:gcc_aarch64_cross-compiler [2016/12/17 20:09 (UTC)] – correcting errors exaga | howtos:hardware:arm:gcc_aarch64_cross-compiler [2017/01/13 10:18 (UTC)] – corrected text exaga | ||
---|---|---|---|
Line 5: | Line 5: | ||
I was thinking about the Cortex-A53 64-bit CPU on my Raspberry Pi 3 and why I'm mainly using Slackware ARM 32 bit operating system on it. Then I started to wonder if it would be possible to build an arm64 kernel and modules to run with Slackware ARM. After reading about how this could be achieved it seemed clear that some cross-compiling would be required. Although I have some experience in building Linux kernels, especially for the Raspberry Pi platform, I'd never done any cross-compiling before a week ago. So, this whole concept was brand new to me. | I was thinking about the Cortex-A53 64-bit CPU on my Raspberry Pi 3 and why I'm mainly using Slackware ARM 32 bit operating system on it. Then I started to wonder if it would be possible to build an arm64 kernel and modules to run with Slackware ARM. After reading about how this could be achieved it seemed clear that some cross-compiling would be required. Although I have some experience in building Linux kernels, especially for the Raspberry Pi platform, I'd never done any cross-compiling before a week ago. So, this whole concept was brand new to me. | ||
- | For my first attempt (and largely based on reading about how other users were doing it) I used an Ubuntu 16.04.1 LTS (64 bit) system to cross-compile an arm64 kernel for the Raspberry Pi 3. However, the results of doing things by this method were somewhat lacking and created many unforeseen errors. Then I remembered something [[http:// | + | For my first attempt (and largely based on reading about how other users were doing it) I used an Ubuntu 16.04.1 LTS (64 bit) system to cross-compile an arm64 kernel for the Raspberry Pi 3. However, the results of doing things by this method were somewhat lacking and created many unforeseen errors. Then I remembered something [[http:// |
As things have turned out, it wasn't //that// difficult. Investing some time into reading about toolchains and how to build cross-compilers was required, as well as testing the results of cross-compiling, | As things have turned out, it wasn't //that// difficult. Investing some time into reading about toolchains and how to build cross-compilers was required, as well as testing the results of cross-compiling, | ||
Line 133: | Line 133: | ||
</ | </ | ||
- | You should see the first $PATH entry is to your installation directory' | + | You should see the first $PATH entry is to your installation directory' |
< | < | ||
Line 282: | Line 282: | ||
=== Building the arm64 device tree blob(s) === | === Building the arm64 device tree blob(s) === | ||
- | Device tree is a means of describing hardware which is read by the kernel at boot time to tell it what hardware exists on the system. In our case it relates to the Raspberry Pi 3 and is the method by which the systems knows which drivers to load for the hardware. On ARM-based devices the use of device trees has become mandatory for all new SOCs, including the Raspberry Pi. The device tree blob you will be building | + | Device tree is a means of describing hardware which is read by the kernel at boot time to tell it what hardware exists on the system. In our case it relates to the Raspberry Pi 3 and is the method by which the systems knows which drivers to load for the hardware. On ARM-based devices the use of device trees has become mandatory for all new SOCs, including the Raspberry Pi. The device tree blobs you will be building |
To build the Raspberry Pi device tree blob(s) run the following command: | To build the Raspberry Pi device tree blob(s) run the following command: | ||
Line 304: | Line 304: | ||
=== Installing the arm64 modules === | === Installing the arm64 modules === | ||
- | Once the modules have been built, you have to 'make modules_install' | + | Once the modules have been built, you have to 'make modules_install' |
+ | |||
+ | You could build // | ||
First you need become ' | First you need become ' | ||
Line 320: | Line 322: | ||
< | < | ||
ls -lah arch/ | ls -lah arch/ | ||
- | la -lah arch/ | + | la -lah arch/ |
ls -lah / | ls -lah / | ||
</ | </ | ||
Line 326: | Line 328: | ||
If you can see that they all exist, then everything has worked as planned. | If you can see that they all exist, then everything has worked as planned. | ||
- | ==== Copying the arm64 kernel, modules, and device tree blob (DTB) ==== | + | ==== Copying the arm64 kernel, modules, and device tree blobs (DTB) ==== |
Connect the (spare) microSD card containing a working Slackware ARM current system to your Raspberry Pi 3 using a USB microSD card reader. You'll need to mount the partitions first, before copying the arm64 kernel, modules, and device tree blob(s) onto it. | Connect the (spare) microSD card containing a working Slackware ARM current system to your Raspberry Pi 3 using a USB microSD card reader. You'll need to mount the partitions first, before copying the arm64 kernel, modules, and device tree blob(s) onto it. | ||
Line 375: | Line 377: | ||
</ | </ | ||
- | The next thing to do is copy the arm64 kernel, modules, and device tree blob to your mounted directories. It's important to get this right. After all the hard work you've done it would be a shame to mess it up at this stage. | + | The next thing to do is copy the arm64 kernel, modules, and device tree blobs to your newly mounted directories. It's important to get this right. After all the hard work you've done it would be a shame to mess it up at this stage. |
To copy these files, run the following commands, as ' | To copy these files, run the following commands, as ' | ||
Line 381: | Line 383: | ||
< | < | ||
cp build-dir/ | cp build-dir/ | ||
- | cp build-dir/ | + | cp build-dir/ |
- | cp -arv / | + | cp -rv / |
</ | </ | ||
Line 389: | Line 391: | ||
< | < | ||
ls -lah rpi-boot/ | ls -lah rpi-boot/ | ||
- | ls -lah rpi-boot/ | + | ls -lah rpi-boot/ |
ls -lah rpi-root/ | ls -lah rpi-root/ | ||
</ | </ | ||
Line 414: | Line 416: | ||
</ | </ | ||
- | Remove the USB microSD card reader and swap microSD cards. Power on the Raspberry Pi and boot the microSD card on which you copied the arm64 kernel, modules, and device tree blob. | + | Remove the USB microSD card reader and swap microSD cards. Power on the Raspberry Pi and boot the microSD card on which you copied the arm64 kernel, modules, and device tree blobs. |
+ | |||
+ | ==== The end result ==== | ||
+ | |||
+ | After booting the system with the arm64 kernel, I logged in remotely via SSH as ' | ||
+ | |||
+ | < | ||
+ | login as: root | ||
+ | root@192.168.10.33' | ||
+ | Last login: Sat Dec 17 20:32:50 2016 from 192.168.10.10 | ||
+ | Linux 4.8.13-v8-arm64. | ||
+ | root@drie: | ||
+ | Linux version 4.8.13-v8-arm64 (exaga@drie) (gcc version 5.4.0 (GCC) ) #2 SMP Fri Dec 16 18:43:38 GMT 2016 | ||
+ | root@drie: | ||
+ | Linux drie 4.8.13-v8-arm64 #2 SMP Fri Dec 16 18:43:38 GMT 2016 aarch64 GNU/Linux | ||
+ | root@drie: | ||
+ | Slackware 14.2 | ||
+ | root@drie: | ||
+ | Raspberry Pi 3 Model B Rev 1.2 | ||
+ | root@drie: | ||
+ | 0x4135b94e | ||
+ | root@drie: | ||
+ | </ | ||
+ | |||
+ | Although I've already come across a few things which need some work, and attention, it's a start. I hope to find more time to devote towards Slackware arm64 over Christmas and the New Year 2017. | ||
+ | Thanks for being interested. <3 | ||
====== Sources ====== | ====== Sources ====== |