BareMetal icon indicating copy to clipboard operation
BareMetal copied to clipboard

Supporting armv8 and the Raspberry Pi 3 Model B

Open ghost opened this issue 7 years ago • 8 comments

I'm wondering at what point is the armv8 architecture going to be supported, as I just found out that the Raspberry Pi 3 Model B uses this architecture. It would be interesting to have BareMetal run on a Pi.

I could start working on this, if you want. I've wanted to purchase a Pi for a while now, and I'm betting there's emulators for armv8 too that I could use to get it started.

ghost avatar May 16 '17 17:05 ghost

Absolutely! This is a valid target as I did not want to deal with 32-bit hardware.

The big question is how is the wired network device connected internally? I thought it was via USB for previous models.

Also, there are some notes here on using QEMU to emulate the hardware.

IanSeyler avatar May 16 '17 17:05 IanSeyler

Based on this block diagram it looks like USB would be needed.

IanSeyler avatar May 16 '17 18:05 IanSeyler

Okay. I think implementing the Ethernet transmit and receive functions should still be doable.

ghost avatar May 16 '17 18:05 ghost

Have you heard of Keystone? It supports the aarch64 architecture. It might be a good alternative to use instead of the binutils toolchain.

The issue close and reopen was just keyboard clumsiness.

Correction: Keystone is just an assembler framework. It maybe useful for writing an assembler for the kernel, but I'll shelf that idea for now. I'm using the bintutils toolchain for arm until I can find a better alternative.

ghost avatar May 16 '17 18:05 ghost

I published a Debian package for binutils-aarch64-elf, which is usable for the kernel development. I'll add a corresponding gcc-aarch64-elf when it comes time to start compiling BMFS and Alloy.

The Debian package for bmfs-aarch64-elf is available via:

sudo add-apt-repository ppa:taylorcholberton/binutils-aarch64-elf
sudo apt update
sudo apt install binutils-aarch64-elf

It's currently available for Ubuntu:

  • 17.10 (Artful)
  • 17.04 (Zesty)
  • 16.10 (Yakkety)

ghost avatar May 16 '17 20:05 ghost

I think the memory allocation should be written in C. It's going to work exactly the same as the x86_64 architecture, and writing it in C will make it easily unit tested, able to be shared among all supported architectures and easier to maintain. Although this would make the kernel a mixture of C and assembly and not pure assembly, it would have very little or no performance cost. It may even increase performance of the GCC optimizations are good enough. What do you think?

ghost avatar Jun 03 '17 19:06 ghost

This would be the board to target initially: https://www.pine64.org/?page_id=1459

IanSeyler avatar Oct 25 '18 16:10 IanSeyler

I have that board. Haven't got around to testing it yet.

ghost avatar Oct 25 '18 16:10 ghost

Closing this for now. Can re-open a new issue when a use case comes along.

IanSeyler avatar Nov 22 '22 21:11 IanSeyler