Українською

Target Park and Firmware Environment

Date: 07.07.2020

In the beginning and it was autumn of 2014, the CPU architectures considered to be targets for ANT were:

The target park started in the November 2014 from buying two 32 bit arm Single Board Computers (SBCs) — Beagle Bone Black and Cubieboard 2. x86 PCs have always been considered as targets, but the initial work was planned to start with something more "exotic". For not getting the design decisions biased towards the obviously dominant architecture, for not harming portability. So arm SBCs were considered a nice start. With jumping into x86 anytime as soon, as it's deemed possible to do development in parallel. Because ultimately, not starting with exotic things, but parallel development is the key for avoiding the bias.

Also, I bought iMac G5 the same month. Despite from the beginning it looked like an adventure, it was pleasant to have such a diversity. Also remembering that NT has been started exactly like this — targetting a lot of RISC architectures, among the dominant x86. Later, in 2016, I got a mips SBC, donated to me by a kind person, then Imagination employee, — Alexandru Voica. What was very nice and desired.

They, Imagination, had bought mips around 2013 and, apparently, had intentions of setting a serious competition to arm in the mobile segment with it. Within this goal, they launched several initiatives (I remember this purpl coallition or alliance or something like that) and, also, they launched a mips SBC — Mips Creator CI20, somewhere in 2014 or at the beginning of 2015, that should become a workplace for developers, on android, foremost. The board sparkled interest in appropriate circles. Articles and blog posts about it started to appear. I also saw these articles and, of course, decided to buy it. But, it turned out quickly, that the board is not delivered to Ukraine — it was 2015, the second year, since russia had started to implement its old, heinous plans of grabbing Ukraine back in its dirty paws, the second year of aggression, when everybody could see clearly, what russia really is...

I had been leaving complaining and sighing comments under such articles due to that unavailability and, once, in the autumn of 2015, around my birthday, I got a mail from Alexandru, that told me, they had to delete my comment (this time, it was on the Imagination site, apparently) due to "profanity", which is not allowed over there, but, also, he added, that he would want to send me the board. Worth to add yet, that he had to bother quite a bit with the sending, even the Royal Mail (of Britain) was experiencing issues with delivery to Ukraine then. He was able to send it only from the 3rd time. And I got as impudent as to ask if he hadn't forgotten about the promise (there was no updates from him for long). So, in the spring of 2016, I got a so desirable mips target. mips has a special place in my heart. And again, NT basically started to spin up on mips. After that Intel's RISC chip had proven to be problematic to start with.

Also, the park replenished with 64 bit arm machines. CSA90 Set Top Box (STB) and then Pine64+ were bought in the August 2015 and April of 2016 respectively. In the end of 2017, 32 bit CPU Banana Pi M2 Ultra board was bought and, in the July of 2018, I bought Rock64, sporting a 64 bit arm CPU. Finally, in the end of 2020, generous Tom Cubie (yes, that very same, who designed Cubieboards), from Radxa, gave me away a 4GB model of their amazing Rock Pi 4B board, adding a 32GB eMMC module. So, I've got a long wished RK3399 board.

Below is the list of the mentioned boards, plus a brand new ASRock x86 motherboard, bought somewhere in 2016 as an upgrade for the spare PC, with an older Asus motherboard from around 2001 ‐ 2002, taken from relatives. This ASRock board, powered with the powerful 3GHz Core 2 Duo E8400 CPU had since been considered as an x86 target:

