DooM Retrospective: 25 Years Of Metal

Metal is many things. A material hard and coarse in nature that by forging it in fire becomes sharp enough to cut through anything in its path. The music that bares its namesake is equally cutting and exudes an unyielding attitude that seeks to separate the posers from the true acolytes. Metal is the sentiment of not blindly following the rules, a path less taken to the darker side of the street. In videogame form, there is nothing more metal than Doom.

The creators of Doom, id Software, were always hellbent on changing the perception of PC gaming in the 1990s. Games of the time were rigid and slow in comparison to their console counterparts. The graphical fidelity was technically superior on PC, but no other developer could nail movement in a game like id. The team had made a name for themselves with their Commander Keen series (which came about after a failed Super Mario Bros. 3 PC demo) along with the genre defining Wolfenstein 3D, but nothing topped Doom. In an era that was already soaking with “tude”, Doom established an identity all its own. The moody lighting, the grotesque monster designs, the signature push forward combat, and all the MIDI guitars a Soundblaster could handle; Doom looked and felt a cut above everything else in 1993.

In December of that year, Senators Joe Lieberman and Herb Kohl held a hearing to publicly condemn the inclusion of violence in videogames sold in America. The bulk of the arguments sought to portray the videogame industry and its developers as deviants seeking to corrupt the nation’s youth. Id Software responded as if to raise the largest middle finger imaginable, by releasing Doom to the world the very next day. A quarter of a century later people are still talking about it.

Continue reading “DooM Retrospective: 25 Years Of Metal”

Peering Into A Running Brain: SDRAM Refresh Analyzed From Userspace

Over on the Cloudflare blog, [Marek] found himself wondering about computer memory, as we all sometimes do. Specifically, he pondered if he could detect the refresh of his SDRAM from within a running program. We’re probably not ruining the surprise by telling you that the answer is yes — with a little more than 100 lines of C and help from our old friend the Fast Fourier Transform (FFT), [Marek] was able to detect SDRAM refresh cycles every 7818.6 ns, lining right up with the expected result.

The “D” in SDRAM stands for dynamic, meaning that unless periodically refreshed by reading and writing, data in the memory will decay. In this kind of memory, each bit is stored as a charge on a tiny capacitor. Given enough time (which varies with ambient temperature), this charge can leak away to neighboring silicon, turning all the 1s to 0s, and destroying the data. To combat this process, the memory controller periodically issues a refresh command which reads the data before it decays, then writes the data back to fully charge the capacitors again. Done often enough, this will preserve the memory contents indefinitely. SDRAM is relatively inexpensive and available in large capacity compared to the alternatives, but the drawback is that the CPU can’t access the portion of memory being refreshed, so execution gets delayed a little whenever a memory access and refresh cycle collide.

Chasing the Correct Hiccup

[Marek] figured that he could detect this “hiccup,” as he calls it, by running some memory accesses and recording the current time in a tight loop. Of course, the cache on modern CPUs would mean that for a small amount of data, the SDRAM would never be accessed, so he flushes the cache each time. The source code, which is available on GitHub, outputs the time taken by each iteration of the inner loop. In his case, the loop typically takes around 140 ns.

Hurray! The first frequency spike is indeed what we were looking for, and indeed does correlate with the refresh times.

The other spikes at 256kHz, 384kHz, 512kHz and so on, are multiplies of our base frequency of 128kHz called harmonics. These are a side effect of performing FFT on something like a square wave and totally expected.

As [Marek] notes, the raw data doesn’t reveal too much. After all, there are a lot of things that can cause little delays in a modern multitasking operating system, resulting in very noisy data. Even thresholding and resampling the data doesn’t bring refresh hiccups to the fore. To detect the SDRAM refresh cycles, he turned to the FFT, an efficient algorithm for computing the discrete Fourier transform, which excels at revealing periodicity. A few lines of python produced the desired result: a plot of the frequency spectrum of the lengthened loop iterations. Zooming in, he found the first frequency spike at 127.9 kHz, corresponding to the SDRAMs refresh period of 7.81 us, along with a number of other spikes representing harmonics of this fundamental frequency. To facilitate others’ experiments, [Marek] has created a command line version of the tool you can run on your own machine.

If this technique seems familiar, it may be because it’s similar the the Rowhammer attack we covered back in 2015, which can actually change data in SDRAM on vulnerable machines by rapidly accessing adjacent rows. As [Marek] points out, the fact that you can make these kinds of measurements from a userspace program can have profound security implications, as we saw with the meltdown and spectre attacks. We have to wonder what other vulnerabilities are lying inside our machines waiting to be discovered.

Thanks to [anfractuosity] for the tip!

High-Speed Camera Plus Lawnmower Equals Destructive Fun

I hate gratuitous destruction videos. You know, the ones that ask “what happens if we drop a red-hot ball of Plutonium onto a bag of Cheetos?” There’s a lot of smoke, flames and a big pile of ad revenue for the idiots behind it.

This destruction video is a little different, though. [Tesla 500] wanted to mount his high-speed camera onto a rotating blade, but without destroying the camera. In this video, he documents the somewhat nerve-wracking process of building a rig that spins a $3000 camera at several thousand revolutions per second minute. It’s all about the balance, about building a rig that balances the weight of the camera and the blade properly at high speed.

It took several attempts to get it right, and [Tesla 500] shows how he tested and refined each version, including shifting weights to account for the different densities of the camera itself, which has the heavy batteries at one side. And then he drops things onto the blade to see what they look like when sliced. Naturally.

