When It Comes To DOS, Don’t Forget DR-DOS.

Despite the latest and greatest Intel-derived computers having multi-core 64-bit processors and unimaginably fast peripherals, at heart they all still retain a compatibility that goes back  to the original 8086. This means that they can, in theory at least, still run MS-DOS. The venerable Microsoft 16-bit OS may now be long discontinued, but there is still enough need for DOS that the open-source FreeDOS remains in active development. The Register are here to remind us that there’s another open-source DOS on the block, and that it has a surprising history.

SvarDOS is an open source DOS distribution, and it’s interesting because it uses a derivative of the DR-DOS kernel, an OS which traces its roots back to Digital Research’s CP/M operating system of the 1970s. This found its way briefly into the open source domain courtesy of the notorious Caldera Inc back in the 1990s, and has continued to receive some development effort ever since. As the Reg notes, it has something FreeDOS lacks, the ability to run Windows 3.1 should you ever feel the need. They take it for a spin in the linked article, should you be curious.

It’s something which has surprised us over the years, that aside from the world of retrocomputing we still occasionally find FreeDOS being distributed, usually alongside some kind of hardware maintenance software. Even four decades or more later, it’s still of value to have the simplest of PC operating systems to hand.

It’s worth pointing out that there’s a third open-source DOS in the wild, as back in April Microsoft released MS-DOS version 4 source code. But as anyone who used it will tell you, that version was hardly the pick of the bunch.

Header: Ivan Radic, CC BY 2.0.

Faster Integer Division With Floating Point

Multiplication on a common microcontroller is easy. But division is much more difficult. Even with hardware assistance, a 32-bit division on a modern 64-bit x86 CPU can run between 9 and 15 cycles. Doing array processing with SIMD (single instruction multiple data)  instructions like AVX or NEON often don’t offer division at all (although the RISC-V vector extensions do). However, many processors support floating point division. Does it make sense to use floating point division to replace simpler division? According to [Wojciech Mula] in a recent post, the answer is yes.

The plan is simple: cast the 8-bit numbers into 32-bit integers and then to floating point numbers. These can be divided in bulk via the SIMD instructions and then converted in reverse to the 8-bit result. You can find several code examples on GitHub.

Continue reading “Faster Integer Division With Floating Point”

Custom Firmware For Even Cheaper Bluetooth Thermometers

Readers may recall when we first covered the $5 Xiaomi LYWSD03MMC temperature and humidity sensor back in 2020. Prolific hacker [Aaron Christophel] wrote a custom firmware for the affordable gadget that was so capable and well implemented that it kicked off a whole new community.

It’s recently been brought to our attention that the Xiaomi thermometer has become so popular that clones have started popping up. Often sold under the Tuya brand, these versions look very similar to Xiaomi’s offering but can be had for as little as $1 each from the usual Chinese importers. Even better, they’ve got their very own open-source custom firmware.

The firmware comes from [pvvx], who also helms the most active fork of [Aaron]’s original firmware for the Xiaomi thermometer. Doing a bit of spot-checking between the repositories, it’s not immediately clear that any meaningful code is shared between the two projects. However, once installed, they offer similar capabilities to the user, such as integration with Home Assistant. Perhaps the most significant difference between the two projects is that, at least for the initial flash, you need to hook the Tuya units up to your computer with a USB serial adapter. Considering that one of the highlights of the Xiaomi custom firmware was its exceptionally easy wireless installation, this is a considerable step backward.

Below is a video from a few months back that [Maker’s Fun Duck] put together, where he takes apart one of these clones and shows the installation process for the custom firmware. Our overall impression is that it’s probably worth the few extra dollars to get the original Xiaomi hardware, although the display on the clone seems much brighter. In any event, we’re always happy to see the community coming up with free and open-source firmware for an otherwise locked-down gadget.

Continue reading “Custom Firmware For Even Cheaper Bluetooth Thermometers”

Better C Strings, Simply

If you program in C, strings are just in your imagination. What you really have is a character pointer, and we all agree that a string is every character from that point up until one of the characters is zero. While that’s simple and useful, it is also the source of many errors. For example, writing a 32-byte string to a 16-byte array or failing to terminal a string with a zero byte. [Thasso] has been experimenting with a different way to represent strings that is still fairly simple but helps keep things straight.

Like many other languages, this setup uses counted strings and string buffers. You can read and write to a string buffer, but strings are read-only. In either case, there is a length for the contents and, in the case of the buffer, a length for the entire buffer.

Continue reading “Better C Strings, Simply”

See What ‘They’ See In Your Photos

Once upon a time, a computer could tell you virtually nothing about an image beyond its file format, size, and color palette. These days, powerful image recognition systems are a part of our everyday lives. They See Your Photos is a simple website that shows you just how much these systems can interpret from a regular photo.

The website simply takes your image submission, runs it through the Google Vision API, and spits back out a description of the image. I tried it out with a photograph of myself, and was pretty impressed with what the vision model saw:

Continue reading “See What ‘They’ See In Your Photos”

Tldr-pages Keeps It Short, Wherever You Need It

Let’s face it, even the most accomplished console cowboy can’t keep everything memorized. Sure, you might know all the important arguments for a daily-use tool like tar or ls, but what about the commands you don’t use that often? For that matter, even if you do use tar every day, we bet you don’t know all of the options it supports.

Built-in documentation or the man pages are of course a huge help, but they are dense resources. Sometimes what you really need is to see just a few key examples. When that happens, check out the tldr-pages project and its array of front-ends. Whether you’re working remotely on an embedded gadget, or have the luxury of a full desktop OS and browser, the project offers a way to get the help you need as quickly as possible.

Continue reading “Tldr-pages Keeps It Short, Wherever You Need It”

Cranking Up The Detail In A Flight Simulator From 1992

Nostalgia is a funny thing. If you experienced the early days of video games in the 1980s and 90s, there’s a good chance you remember those games looking a whole lot better than they actually did. But in reality, the difference between 2023’s Tears of the Kingdom and the original Legend of Zelda is so vast that it can be hard to reconcile the fact that they’re both in the same medium. Of course, that doesn’t mean change the way playing those old games actually makes you feel. If only there was some way to wave a magic wand and improve the graphics of those old titles…

Well, if you consider Ghidra and a hex editor to be magic wands in our community, making that wish come true might be more realistic than you think. As [Alberto Marnetto] explains in a recent blog post, decompiling Stunt Island and poking around at the code allows one to improve the graphical detail level in the flight simulator by approximately 800%. In fact, it’s possible to go even higher, though at some point the game simply becomes unplayable.

Continue reading “Cranking Up The Detail In A Flight Simulator From 1992”