Programming Ada: Atomics And Other Low-Level Details

Especially within the world of multi-threaded programming does atomic access become a crucial topic, as multiple execution contexts may seek to access the same memory locations at the same time. Yet the exact meaning of the word ‘atomic’ is also essential here, as there is in fact not just a single meaning of the word within the world of computer science. One type of atomic access refers merely to whether a single value can be written or read atomically (e.g. reading or writing a 32-bit integer on a 32-bit system versus a 16-bit system), whereas atomic operations are a whole other kettle of atomic fish.

Until quite recently very few programming languages offered direct support for the latter, whereas the former has been generally something that either Just Worked™ if you know the platform you are on, or could often be checked fairly trivially using the programming language’s platform support headers. For C and C++ atomic operations didn’t become supported by the language itself until C11 and C++11 respectively, previously requiring built-in functions provided by the toolchain (e.g. GCC intrinsics).

In the case of Ada there has been a reluctance among the language designers to add support for atomic operations to the language, with the (GNU) toolchain offering the same intrinsics as a fallback. With the Ada 2022 standard there is now direct support in the System.Atomic_Operations library, however.

Continue reading “Programming Ada: Atomics And Other Low-Level Details”

2024: As The Hardware World Turns

With 2024 now officially in the history books, it’s time to take our traditional look back and reflect on some of the top trends and stories from the past twelve months as viewed from the unique perspective Hackaday affords us. Thanks to the constant stream of tips and updates we receive from the community, we’ve got a better than average view of what’s on the mind of hardware hackers, engineers, and hobbyists.

This symbiotic relationship is something we take great pride in, which is why we also use this time of year to remind the readers just how much we appreciate them. We know it sounds line a line, but we really couldn’t do it without you. So whether you’ve just started reading in 2024 or been with us for years, everyone here at Hackaday thanks you for being part of something special. We’re keenly aware of how fortunate we are to still be running a successful blog in the era of YouTube and TikTok, and that’s all because people like you keep coming back. If you keep reading it, we’ll keep writing it.

So let’s take a trip down memory lane and go over just a handful of the stories that kept us talking in 2024. Did we miss your favorite? Feel free to share with the class in the comments.

Continue reading “2024: As The Hardware World Turns”

DIYFPV: A New Home For Drone Builders

If you’re looking to get into flying first-person view (FPV) remote controlled aircraft, there’s an incredible amount of information available online. Seriously, it’s ridiculous. In fact, between the different forums and the countless YouTube videos out there, it can be difficult to sort through the noise and actually find the information you need.

What if there was one location where FPV folks could look up hardware, compare notes, and maybe even meet up for the occasional flight? That’s the idea behind the recently launched DIYFPV. In its current state the website is a cross between a social media platform, a hardware database, and a tech support forum.

Being able to look up parts to see who has them in stock and for what price is certainly handy, and is likely to become a very valuable resource, especially as users start filling the database with first-hand reviews. There’s no shortage of social media platforms where you can post and chat about FPV, but pairing that with a dedicated tech support section has promise. Especially if the solutions it produces start getting scrapped by show up in search engines.

But the part of DIYFPV that has us the most interested is the interactive builder tool. As explained in the announcement video below, once this feature goes live, it will allow users to pick parts from the database and virtually wire them together. Parts are represented by high-quality illustrations that accurately represent connectors and solder pads, so you won’t be left guessing where you’re supposed to connect what. Schematics can be shared with others to help with troubleshooting or if you want to get feedback.

The potential here is immense. Imagine a function to estimate the mass of the currently selected electronics, or a simulation of how much current it will draw during flight. It’s not clear how far DIYFPV plans on taking this feature, but we’re eager to find out.

Continue reading “DIYFPV: A New Home For Drone Builders”

Light Brite Turned Sci-Fi Console On The Cheap

Generally, the projects featured on Hackaday actually do something. We won’t go as far as to say they are practical creations, but they usually have some kind of function other than to sit there and blink. But what if just sitting still and blinking away randomly is precisely what you want a piece of hardware to do?

That was exactly the goal when [createscifi] set out to dress a Lite Brite up as a futuristic prop. On a technical level, this project is pretty much as simple as it gets. But we appreciated seeing some of the techniques brought to bear on this project, and perhaps more importantly, really like the channel’s overall goal of creating affordable sci-fi props using common components. We don’t plan on filming our own space epic anytime soon…but we like to know the option is there.

