Block Devices In User Space

Your new project really could use a block device for Linux. File systems are easy to do with FUSE, but that’s sometimes too high-level. But a block driver can be tough to write and debug, especially since bugs in the kernel’s space can be catastrophic. [Jiri Pospisil] suggests Ublk, a framework for writing block devices in user space. This works using the io_uring facility in recent kernels.

This opens the block device field up. You can use any language you want (we’ve seen FUSE used with some very strange languages). You can use libraries that would not work in the kernel. Debugging is simple, and crashing is a minor inconvenience.

Another advantage? Your driver won’t depend on the kernel code. There is a kernel driver, of course, named ublk_drv, but that’s not your code. That’s what your code talks to.

Continue reading “Block Devices In User Space”

The Windows Interface You Didn’t Like, For Linux

If you were asked to pick the most annoying of the various Microsoft Windows interfaces that have appeared over the years, there’s a reasonable chance that Windows 8’s Metro start screen and interface design language would make it your choice. In 2012 the software company abandoned their tried-and-tested desktop whose roots extended back to Windows 95 in favor of the colorful blocks it had created for its line of music players and mobile phones.

Consumers weren’t impressed and it was quickly shelved in subsequent versions, but should you wish to revisit Metro you can now get the experience on Linux. [er-bharat] has created Win8DE, a shell for Wayland window managers that brings the Metro interface — or something very like it — to the open source operating system.

We have to admire his chutzpah in bringing the most Microsoft of things to Linux, and for doing so with such a universally despised interface. But once the jibes about Windows 8 have stopped, we can oddly see a point here. The trouble with Metro was that it wasn’t a bad interface for a computer at all, in fact it was a truly great one. Unfortunately the computers it was and is great for are handheld and touchscreen devices where its large and easy to click blocks are an asset. Microsoft’s mistake was to assume that also made it great for a desktop machine, where it was anything but.

We can see that this desktop environment for Linux could really come into its own where the original did, such as for tablets or other touch interfaces. Sadly we expect the Windows 8 connection to kill it before it has a chance to catch on. Perhaps someone will install it on a machine with the Linux version of .net installed, and make a better Windows 8 than Windows 8 itself.

BASIC On A Calculator Again

We are always amused that we can run emulations or virtual copies of yesterday’s computers on our modern computers. In fact, there is so much power at your command now that you can run, say, a DOS emulator on a Windows virtual machine under Linux, even though the resulting DOS prompt would probably still perform better than an old 4.77 MHz PC. Remember when you could get calculators that ran BASIC? Well, [Calculator Clique] shows off BASIC running on a decidedly modern HP Prime calculator. The trick? It’s running under Python. Check it out in the video below.

Think about it. The HP Prime has an ARM processor inside. In addition to its normal programming system, it has Micropython as an option. So that’s one interpreter. Then PyBasic has a nice classic Basic interpreter that runs on Python. We’ve even ported it to one or two of the Hackaday Superconference badges.

Continue reading “BASIC On A Calculator Again”

Arnis Brings The World To Minecraft: Bedrock Edition

A couple of years ago, we covered a project called Arnis, created by [Louis Erbkamm], which allowed you to generate any portion of Earth into Minecraft blocks and maps. It was already impressive, but since we last checked in the open source project has made some incredible progress.

When we first covered Arnis, it was stuck on the Java edition of Minecraft. But now the project has been updated to support the more modern Bedrock Edition, meaning you can put your home into any device’s version of Minecraft!

Beyond Bedrock version support, the actual tool has improved with proper elevation generation using data provided from NASA. This allows you to view the Alps or the Himalayas in all their voxel glory, or explore an entire map of the Moon. Perhaps what’s even more impressive is that the generation is accurate enough to be used in an actual research study involving flood mitigation education.

All of this has been made possible with help from a passionate community who have volunteered their time to assist [Louis] with the project — a testament to the power of open source.

What Happens When A Bug Rears Its Head At Mach Two?

While some may see amateur rocketry as little more than attaching fins to a motor and letting it fly, it is, in fact, rocket science. This fact became very clear to [BPS.space] when a parachute deployed on a rocket traveling at approximately Mach 1.8. 

The rocket design is rather simple — essentially just 3D printed fins glued onto a motor with a nose-cone for avionics. A single servo and trim tab provide a modicum of roll control, and a parachute is mounted in the nose along with a homing beacon for faster recovery. Seemingly, the only thing different about this flight is properly validated telemetry and GPS antennae.

After a final ground check of the telemetry and GPS signal quality, everything is ready for what seems like a routine launch. However, somewhere around Mach 1.8, the parachute prematurely deploys, ripping apart the Kevlar rope holding together the three rocket sections. Fortunately, the booster and avionics sections could be recovered from the desert.

Continue reading “What Happens When A Bug Rears Its Head At Mach Two?”

Windows? Linux? Browser? Same Executable

We’ve been aware of projects like Cosmopolitan that allow you to crank out a single executable that will run on different operating systems. [Kamila] noticed that the idea was sound, but that the executables were large and there were some limitations. So she produced a 13K file that will run under Windows, Linux, or even in a Web browser. The program itself is a simple snake game.

There seems to be little sharing between the three versions. Instead, each version is compressed and stitched together so that each platform sees what it wants to see. To accommodate Windows, the file has to start with a PE header. However, there is enough flexibility in the header that part of the stub forms a valid shell script that skips over the Windows code when running under Linux.

So, essentially, Windows skips the “garbage” in the header, which is the part that makes Linux skip the “garbage” in the front of the file.

That leaves the browser. Browsers will throw away everything before an <HTML> tag, so that’s the easy part.

Should you do this? Probably not. But if you needed to make this happen, this is a clear template for how to do it. If you want to go back to [Kamila’s] inspiration, we’ve covered Cosmopolitan and its APE format before.

Playing Factorio On A Floppy Disk Cluster

While a revolutionary storage system for their time, floppy disks are not terribly useful these days. Though high failure rates and slow speeds are an issue, for this project, the key issue is capacity. That’s because [DocJade’s] goal is playing the video game Factorio off floppy disks. 

Storing several gigabytes of data on floppy disks is a rather daunting challenge. But instead of using a RAID array, only a single reader and a custom file system is deployed in this setup. A single disk is dedicated to storing pool information allowing for caching of file locations, reducing disk swaps. The file system can also store single files across multiple disks for storage of larger files. Everything mounts in fuse and is loosely POSIX compliment, but lacks some features like permissions and links.

With the data stored across thousands of disks, the user is prompted to insert a new disk when needed. This ends up being the limiting factor in read and write speeds, rather than the famously slow speeds of floppies. In fact, it takes about a week to load all of Factorio in this manner, even after optimizations to reduce disk swaps. Factorio is also one of the few games that could be installed in this manner, as it loads most of the game into memory at launch. Many other games that dynamically load textures and world maps would simply crash when a chunk is not immediately available.

Not a Factorio fan? No worries, you could always install modern Linux on a floppy!

Continue reading “Playing Factorio On A Floppy Disk Cluster”