Linux Fu: Mapping Files

If you use C or C++, you have probably learned how to open a file and read data from it. Usually, we read a character or a line at a time. At least, it seems that way. The reality is there are usually quite a number of buffers between you and the hard drive, so your request for a character might trigger a read for 2,048 characters and then your subsequent calls return from the buffer. There may even be layers of buffers feeding buffers.

A modern computer can do so much better than reading using things using old calls like fgetc. Given that your program has a huge virtual address space and that your computer has a perfectly good memory management unit within it, you can ask the operating system to simply map the file into your memory space. Then you can treat it like any other array of characters and let the OS do the rest.

The operating system doesn’t necessarily read the entire file in at one time, it just reserves space for you. Any time you hit a page that isn’t in memory, the operating system grabs it for you invisibly. Pages that you don’t use very often may be discarded and reloaded later. Behind the scenes, the OS does a lot so you can work on very large files with no real effort. The call that does it all is mmap.

Continue reading “Linux Fu: Mapping Files”

Prusa Advises On Printed Medical Devices, Releases Face Shield

Like everyone else, hackers and makers want to do something to help control the spread of COVID-19. The recent posts on Hackaday dealing with DIY and open source approaches to respirators, ventilators, and masks have been some of the most widely read and commented on in recent memory. But it’s important to remember that the majority of us aren’t medical professionals, and that even the most well-meaning efforts can end up making things worse if they aren’t done correctly.

Which is exactly what [Josef Průša] wanted to make clear about 3D printed medical equipment in his latest blog post. Like us, he’s thrilled to see all the energy the maker community is putting into brainstorming ways we can put our unique skills and capabilities to use during this global pandemic, but he also urged caution. Printing out an untested design in a material that was never intended for this sort of application could end up being more dangerous than doing nothing at all.

The nested design lends itself to mass production.

To say that he and his team are authorities in the realm of fused deposition modeling (FDM) would be something of an understatement. They know better than most what the technology is and is not capable of, and they’re of the opinion that using printed parts in respirators and other breathing devices isn’t viable until more research and testing is done

For example, how can we ensure the porous plastic parts are sterilized and not just serving as a breeding ground for bacteria? It’s hardly a new concern; the debate about printed objects in food contact applications has been going on for years.

The safest option is to only use printed parts for structural components that don’t need to be sterile. To that end, [Josef] used the post to announce a newly published design of a printable face shield for medical professionals. Starting with an existing open source design, the Prusa Research team used their experience to optimize the headband for faster and easier printing. They can produce four headbands at once on each of the printers in their farm, which will allow them to make as many as 800 shields per day without impacting their normal business operations. The bottleneck on production is actually how quickly they can cut out the clear visors with their in-house laser, not the time it takes to print the frames.

It’s easy to get excited when success stories featuring 3D printed medical devices are in the news, but that doesn’t mean you should be cranking out lifesaving devices with that roll of bargain PLA you’ve had sitting around the shop. As difficult as it may be for some of us to admit, the safest thing might be to let our spare CPU cycles do battle with COVID-19 instead.

Continue reading “Prusa Advises On Printed Medical Devices, Releases Face Shield”

Thousands Of Internet-Connected Satellites Above Us, What Could Possibly Go Wrong!

Our skies are full of satellites, more full than they have been, that is, because SpaceX’s Starlink and a bevvy of other soon-to-launch operators plan to fill them with thousands of small low-earth-orbit craft to blanket the Earth with satellite Internet coverage. Astronomers are horrified at such an assault on their clear skies, space-watchers are fascinated by the latest developments, and in some quarters they’re causing a bit of concern about the security risk they might present. With a lot of regrettable overuse use of the word “hacker”, the concern is that such a large number of craft in the heavens might present an irresistible target for bad actors, who would proceed to steer them into each other can cause chaos.

Invest in undersea cables, folks, the Kessler Syndrome is upon us, we’re doomed!

Continue reading “Thousands Of Internet-Connected Satellites Above Us, What Could Possibly Go Wrong!”

Teardown: Cobra XRS 9740 Radar Detector

Drivers with a lead foot more often than not have Waze open on their phone so they can see if other drivers have spotted cops up ahead. But avoiding a speeding ticket used to involve a lot more hardware than software. Back before the smartphone revolution, that same driver would have had a radar detector on their dashboard. That’s not to say the gadgets are completely unused today, but between their relatively high cost (one of the top rated models on Amazon as of this writing costs over $300) and the inevitable false positives from so many vehicles on the road having their own radar and LIDAR systems, they’ve certainly become a less common sight over the years

The subject of today’s teardown is a perfect example of “Peak Radar Detector”. Manufactured back in 2007, the Cobra XRS 9740 would have been a fairly mid-range entry offering the sort of features that would have been desirable at the time. Over a decade ago, having an alphanumeric display, voice alerts, and a digital compass were all things worth shouting about on the box the thing was sold in. Though looking like some kind of Cardassian warship was apparently just an added bonus.