Continue reading “High-Speed Camera Plus Lawnmower Equals Destructive Fun”

1985 Electric Vehicle Restoration

We tend to think of electric vehicles as a recent innovation, however many successful products are not the first ones to appear on the market. We have a habit of forgetting the progenitors such as mechanical scanned TVs or the $10,000 Honeywell kitchen computer. A case in point is [Clive Sinclair]’s C5 electric vehicle from 1985. If you’ve heard of it at all, you probably recall it was considered a stellar disaster when it was released. But it is a part of electric vehicle history and you can see [RetroManCave] talk to [Dave] about how he restored and operates a C5 of his own in the video below. If you want to dig into the actual restoration, [Dave] has three videos about the teardown and rebuild on his channel.

Sinclair saw this as the first shot across the bow with a series of electric vehicles, but it was doomed from the start. It isn’t a car. In fact, it is more like a bicycle with a battery. It seats one occupant who is exposed to the elements. It had a very tiny trunk. It can go — optimistically — 15 miles per hour and runs out of juice after about 20 miles — if you helped out by pedaling. If you weren’t up for the exercise, you’d get less out of the lead-acid battery.

Continue reading “1985 Electric Vehicle Restoration”

When Unfolding An STL In Software, Math Isn’t The Tricky Part

Some time ago, [Trammell Hudson] took a shot at creating a tool that unfolds 3D models in STL format and outputs a color-coded 2D pattern that can be cut out using a laser cutter. With a little bending and gluing, the 3D model can be re-created out of paper or cardboard.

There are of course other and more full-featured tools for unfolding 3D models: Pepakura is used by many, but is not free and is Windows only. There is also a Blender extension called Paper Model that exists to export 3D shapes as paper models.

What’s interesting about [Trammell]’s project are the things he discovered while making it. The process of unfolding an STL may be conceptually simple, but the actual implementation is a bit tricky in ways that have little to do with number crunching.

For example, in a logical sense it doesn’t matter much where the software chooses to start the unfolding process, but in practice some start points yield much tighter groups of shapes that are easier to work with. Also, his software doesn’t optimize folding patterns, so sometimes the software will split a shape along a perfectly logical (but non-intuitive to a human) line and it can be difficult to figure out which pieces are supposed to attach where. The software remains in beta, but those who are interested can find it hosted on GitHub. It turns out that it’s actually quite challenging to turn a 3D model into an unfolded shape that still carries visual cues or resemblances to the original. Adding things like glue tabs in sensible places isn’t trivial, either.

Tools to unfold 3D models feature prominently in the prop-making world, and it’s only one of the several reasons an economical desktop cutter might be a useful addition to one’s workshop.

Improving Router-Based Dev Boards With The Onion Omega2 Pro

Before we had Raspberry Pis and Beaglebones, the art of putting a Linux system in a small, portable project was limited to router hacking. The venerable WRT54G controlled Internet-connected robots with a careful application of a Unix-ey firmware. Now, things are different but there’s still a need for a cheap, portable Linux system that’s just good enough to get the job done. Now, there’s an upgrade to the board that follows in the footsteps of that router hacking The Onion Omega2 Pro is up on Crowd Supply, and it’s got more buttons, more switches, and it’s still smaller than a breadboard.

The Onion Omega2 Pro is a slight upgrade over the breadboard-friendly SoM launched a few years ago. The Pro version features a 580 MHz MIPS CPU, 512 MB of RAM (Update: this is 128 MB physical RAM and 384 MB flash swap file), 8 GB of storage, and connectivity with b/g/n WiFi. Unlike the previous version, this is a far more functional system with a 30-pin expansion header, support for battery charging, a micro USB for charging and serial, and a USB host port. Because this is at its heart the guts of a router on a development board, you also get all the fun of WiFi networking. The expansion header connects to various add-ons including a GPS module, OLED display, and an Ethernet port.

Now we have Raspberry Pis and other various boards based on smartphone Systems on Chip, but sometimes you don’t need that much overhead. You don’t need weird Linux distributions dealing with ARM bootloaders. Sometimes you just need something simple, and the Onion Omega2 Pro does just that.

Motorize Your Camera Slider, The Hacker Way

Camera sliders are a fantastic tool for those who wish to shoot beautiful and smooth panning video, or take expressive time-lapse shots. They can also be remarkably expensive, which creates an incentive for the DIYer to innovate at home. [Richard] wanted a motorized slider and didn’t want to break the bank, and thus, a build was born.

Starting with an existing non-motorized camera slider makes things easier, though there’s no reason [Richard]’s techniques couldn’t be applied to a completely DIY build. A NEMA stepper motor is fitted to the frame, and connected to the camera shuttle with a toothed belt. The stepper is controlled by an Arduino, which allows for both timelapse and smooth panning modes, and can be controlled with an IR remote sourced from Amazon. The slider is also interfaced with a Processing sketch, which gives a graphical representation of the slider’s current position on the laptop’s screen, which helps for setting up a shot.

[Richard] has shared the code and a shopping list, and is confident that the build can be completed for under $100. That’s a satisfying price given the quality of shots possible with a good slider.

We see plenty of slider builds here, including this impressive pantograph-type build. Video after the break.

[Thanks to Baldpower for the tip!]

Continue reading “Motorize Your Camera Slider, The Hacker Way”