AArch64 tutorials

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
ababo
Member
Member
Posts: 27
Joined: Thu Jun 13, 2013 8:20 am
Location: Ukraine

AArch64 tutorials

Post by ababo »

Hi guys,

I plan to start a new iteration of my toy kernel development, fourth time rewriting from scratch all of my code. In order to improve portability I would prefer to support two different CPU platforms. My kernel design needs 64-bit CPU (all available persistent storage will be mapped into address space); now my code runs on x86_64. I start thinking about supporting of AArch64 (ARMv8, ARM64) also. Here comes my question.

Where can I find some tutorials about writing kernel level code for AArch64 which explain:
1. Necessary steps for obtaining/building/configuring all needed tools (compiler, emulator, ...).
2. First coding steps (getting started, minimal kernel, etc.).

Thanks in advance.
Last edited by ababo on Wed Jul 30, 2014 4:08 am, edited 1 time in total.
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: AArch64 tutorials

Post by Owen »

Considering the only ARMv8 chip in any volume production has a fruit logo on it... You'll find yourself to be out of look
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: AArch64 tutorials

Post by bwat »

Owen wrote:out of look
Scouse?
Every universe of discourse has its logical structure --- S. K. Langer.
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: AArch64 tutorials

Post by Owen »

Typing on a phone obviously uses enough of my mental faculties that I end up picking random homonyms occasionally :-)
User avatar
ababo
Member
Member
Posts: 27
Joined: Thu Jun 13, 2013 8:20 am
Location: Ukraine

Re: AArch64 tutorials

Post by ababo »

Six months after starting this topic we still have neither tutorials nor tools.
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: AArch64 tutorials

Post by Owen »

The only ways to get an AArch64 processor at present are:
  • Purchase an ARM Juno board. These are very expensive and shipping in very limited quantities to ARM partners.
  • Purchase a mobile device from Apple. Their chips remain the only devices shipping in volume.
ARM's Juno "demonstration and development" processors only taped out ~8 months ago. We are still waiting on people to start shipping chips (Altera's Stratix 10 FPGA SoCs might be some of the first devices to ship, with A53 cores. Do not expect them to be cheap - we are talking ~$500+ per chip here, in volume).

AArch64 has been supported by Clang and GCC for a while. You can successfully build code today. ARM released their AArch64 emulator a few months ago; its' intended to run Linux, but you can use it to run your own code fine.

Expect chips to start shipping in production volumes towards the end of this year. Development board availability will probably be a while after that.

I have to question any kernel design which involves mapping all persistent storage into the process' address space. That only covers 280TB on both AArch64 and AMD64, which isn't a lot of storage in the grand scheme of things (or: my friend has nearly 32TB of storage in his home server. That only takes 5 HDDs)

Note: Any statements with regards to time schedules of board and/or chip availability are my own predictions based upon publicly available information, and should not be construed as official information from my soon-to-be employer and/or their partners
User avatar
ababo
Member
Member
Posts: 27
Joined: Thu Jun 13, 2013 8:20 am
Location: Ukraine

Re: AArch64 tutorials

Post by ababo »

AArch64 has been supported by Clang and GCC for a while. You can successfully build code today. ARM released their AArch64 emulator a few months ago; its' intended to run Linux, but you can use it to run your own code fine.
Yes, I already have Aarch64 GCC compiler and tools (I think they come out of the box in Ubuntu 14.04) and qemu system emulator (built from Linaro sources). My problem is to do the first steps. I mean a simple tutorial which describes how to build a simplest Hello World binary and to run it on this emulator.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: AArch64 tutorials

Post by Combuster »

QEMU always emulates a certain piece of hardware. Graphics is not part of any specific ARM standard, so you either need to figure out which framebuffer device QEMU runs, or possibly a serial port.

But considering the lack of public hardware as mentioned, it might just be some developer sketch with random hardware, and you're best off scourging their territory for whatever test image the developer/maintainer in question used to test the thing so you have a working reference.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
ababo
Member
Member
Posts: 27
Joined: Thu Jun 13, 2013 8:20 am
Location: Ukraine

Re: AArch64 tutorials

Post by ababo »

QEMU always emulates a certain piece of hardware. Graphics is not part of any specific ARM standard, so you either need to figure out which framebuffer device QEMU runs, or possibly a serial port.
Yes, for now only serial port makes sense.
But considering the lack of public hardware as mentioned, it might just be some developer sketch with random hardware, and you're best off scourging their territory for whatever test image the developer/maintainer in question used to test the thing so you have a working reference.
Yes, this is a problem, but again, for now I need to write the most generic code like memory management, thread scheduling, etc, so this is not an issue yet.
I have to question any kernel design which involves mapping all persistent storage into the process' address space. That only covers 280TB on both AArch64 and AMD64, which isn't a lot of storage in the grand scheme of things (or: my friend has nearly 32TB of storage in his home server. That only takes 5 HDDs)
I believe future extensions/implementations will push this limit. For now + 5-10 years 48 bits will be quite enough for most of machines.
Post Reply