Porting Firefox To Apple Silicon: Tales From The Trenches

For any smaller and larger software product that aims to be compatible with Apple’s MacOS, the recent introduction of its ARM-based Apple Silicon processors and MacBooks to go with them came as a bit of a shock. Suddenly one of the major desktop platforms was going to shift processor architectures, and with it likely abandon and change a number of APIs. Over at Mozilla HQ, they assumed that based on past experiences, Apple’s announcement of ‘first Apple Silicon hardware’ would also mean that those systems would be available for sale.

Indeed, one week after the November 10th announcement Apple did in fact do so. By then, Mozilla had worked to ensure that the Firefox codebase could be built for Apple Silicon-based MacOS. Fortunately, through the experiences of running Firefox on Windows-on-ARM, they already had gained a codebase that was compatible with 64-bit ARM. Ultimately, the biggest snag here was the immature Rust language and dependency support for Apple Silicon, which set back the first release.

When it came to the distributing of Firefox on Intel- and ARM-based Macs, the decision was made to package both versions of the application into a so-called Universal Binary. While this pads out the size of the installer, it also means easier distribution and would not affect the built-in updater in Firefox. This also allowed for an easy fix for the Google Widevine DRM module, for which no Apple Silicon version was available at first, allowing the same module for Intel to be used with either Firefox version via the Rosetta 2 binary translator in MacOS (as we covered previously).

After this it was more or less smooth sailing, with some Rosetta 2-based glitches and MacOS Big Sur-related bugs that spoiled some of the fun. What this experience shows is that porting even a big codebase like Firefox to Apple’s new platform is fairly straightforward, with lack of support from toolchains and other dependencies the most likely things that may trip one up.

The Rosetta 2 feature, while helpful, also comes with its share of gotchas as the Firefox developers found out, and of course there is a lot more optimization that can (and should) be done for such a new platform.

The (Probably) Most Thoroughly Commented Linker Script For The SAM D21 MCU

Linker scripts are one of those things which nobody who does software development really wants to deal with, but like many things in life sometimes they are inevitable to make things work. Although one could keep pretending linker scripts do not exist and let IDEs handle such pesky details, some of us suffer from this unfortunate condition called ‘curiosity’ and just have to know. People like [Thea].

Recently, [Thea] wrote a blog post on exactly what the linker script generated by the Microchip IDE for a Cortex-M-based SAM D21 project does. The result is a nicely annotated overview of the file’s contents, accompanied by links to the Arm and GCC documentation as well as other references where appropriate. The entire linker script (.ld file) can be viewed on GitHub. With the SAM D21 being a popular choice for Arduino and Arduino-compatible board, this article is a good starting point to understanding what a linker script does and how it affects one’s project.

For other (Cortex-M) MCUs this linker script is also useful as a starting point. Especially knowing which sections are required and what changing them affects in the final (ELF) binary and the firmware that is ultimately written to the MCU. We recently covered linker scripts for Cortex-M as well, along with the concept of memory-mapped I/O.

DevTerm Beats Cyberdeck Builders To The Punch

What makes a cyberdeck? Looking as though it came from an alternate reality version of the 1980s is a good start, but certainly isn’t required. If you’re really trying to adhere to the cyberpunk ethos, any good deck should be modular enough that it can be easily repaired and upgraded over time. In fact, if it’s not in a constant state of evolution and flux, you’ve probably done something wrong. If you can hit those goals and make it look retro-futuristic at the same time, even better.

Which is why the Clockwork DevTerm is such an interesting device. It ticks off nearly every box that the custom cyberdeck builds we’ve covered over the last couple years have, while at the same time being approachable enough for a more mainstream audience. You won’t need a 3D printer, soldering iron, or hot glue gun to build your own DevTerm. Of course if you do have those tools and the skills to put them to work, then this might be the ideal platform to build on.