The ASRock PC in the list, was the only real x86 motherboard, present in the park. But it lacked a power supply unit, so it was standing dormant all the time. And, unfortunately, it didn't do UEFI. mips Creator CI20 was the only one of the mips architecture, it was 32 bit, dual core, at 1.2GHz. The iMac's processor was a 64 bit single core PowerPC processor. These two were interesting targets and having a diversity of target architectures was in its own interesting, as said above, but lack of compilers, being able to produce images in the Portable Executable (PE) format for these architectures was a stop factor. Neverthless, I had a bare metal programming experience with the mips machine, and still hoped, I could solve the compiler issue, so kept these not abandonded (too bad, the mips owners didn't have the same intentions for the architecture, they bought just to abandon it shortly after).

And then war knocked at our home. Again... (russian bastards started the invasion yet in the end of 2013). At 24 February 2022, a so called "hybrid war" ended, now they went the full scaled aggression against Ukraine by massive missile shelling the whole Ukraine's territory. I clearly remember that morning. 13 April 2022, we had to flee the home, Bachmut, Ukraine, Donetsk region, due to the rapidly arising risk of getting killed. The government urged the population of our region to evacuate. Missile shelling has become a routine for Bachmut. We had to evacuate from Kramatorsk, but at 8 April, russian unhumans, shelled its railway station, one of the main evacuation points for Donetsk region residents, by a rocket. That terrorist act killed 61 people, among which 7 children.

As of the November 2022 (and now October 2023), I even don't know if our home is not destroyed, damaged — certainly (this is its photo, taken in the middle of October 2022, the damaged appartment on the 5th floor is in our entrance). Update (06.2023): this is how the home looked at around February ‐ March 2023, it's from the other side. As heartbreaking as expected... russians ruined our home, we've been living in for more, than 32 years before these unhumans came to "save us". We had to flee it and we had to leave everything there. All the boards, bought and received before 2022, together with my main working computer, "Drugh" ("Friend, Buddy") got left too. The home got ruined, with whole Bachmut, only memories remained. russians keep aggressively attacking the town. What they can't capture, they wipe from the face of Earth. Like what they did with Mariupol, Volnovakha, Popasna, and many dozens of villages and small towns in the North, East and South of Ukraine, like what they are doing with Bachmut. Our Opytne, a quiet suburb south of it is on the front line. All this time. As of June 2023, the town is completely ruined. And we are homeless internal refugees now and live near Kyiv in a rented appartment, being under an undefined status and future. And constant missile shelling by the same muscovite maniacs. Buying a new appartment is absolutely out of our reach. Renting is biting too, there is no way for me to buy even a tiny ARM SBC now. The only machines, I own for now (July 2023) and can test the project on are 2 working/home laptops — Iridium and Gallium (see here on the nicknames), that we were able to take with us. We had a laptop bag, so it was easy to guess to put them there and take during the escape, I didn't take the SBCs even though it wouldn't take much space, because, we were full of the hope to be back home... All the lost machines are marked in the nickname list and machine table appropriately. Target architectures, has been minimized to x64 and arm64. Target park as for the July 2023 consists of the 2 mentioned laptops and the virtual machines, provided by the Qemu and Virtual Box emulators for the aforementioned architectures.

Before narrowing the target architectures set down, there also was period, where I considered mips SoCs, found in modern retrogaming consoles. At some point, it was discovered, that there were numerous hand held retrogaming consoles, produced with very similar mips processors, from the same vendor (Ingenic). Mostly these used single core jz4770 (Creator CI20 is jz4780) and there was also a newer and mysterious SoC — x1830, it ran at 1.5GHz and could be overclocked to 1.9GHz. Game Kiddy 350H used it. So, maybe, if there was possibility to get some of such consoles, it would make a nice addition to the park? However, given its specific use case and form factor, it could be a target for a rather special purpose port, which is, of course, interesting too, nevertheless!

This retrogaming targets talk touches the topic, described in the later section, so here only briefly about it: ANT is being designed not just for serving a desktop role. Mobile role is in the list as well. The desktop role may be "the main" one, but definitely not the only one. Given how widespread mobile systems are for now, it would be rather unwise to not pay attention to this segment. Retrogaming devices are kind of yet a more specific subset of the mobile segment and are interesting of course, as well. But mips got abandoned by the owner, who bought it and we decided to narrow the architecture set, so these thoughts about mips handheld targets are historical now. However, mobile segment and even retrogame consoles (arm64 ones) are being considered.

Speaking of "if there was possibility"...

Since there is no usable project yet, asking about donation and expecting it to be satisfied, would be rather naive. Yet, I, being naive, have set a donation page up. At least as a placeholder for the future willing to help the project. Visit it, please, for more detail on this, if you feel like it. And below is a "nice to have" list (irrelevant entries are marked), showing, what we longed for or still do:


Target Firmware Environment

x86

Target firmware environment is primarily UEFI. Legacy BIOS is also considered, however it has gotten vastly irrelevant as for 2023. Supported bitness on x86 is 64 bits only, because x86 has moved into that land a long time ago. Agree, 32 bits don't look relevant on this architecture, all x86 processors, produced in the last 15 years are 64 bit. But the intention is to create ANT as much portable as possible, so, later, 32 bit x86 support could be added by those, willing it.

arm

Target firmware environment is primarily UEFI, be it EDK2 or uboot or any other compliant implementation.

Firmwareless, plain uboot environment, without any functionality, exposed to the Loader, was discarded as a way into nowhere yet in the beginning of 2020. Although, there had been some work in an attempt of using it (torturizing yourself with those go, bootm and booti commands). The outcomes of that were — bare metal programming experience addition and realizing, that the plain uboot is just a Linux loader, not a firmware and that I need to switch to UEFI, on arm as well, support of which in uboot has gotten significantly improved at that moment.

Initially, for arm, as you can see by then available SBCs, there had been a mix of 32 bit and 64 bit machines, that indicated the initial intention of supporting both bitnesses. But later, more and more it was getting clear, that 32 bit on arm is getting outdated just like with x86. Anyway, I kept supporting arm32 targets: had been compiling and testing the code on them, although, admittedly, this fact of it getting outdated was a bit of discomfort. Finally, after losing the initial target park, I discarded arm32 from the support list.

Others (historical)

For the mips machine, the "firmware" was plain uboot and for iMac — OpenFirmware. There was no 64 bit mips machine in the park as mentioned above. As of iMac, its processor was 64 bit, but the machine itself had only 512MB of RAM. Since on ppc (just like on mips), you have equally (many) general purpose registers in both bitnesses, using 64 bit mode, would only pressure CPU caches. The thought was: who knows, ppc is the least explored field, it's not a first target, we will see later. The "later" made these targets disappear in the ruins of war...

Brief retrospective

Initially, the first target architectures were arm and mips, but with the discovered later compiler issues (lack of PE support), x86 was added into the first line instead of mips. The most attention got arm64 first, followed by arm32 and then x64. But then arm32 was obsoleted. The same applies to the kind of "popular" and "promising" riscv. I have been considering it a target, at least a future one, "why not", but.

  1. There is no target machine in the park, other, than the very limited Qemu's virt
  2. There is no PE capable compiler. And even though, I've written a PeGen utility, able to translate an ELF image into a PE one, taking care of base relocation handling, this doesn't solve the issue of lacking __declspec(dllimport) support, with the latter, requiring changes in the code generation part of compiler to be added, a non-trivial challenge, definitely outside of our scope
  3. Finally, there is no enough manpower for a single person to take this one on board, especially taking into account, that the architecture doesn't shine this much in reality as it does in the fanbase mouth, look for example at how miserable the available park is

So, as for 2023, riscv isn't being considered a target. A possible subject to change, anyway, should it become really appealing, feasible and reachable to work on.


In the end of this section, let's introduce some naming conventions for avoiding repetitions of lengthy names and other confusions. So:

And yet, for the same space saving, here is the list of names for target machines, because, silly or not, writing everytime "Beagle Bone Black" or "that ASRock x64 motherboard" instead of Muran or Sirco is not a fun, so the names, we will always spell them stylized like in the previous examples and reference to this section, reasonably often through the documentation:

The below, are not exactly target park machines, rather working or home machines, but sometimes being used (carefully) as targets:


Let's summarize the information about the involved machines by a table, showing some hardware features of them.

Machine name Chipset (SoC), Vendor CPU implementation arch. version, bits num. of cores max. freq. MHz RAM RAM size GPU Note
ASRock G41C-GS-R2.0 Core Duo 2 E8400, G41, ICH7, Intel Wolfdale x86, 64 2 3000 DDR2 2GB Intel GMA X4500 lost in the ruined home
Beagle Bone Black Sitara AM3358, TI Cortex-A8 armv7, 32 1 1000 DDR3L 512MB PowerVR SGX530 lost in the ruined home
Cubieboard 2 A20, Allwinner Cortex-A7 2 1008 DDR3? 1GB Mali400 MP2 lost in the ruined home
Banana Pi M2 Ultra R40, Allwinner 4 1200 DDR3? 2GB lost in the ruined home
Pine64+ A64, Allwinner Cortex-A53 armv8, 64 4 1125 DDR3L 2GB lost in the ruined home
CSA 90 RK3368, Rockchip (4 + 4)1 1600? + 1400? DDR3? 1GB PowerVR G6110 lost in the ruined home
Rock64 RK3328, Rockchip 4 1300 LPDDR3 4GB Mali450 MP2 lost in the ruined home
Rock Pi 4B RK3399, Rockchip Cortex-A53 armv8, 64 4 1600? LPDDR4? 4GB Mali T860? lost in the ruined home
Cortex-A7221800?
mips Creator CI20 jz4780, Ingenic XBurst mips32r2, 32 2 1200 DDR3 1GB PowerVR SGX540 lost in the ruined home
iMac G5 PowerPC 975FX, IBM POWER4 POWER4, 64 1 1800 DDR 512MB nVidia GeForce FX 5200 Ultra lost in the ruined home
1 — big.LITTLE configuration with a dual cluster CPU, however, both clusters are "little" Cortex-A53 cores, the max frequencies and caches are different though.

The below table lists "not so target machines", still used as such, due to some reasons, mostly it's our work and/or home machines.

Machine name Chipset (SoC), Vendor CPU implementation arch. version, bits num. of cores max. freq. MHz RAM RAM size GPU Note
HP ProBook 4530s Core i3 2330M, Intel Sandy Bridge x86, 64 2 (41) 2200 DDR3 8GB GMA, Radeon Work/Home laptop
Xiaomi RedmiBook 16 Ryzen 5 4500U, AMD Ryzen 4th generation? 6 4??? DDR4? 16GB AMD Vega Work/Home laptop
1 — Hyperthreading, meaning the CPU core supports several thread contexts, that is several threads could run on the core the same time (at least to some degree).