Grabbing The Thread: Spinlocks Vs Mutexes

Getting into the weeds of operating systems is daunting work. Especially when the operating system involved is a fully featured modern PC operating system with millions of lines of code all working together to integrate hardware and software seamlessly. One such operating system “weed” is figuring out how to handle simultaneous tasks when the processor can only really handle one thing at time. For that, you’ll be looking at the difference between spinlocks and mutexes.

Both of these are methods of making sure that the processor completes a task sufficiently before moving on to the next task. Modern computers are so fast (even ignoring multiple cores) that it seems as if they are doing many things at once. In order to maintain this illusion, tasks need ways of locking the processor to that specific task for a certain amount of time. Of course the queue for performing the next task can get complicated as there are often many tasks waiting to use processor time. Spinlocks are a simple way of holding the processor and mutexes are a slightly more complicated way, but which one is the most efficient use of system resources isn’t that straightforward.

If you’ve ever been interested in operating system details, this one goes deep into the intricacies of features most of us have never even considered the existence of. It’s definitely worth a read, though, and is very well written by someone who is clearly an expert. If you want an operating system challenge, you can build your own operating system as well.

An HDMI Input For A Laptop Screen, Minus Laptop

The lack of HDMI inputs on almost all laptops is a huge drawback for anyone who wants to easily play a video game on the road, for example. As to why no manufacturers offer this piece of convenience when we all have easy access to a working screen of this size, perhaps no one can say. On the other hand, if you want to ditch the rest of the computer, you can make use of the laptop screen for whatever you want.

This project from [Avner] comes to us in a few parts. In the first section, the teardown of the laptop begins and a datasheet for the screen is discovered, which allows [Avner] to prepare an FPGA to drive the screen. The second part involves building an HDMI sink, which is a device which decodes the signal from an HDMI source into its constituent parts so it can be sent to the FPGA. The final section of the project involves actually sending a video to this impressive collection of hardware in order to get a video to appear on the old laptop screen.

This build is worth checking out if you’ve ever dealt with anything involving digital video. It goes into great depth on a lot of the technical details involving HDMI, video devices, and hardware timing issues. This is a great build and, even though we’ve seen similar projects, definitely worth diving into if you have some time on your hands and a spare laptop screen.

Become The Next Fabergé With A Rose Engine Lathe

The basics of a skill may take a long time to master, but there is always something else to learn about regardless of the craft. Building a piece of fine furniture out of hardwood or being able to weld together a bicycle from scratch are all impressive feats, but there are fine details that you’ll only learn about once you get to this level of craftsmanship. One such tool that will help with these intricacies is known as the rose engine lathe.

This tool is based on an average lathe, typically used for creating round things out of stock which is not round. A rose engine lathe has a set of cams on it as well which allow the lathe to create intricate patterns in the material it’s working with, such as flower type patterns or intricate spirals. One of the most famous implementations of this method was on the Fabergé eggs. While this might make it sound overly complex, this how-to actually shows you how to build your own rose engine lathe out of a piece of MDF and a large number of miscellaneous pieces of hardware.

We recently featured another build which performs a similar function called engine turning. While similar, this is the method responsible for creating overlapping spirals on a piece of metal. Either way, both projects are sure to spice up your metal or woodworking endeavors.

Thanks to [PWalsh] for the tip!

What Hardware Lies Beneath? Companies Swear They Never Meant To Violate Your Privacy

“Don’t Be Evil” was the mantra of Google from years before even Gmail was created. While certainly less vague than their replacement slogan “Do the Right Thing”, there has been a lot of criticism directed at Google over the past decade and a half for repeatedly being at odds with one of their key values. It seems as though they took this criticism to heart (or found it easier to make money without the slogan), and subsequently dropped it in 2018. Nothing at Google changed, though, as the company has continued with several practices which at best could be considered shady.