With a full-sized QWERTY keyboard and widescreen display, the DevTerm looks a lot like early portable computers such as the TRS-80 Model 100. But unlike the machines it draws inspiration from, the display is a 6.8 inch 1280 x 480 IPS panel, and there’s no pokey Intel 8085 chip inside. The $220 USD base model is powered by the Raspberry Pi Compute Module 3, and if you need a little more punch, there are a few higher priced options that slot in a more powerful custom module. Like the Waveshare Pi CM laptop we recently looked at, there’s sadly no support for the newer CM4; but at least the DevTerm is modular enough that it doesn’t seem out of the question that Clockwork could release a new mainboard down the line. Or perhaps somebody in the community will even do it for them.

Speaking of which, the board in the DevTerm has been designed in two pieces so that “EXT Module” side can be swapped out with custom hardware without compromising the core functionality of the system. The stock board comes with extra USB ports, a micro USB UART port for debugging, a CSI camera connector, and an interface for an included thermal printer that slots into a bay on the rear of the computer. Clockwork says they hope the community really runs wild with their own EXT boards, especially since the schematics and relevant design files for the entire system are all going to be put on GitHub and released under the GPL v3.

They say that anything that sounds too good to be true probably is, and if we’re honest, we’re getting a little of that from the DevTerm. An (CPU BLOBs aside!) open hardware portable Linux computer with this kind of modularity is basically a hacker’s dream come true, and thus far the only way to get one was to build it yourself. It’s hard to believe that Clockwork will be able to put something like this out for less than the cost of a cheap laptop without cutting some serious corners somewhere, but we’d absolutely love to be proven wrong when it’s released next year.

Hackaday Links: November 29, 2020

While concerns over COVID-19 probably kept many a guest room empty this Thanksgiving, things were a little different aboard the International Space Station. The four-seat SpaceX Crew Dragon is able to carry one more occupant to the orbiting outpost than the Russian Soyuz, which has lead to a somewhat awkward sleeping arrangement: there are currently seven people aboard a Station that only has six crew cabins. To remedy the situation, Commander Michael Hopkins has decided to sleep inside the Crew Dragon itself, technically giving himself the most spacious personal accommodations on the Station. This might seem a little hokey, but it’s actually not without precedent; when the Shuttle used to dock with the ISS, the Commander would customarily sleep in the cockpit so they would be ready to handle any potential emergency.

Speaking of off-world visitation, the Hayabusa2 spacecraft is nearly home after six years in space. It won’t be staying long though, the deep-space probe is only in the neighborhood to drop off a sample of material collected from the asteroid Ryugu. If all goes according to plan, the small capsule carrying the samples will renter the atmosphere and land in the South Australian desert on December 6th, while Hayabusa2 heads back into the black for an extended mission that would have it chasing down new asteroids into the 2030s.

Moving on to a story that almost certainly didn’t come from space, a crew from the Utah Division of Wildlife Resources recently discovered a strange metal monolith hidden in the desert. While authorities were careful not to disclose the exact coordinates of the object, it didn’t take Internet sleuths long to determine its location, in part thanks to radar data that allowed them to plot the flight path of a government helicopters. Up close inspections that popped up on social media revealed that the object seemed to be hollow, was held together with rivets, and was likely made of aluminum. It’s almost certainly a guerrilla art piece, though there are also theories that it could have been a movie or TV prop (several productions are known to have filmed nearby) or even some kind of military IR/radar target. We may never know for sure though, as the object disappeared soon after.

Even if you’re not a fan of Apple, it’s hard not to be interested in the company’s new M1 chip. Hackers have been clamoring for more ARM laptops and desktops for years, and with such a major player getting in the game, it’s only a matter of time before we start seeing less luxurious brands taking the idea seriously. After the recent discovery that the ARM version of Ubuntu can run on the new M1 Macs with a simple virtualization layer, it looks like we won’t have to wait too long before folks start chipping away at the Walled Garden.

In the market for a three phase servo controller? A reader who’s working on a robotics project worth as much as a nice house recently wrote in to tell us about an imported driver that goes for just $35. Technically it’s designed for driving stepper motors, but it can also (somewhat inefficiently) run servos. Our informant tells us that you’d pay at least $2,000 for a similar servo driver from Allen-Bradley, so the price difference certainly seems to make up for the hit in performance.

