unrelenting.technology

Hi! You are viewing the archive of unrelenting.technology. This website is no longer updated, my current one is val.packett.cool. Check it out instead :)

Tag #arm

Happy new year! Since I haven’t been posted in a while, here’s what I’ve been up to lately:

  • adopted Wezterm as my terminal emulator, contributing a bunch of (mostly Wayland-related) patches in process
  • figured out a minimal tool to make Xiaomi power strips work without the “cloud”
  • saw a SIMD-accelerated tac line-reversing utility and immediately ported it to arm64 NEON/AdvSIMD
  • helped out with firmware and EC (just testing with the latter) patches for the Thinkpad L430/L530
  • developed a FreeBSD driver for the SPI keyboard/touchpad attachment in Apple MacBooks (currently only in my fork and only tested on the 2015 MBP, spibus-side prerequisites are in review)
    • related: got the Magic Trackpad 2 (which uses a compact packet format but similar surroundings to bcm5974) working too
  • started learning PCB design with Horizon EDA
  • found bugs in the mold linker and zlib-ng
  • made new Wayfire plugins: wf-globalgestures, wf-dynspaces, wf-touchpad-gesture-drag (yeah, turns out 3-finger drag is easy with current libinput: it’s a hold-cancel-swipe sequence!)
  • finally made a freebsd-embedded-hal Rust crate
  • just now added dark mode to micro-panel where I’m writing this

Unusually, I do have a legit new year’s resolution this time: I should blog more! Want to publish some long-form things here.

Cool ARM laptop news that I missed somehow:

Looks like NetBSD is already working on the EC2 AArch64 instances! My attempt at running FreeBSD there failed: for mysterious reasons, the system reboots just after the last loader.efi message..

Trying to do anything system-level on EC2 is incredibly frustrating. There is STILL no read-write access to the serial console, because Bezos doesn’t believe in debugging or something >_<

Also, about the ARM instances themselves. I am happy to see a big player enter the ARM space. And with custom (Annapurna) chips, even. (Though they’d have much better performance if they just bought some Ampere eMAGs or Cavium ThunderX2s.)

But what’s up with that price? Did anyone at AWS ever look at Scaleway’s pricing page?! On-demand pricing for a single core EC2 ARM instance is almost 20 bucks per month! While Scaleway offers four ThunderX cores for three euros per month!! Sure sure Scaleway is not a big player and doesn’t have a huge ecosystem and is getting close to being out of stock on these ARM instances.. but still, 1/4 the cores for 5x the price.

(Spot pricing is better of course.)

Another weird LLVM mystery solved!

So, I was porting LDC to FreeBSD/aarch64, wondering why global constructors (you know, the before-main() code you can make in C using an __attribute__ thingy) aren’t running… but only when the executable is linked with LLD. Turns out:

  • .init_array is the only supported way to do constructors on AArch64
  • and everything in general is moving towards .init_array — but the default in LLVM is still to emit .ctors
  • clang has code to enable .init_array when appropriate, ldc did not
  • and the reason it all worked fine with bfd and gold is that these linkers SILENTLY convert .ctors to .init_array. For PERFORMANCE REASONS.

An SPI flash chip module arrived in the mail today. I ordered that for replicating this basically. To (network) boot the Orange Pi PC without microSD.

Naturally, instead of booting Linux to flash or (?) trying flash from U-Boot itself, time was spent on making flashrom work on FreeBSD :)

Scaleway’s ARM64 VPS has been successfully depenguinated! :) Now you can run FreeBSD on four ThunderX cores, 2GB RAM and 50GB SSD for 3€/month. Awesome!

Also, in the process, I finally discovered the cause of GPT partitions sometimes disappearing on reboot. It was the size of the partition table. It’s 128 by default, but sometimes it’s not — e.g. on the FreeBSD installer memstick image, it’s 2. Creating a third partition with gpart “succeeded”, but the partition disappeared on reboot.

Screenshot of htop with 96 CPU cores

For 0.5 dollars per hour (or currently 0.1/hr if you reserve for 24h?) on packet.net you can get access to a dedicated dual-socket Cavium ThunderX server with 128GB RAM and a 250GB SSD. I took it for a few hours and now lang/crystal, lang/mono and some other ports work on aarch64.

Ironically, these two builds have involved long single-threaded compile processes. In the mono case, parallelism had to be disabled for C# compilation to work around a concurrency bug.

At least building things like WebKitGTK+ (to test a one line patch) and Krita felt awesome :D