The latest was the inclusion of an undisclosed microphone in parts of their smart home system, the Nest Guard. This is a member of the Nest family of products — it is not the thermostat itself, but a base station for a set of home security hardware you can install yourself. The real issue is that this base station was never billed as being voice activated. If you’re someone who has actively avoided installing “always-listening” style devices in your home, it’s infuriating to learn there is hardware out that have microphones in them but no mention of that in the marketing of the product. Continue reading “What Hardware Lies Beneath? Companies Swear They Never Meant To Violate Your Privacy”

Three Engines For Every Lada

If you don’t live in a former Eastern Bloc country, odds are that you’ve never seen a Lada driving around your neighborhood. This car is ubiquitous in Russia and its neighboring countries, though, and for good reason: price. Lada gave many people access to affordable transportation who otherwise would have been walking, but this low price means that it’s a great platform for some excellent car hacks as well.

The guys at [Garage 54], an auto shop in Russia, outfitted one of these discount classics with two extra engines. This goes beyond normal bolt-on modifications you typically see to get modest horsepower gains from a daily driver. The crew had to weld a frame extending out of the front of the car to hold all the extra weight, plus fabricate all the parts needed to get the crankshafts on each engine to connect to each other. After that, it was the “simple” job of tuning the engines to all behave with one another.

This video is really worth watching, as the car was also upgraded with a dually setup on the back with studded tires for extra grip on their ice track. Odds are pretty good that this car isn’t street legal so this is likely the only place they’ll be able to drive it. Other things can be built out of Ladas as well, like lawn mowers for example.

Thanks to [g_alan_e] for the tip!

Continue reading “Three Engines For Every Lada”

A Nurse Call System Becomes Turing Complete

George Mallory, a famous English mountaineer, once suggested that it was of no use to climb mountains. Instead, he posited, the only reason to climb a mountain is because it is there. Likewise, when you become an expert in nurse call systems like those found in hospitals, you may find that you do things with them that are of similar use. Making a Turing-complete nurse call system is something you do because you can.

[Erik] has been working on this particular call system, known as Netrix, and used Wireshark to sniff out all of its protocols. With this information he realized that it would be possible to use the system’s routing features to perform all of the tasks that any Turing complete system can do: conditional branching and memory access. He set up a virtual machine and set about implementing all of these tasks using the nurse call system’s features.

The setup for this project is impressive, and belies an extensive knowledge of this one proprietary system but also of computer science in general. It’s interesting to see how something can be formed into a working computer system from parts that otherwise might not be used that way. Even things that aren’t electronic can be used as Turing-complete computers.

Photo via Wikimedia Commons

Creating Coherent Sound Beams, Easily

Lasers work by emitting light that is “coherent” in that it doesn’t spread out in a disorganized way like light from most sources does. This makes extremely focused beams possible that can do things like measure the distance from the Earth to the Moon. This behavior isn’t just limited to electromagnetic waves, though. [Gigs] via [CodeParade] was able to build a device that produces a tightly focused sound wave, essentially building an audio laser.

Curiously enough, the device does not emit sound in the frequency range of human hearing. It uses a set of ultrasound speakers which emit a “carrier wave” in the ultrasound frequency. However, with a relatively simple circuit a second signal in the audible frequency range is modulated on top of it, much the same way that an AM radio broadcast has a carrier wave with an amplitude modulated signal on top of it. With this device, though, the air itself acts in a nonlinear way and demodulates the signal, producing the modulated signal as audible sounds.

There are some interesting effects of using this device. First, it is extremely directional, so in order to hear sound from the device you would need to be standing directly in front of it. However, once the ultrasound beam hits a solid object, the wave is instantly demodulated and reflected from the object, making it sound like that object is making the sounds and not the device. It’s obvious that this effect is hard to experience via video, but it’s interesting enough that we’d like to have one of our own to try out. It’s not the only time that sound waves and electromagnetic waves have paired up in interesting ways, either.

Thanks to [Setvir] for the tip! Continue reading “Creating Coherent Sound Beams, Easily”