Finally, some bittersweet news as we’ve recently learned that Universal Radio is closing. After nearly 40 years, proprietors Fred and Barbara Osterman have decided it’s time to start winding things down. The physical store in Worthington, Ohio will be shuttered on Monday, but the online site will remain up for awhile longer to sell off the remaining stock. The Ostermans have generously supported many radio clubs and organizations over the years, and they’ll certainly be missed. Still, it’s a well-deserved retirement and the community wishes them the best.

Raspberry PI 4 Now Supported By Risc OS In Latest Update

Students of ARM history will know that the origins of the wildly popular processor architecture lie in the British computer manufacturer Acorn (the original “A” in “ARM”). The first mass-market ARM-based products were their Archimedes line of desktop computers. A RISC-based computer in a school or home was significantly ahead of the curve in the mid 1980s and there was no off-the-shelf software, so alongside the new chips came a new operating system that would eventually bear the name Risc OS.

It’s since become one of those unexpected pieces of retrocomputing history that refuses to die, and remains in active development with a new version 5.28 of its open-source variant just released. Best of all, after supporting the Raspberry Pi since the earliest boards, it now runs on a Raspberry Pi 4. The original ARM operating system has very much kept up with the times, and can now benefit from the extra power of the latest hardware from Cambridge. The new release deals with a host of bugs, as well as bringing speed increases, security fixes, and other improvements. For those whose first experience of a GUI came via the Archimedes in British schools, the news that the built-in Paint package has received a thorough update will bring a smile.

The attraction of Risc OS aside from its history and speed lies in its being understandable in operation for those wishing to learn about how an OS works under the hood. It’s likely that for most of us it won’t replace our desktops any time soon, but it remains an interesting diversion to download and explore. If you’d like to read more about early ARM history then we’d like to point you at our piece on Sophie Wilson, the originator of the ARM architecture.

Thinking About Creating A Raspberry Pi Replacement?

If you’ve ever wanted to try your hand at creating a Raspberry Pi-like board for yourself, you should check out [Jay Carlson’s] review of 10 different Linux-capable SoCs. Back in the 1960s, a computer was multiple refrigerator-sized boxes with thousands of interconnections and building one from scratch was only a dream for most people. Then ICs came and put all the most important parts in a little relatively inexpensive IC package and homebrew computing became much more accessible. Systems on Chip (SoC) has carried that even further, making it easier than ever to create entire systems, like the Pi and its many competitors.

Only a few years ago, making an SoC was still a big project because the vendors often didn’t want to release documentation to the public. In addition, most of the parts use ball grid array (BGA) packaging. BGA parts can be hard to work with, and require a multilayer PC board. Sure, you can’t plug these into a typical solderless breadboard. But working with these relatively large BGAs isn’t that hard and multilayer boards are now comparatively cheap. [Jay] reports that he got cheap PCBs and used a hot plate to build each board, and has some sage advice on how to do it.

Continue reading “Thinking About Creating A Raspberry Pi Replacement?”

Open-Source Robotic Arm For All Purposes

A set of helping hands is a nice tool to have around the shop, especially if soldering or gluing small components is a common task. What we all really want, though, is a robotic arm. Sure, it could help us set up glue or solder but it can do virtually any other task it is assigned as well. A general-purpose tool like this might be out of reach of most of us, unless we have a 3D printer to make this open-source robotic arm at home.

The KAUDA Robotic Arm from [Giovanni Lerda] is a five-axis arm with a gripping tool and has a completely open-source set of schematics so it can be printed on any 3D printer. The robot arm uses three stepper motors and two servo motors, and is based on the Arduino MEGA 2560 for control. The electrical schematics are also open-source, so getting this one up and running is just an issue of printing, wiring, and implementing some software. To that end there are software examples available, and they can easily be modified to fit one’s robotic needs.

A project like this could be helpful for any number of other projects, or also just as a lesson in robotics for yourself or even in a classroom, since many schools now have their own 3D printers. With everything being open-source, this is a much simpler endeavor now than other projects we’ve seen that attempted to get robotic arms running again.

Continue reading “Open-Source Robotic Arm For All Purposes”