Continue reading “Light Brite Turned Sci-Fi Console On The Cheap”

Broken USB Lamp Saved With A Bit Of Woodworking

For many of us, when we think of creating a custom enclosure, our minds immediately go towards our 3D printer. A bit of time in your CAD program of choice, and in an hour (or several), you’ve got a bespoke plastic box. A hacker’s dream come true.

But extruded plastic is hardly perfect. For one thing, you might want a finished piece that looks a little more attractive on your desk. Which is why we appreciate this quick hack from [Tilma]. When faced with a broken LED light and minimal equipment, he decided to transplant the repaired electronics into a scratch-built wooden frame that not only looks better than the original, but is more functional.

Continue reading “Broken USB Lamp Saved With A Bit Of Woodworking”

Protect Your Site With A DOOM Captcha

We all know that “Can it run DOOM?” is the first question of a hardware hacker. The 1993 first person shooter from id Software defined an entire genre of games, and has since been made open source, appearing on almost everything. Everything, that is, except a Captcha, those annoying “Are you a human” tests where we’re all expected to do a search giant’s image classification for them. So here’s [Guillermo Rauch] with a DOOM captcha, in which you must gun down three bad guys to proceed.

As a way to prove you’re a human we can’t imagine a more fitting test than indiscriminate slaughter, and it’s interesting to read a little about what goes on behind the scenes. It’s a WebAssembly application as you might have guessed, and while it’s difficult to shake that idea from the early ’90s that you needed a powerful computer to run the game, in reality it shows just how powerful WebAssembly is, as well as how far we’ve come in three decades.

We’d prefer a few different entry points instead of always playing the same level, and we were always more handy with the mouse than the keyboard back in the day, but it’s certainly a bit of fun. It’s worth noting that simply playing the game isn’t enough to verify your humanity — if you’re killed in the game before vanquishing the required three foes, you’ll have to start over. As the game is running at “Nightmare” difficulty, proving your worth might be a tad harder than you’d expect…

Need more DOOM? How about seeing it on hardware nobody would have believed in 1993?

38C3: Taking Down The Power Grid Over Radio

You know how you can fall down a rabbit hole when you start on a project? [Fabian Bräunlein] and [Luca Melette] were looking at a box on a broken streetlamp in Berlin. The box looked like a relay, and it contained a radio. It was a Funkrundsteueremfänger – a radio controlled power controller – made by a company called EFR. It turns out that these boxes are on many streetlamps in many cities, and like you do, they thought about how cool it would be to make lights blink, but on a city-wide basis. Haha, right? So they bought a bunch of these EFR devices on the used market and started hacking.

They did a lot of background digging, and found out that they could talk to the devices, both over their local built-in IR port, but also over radio. Ironically, one of the best sources of help they found in reversing the protocol was in the form of actually pressing F1 in the manufacturer’s configuration application – a program’s help page actually helped someone! They discovered that once they knew some particulars about how a node was addressed, they could turn on and off a device like a street lamp, which they demo with a toy on stage. So far, so cute.

But it turns out that these boxes are present on all sorts of power consumers and producers around central Europe, used to control and counteract regional imbalances to keep the electrical grid stable. Which is to say that with the same setup as they had, maybe multiplied to a network of a thousand transmitters, you could turn off enough power generation, and turn on enough load, to bring the entire power grid down to its knees. Needless to say, this is when they contacted both the manufacturer and the government.

The good news is that there’s a plan to transition to a better system that uses authenticated transmissions, and that plan has been underway since 2017. The bad news is that progress has been very slow, and in some cases stalled out completely. The pair view their work here as providing regulators with some extra incentive to help get this important infrastructure modernization back on the front burner. For instance, it turns out that large power plants shouldn’t be using these devices for control at all, and they estimate that fixing this oversight could take care of most of the threat with the least effort.

National power grids are complicated machines, to say the least, and the impact of a failure can be very serious. Just take a look at what happened in 2003 in the US northeast, for instance. And in the case of real grid failure, getting everything back online isn’t as simple a just turning the switches back on again. As [Fabian] and [Luca] point out here, it’s important to discover and disclose when legacy systems put the grid in potential danger.