As the name implies these devices are primarily for detecting radar activity, but by this point they’d also been expanded to pick up infrared lasers and the strobe beacons on emergency vehicles. But false positives were always a problem, so the device allows the user to select which signals it should be on the lookout for. If you were getting some kind of interference that convinced the detector it was being bombarded with IR lasers, you could just turn that function off without having to pull the plug entirely.

But it’s important to remember that this device was built back when people were still unironically carrying around flip phones. Detecting laser and multi-band radars might sound like something pulled from the spec sheet of a stealth fighter jet, but this is still a piece of consumer electronics from more than a decade in the past. So let’s crack it open and take a look at what goes on inside a radar detector that’s only a few years away from being old enough to get its own driver’s license.

Continue reading “Teardown: Cobra XRS 9740 Radar Detector”

Yet More Takata Airbags Are Causing Fatalities Despite Different Propellant Chemistry

Takata Corporation has become well known as a lesson in product safety, thanks to their deadly airbags which were installed in cars worldwide. Despite filing for bankruptcy in 2017, their shadow lingers on as the biggest product recall in history continues to grow ever larger. Over time, the story grows deeper, as investigators find new causes for concern and deaths continue to mount.

In late 2019, another Takata recall was announced — one which caused fresh worry among industry officials familiar with the case. Up to this point, the defective parts produced by Takata were the models based on ammonium nitrate propellants, a chemical that other manufacturers had deemed too dangerous to use. However, there have been reports of other models using different chemistries having fatally injuring motorists, raising the question of whether any Takata airbag could be considered safe.

Continue reading “Yet More Takata Airbags Are Causing Fatalities Despite Different Propellant Chemistry”

Northrop Grumman Tests Space Tow Truck

In the early days, satellites didn’t stick around for very long. After it was launched by the Soviet Union in 1957, it only took about three months for Sputnik 1 to renter the atmosphere and burn up. But the constant drive to push ever further into space meant that soon satellites would remain in orbit for years at a time. Not that they always functioned for that long; America’s Explorer 1 remained in orbit for more than twelve years, but its batteries died after just four months.

Of course back then, nobody was too worried about that sort of thing. When you can count the number of spacecraft in Earth orbit on one hand, what does it matter if one of them stays up there for more than a decade? The chances of a collision were so low as to essentially be impossible, and if the satellite was dead and wasn’t interfering with communication to its functional peers, all the better.

The likelihood of a collision steadily increased over the years as more and more spacecraft were launched, but the cavalier approach to space stewardship continued more or less unchanged into the modern era. In fact, it might have endured a few more decades if companies like SpaceX weren’t planning on mega-constellations comprised of thousands of individual satellites. Concerned over jamming up valuable near-Earth orbits with so much “space junk”, modern satellites are increasingly being designed with automatic disposal systems that help make sure they are safely deorbited even in the event of a system failure.

That’s good news for the future, but it doesn’t help us with the current situation. Thousands of satellites are in orbit above the planet, and they’ll need to be dealt with in the coming years. The good news is that many of them are at a low enough altitude that they’ll burn up on their own eventually, and methods are being developed to speed up the process should it be necessary to hasten their demise.

Unfortunately, the situation is slightly more complex with communications satellites in geosynchronous orbits. At an altitude of 35,786 kilometers (22,236 miles), deorbiting these spacecraft simply isn’t practical. It’s actually far easier to maneuver them farther out into space where they’ll never return. But what if the satellite fails or runs out of propellant before the decision to retire it can be made?

That’s precisely the sort of scenario the Mission Extension Vehicle (MEV) was developed for, and after a historic real-world test in February, it looks like this “Space Tow Truck” might be exactly what we need to make sure invaluable geosynchronous orbits are protected in the coming decades.

Continue reading “Northrop Grumman Tests Space Tow Truck”

Where Do You Get Your Neutrons? Neutron Sources For Nuclear Fusion, Science, Medicine, And Industry

All of us probably know what neutrons are, or have at least heard of them back in physics class. Yet these little bundles of quarks are much more than just filler inside an atom’s nucleus. In addition to being an essential part of making matter as stable as it (usually) is, free neutrons can be used in a variety of manners.

From breaking atoms apart (nuclear fission), to changing the composition of atoms by adding neutrons (transmutation), to the use of neutrons in detecting water and inspecting materials, neutrons are an essential tool in the sciences, as well as in medicine and industrial applications. This has meant a lot of development toward the goal of better neutron sources. While nuclear fission is an efficient way to get lots of neutrons, for most applications a more compact and less complicated approach is used, some of which use nuclear fusion instead.

In this article we’ll be taking a look at the many applications of neutron sources, and these neutron sources themselves.

Continue reading “Where Do You Get Your Neutrons? Neutron Sources For Nuclear Fusion, Science, Medicine, And Industry”