Switching From Desktop Linux To FreeBSD

People have been talking about switching from Windows to Linux since the 1990s, but in the world of open-source operating systems, there is much more variety than just the hundreds of flavors of Linux-based operating systems today. Take FreeBSD, for example. In a recent [GNULectures] video, we get to see a user’s attempt to switch from desktop Linux to desktop FreeBSD.

The interesting thing here is that both are similar and yet very different, mainly owing to their very different histories, with FreeBSD being a direct derivative of the original UNIX and its BSD derivative. One of the most significant differences is probably that Linux is just a kernel, with (usually) the GNU/Hurd userland glued on top of it to create GNU/Linux. GNU and BSD userland are similar, and yet different, with varying levels of POSIX support. This effectively means that FreeBSD is a singular OS with rather nice documentation (the FreeBSD handbook).

Continue reading “Switching From Desktop Linux To FreeBSD”

Rhapsody OS is shown in its boot sequence on a monitor; the edge of the motherboard running it is just visible in the right side of the image.

Bringing An Obscure Apple Operating System To Modern Hardware

During Apple’s late-90s struggles with profitability, it made a few overtures toward licensing its software to other computer manufacturers, while at the same time trying to modernize its operating system, which was threatening to slip behind Windows. While Apple eventually scrapped their licensing plans, an interesting product of the situation was Rhapsody OS. Although Apple was still building PowerPC computers, Rhapsody also had compatibility with Intel processors, which [Omores] put to good use by running it on a relatively modern i7-3770 CPU.

[Omores] selected a Gigabyte GA-Z68A-D3-B3 motherboard because it supports IDE emulation for SATA drives, a protocol which Rhapsody requires. The operating system installer needs to run from two floppy disks, one for boot and one for drivers. The Gigabyte motherboard doesn’t support a floppy disk drive, so [Omores] used an older Asus P5E motherboard with a floppy drive to install Rhapsody onto an SSD, then transferred the SSD to the Gigabyte board. The installation initially had a kernel panic during installation caused by finding too much memory available. Limiting the physical RAM available to the OS by setting the maxmem value solved this issue.

After this, the graphical installation went fairly smoothly. A serial mouse was essential here, since Rhapsody doesn’t support USB. It detected the video card immediately, and eventually worked with one of [Omores]’s ethernet cards. [Omores] also took a brief look at Rhapsody’s interface. By default, there were no graphical programs for web browsing, decompressing files, or installing programs, so some command line work was necessary to install applications. Of course, the highlight of the video was the installation of a Doom port (RhapsoDoom).

This isn’t the first obscure Apple operating system we’ve seen; some of them have even involved updates to Apple’s original releases. We’ve also seen people build Apple hardware.

Thanks to [Stephen Walters] for the tip!

Fitting A Spell Checker Into 64 KB

By some estimates, the English language contains over a million unique words. This is perhaps overly generous, but even conservative estimates generally put the number at over a hundred thousand. Regardless of where the exact number falls between those two extremes, it’s certainly many more words than could fit in the 64 kB of memory allocated to the spell checking program on some of the first Unix machines. This article by [Abhinav Upadhyay] takes a deep dive on how the early Unix engineers accomplished the feat despite the extreme limitations of the computers they were working with.

Perhaps the most obvious way to build a spell checker is by simply looking up each word in a dictionary. With modern hardware this wouldn’t be too hard, but disks in the ’70s were extremely slow and expensive. To move the dictionary into memory it was first whittled down to around 25,000 words by various methods, including using an algorithm to remove all affixes, and then using a Bloom filter to perform the lookups. The team found that this wasn’t a big enough dictionary size, and had to change strategies to expand the number of words the spell checker could check. Hash compression was used at first, followed by hash differences and then a special compression method which achieved an almost theoretically perfect compression.

Although most computers that run spell checkers today have much more memory as well as disks which are orders of magnitude larger and faster, a lot of the innovation made by this early Unix team is still relevant for showing how various compression algorithms can be used on data in general. Large language models, for one example, are proving to be the new frontier for text-based data compression.

Booting A Desktop PDP-11

Ever heard of VENIX? There were lots of variants of Unix back in the day, and VENIX was one for the DEC Professional 380, which was — sort of — a PDP 11. The 1982 machine normally ran the unfortunately (but perhaps aptly) named P/OS, but you could get VENIX, too. [OldVCR] wanted to put one of these back online and decided the ST-506 hard drive was too risky. A solid-state drive upgrade and doubling the RAM to a whole megabyte was the plan.

It might seem funny to think of a desktop workstation that was essentially a PDP-11 minicomputer, but in the rush to corner the personal computer market, many vendors did the same thing: shrinking their legacy CPUs. DEC had a spotty history with small computers. [Ken Olsen] didn’t think anyone would ever want a personal computer, and the salespeople feared that cheap computers would eat into traditional sales. The Professional 350 was born out of DEC’s efforts to catch up, as [OldVCR] explains. He grabbed this one from a storage unit about to be emptied for scrap.

The post is very long, but you get a lot of history and a great look inside this vintage machine. Of course, the PDP-11 couldn’t actually handle more than 64K without tricks and you’ll learn more about that towards the end of the post, too.

Just as a preview, the story has a happy ending, including a surprising expression of gratitude from the aging computer. DEC didn’t enjoy much success in the small computer arena, eventually being bought by Compaq, which, in turn, was bought by Dell HP. During their heyday, this would have been unthinkable.

The PDP/11 did have some success because it was put on a chip that ended up in several lower-end machines, like the Heathkit H11. Ever wonder how people programmed the PDP computers with switches and lights?

UNIX Archaeology Turns Up 1972 “V2 Beta”

In 1997 a set of DEC tapes were provided by Dennis Ritchie, as historical artifacts for those interested in the gestation of the UNIX operating system. The resulting archive files have recently been analysed by [Yfeng Gao], who has succeeded in recovering a working UNIX version from 1972. What makes it particularly interesting is that this is not a released version, instead it’s a work in progress sitting somewhere between versions 1 and 2. He’s therefore taken the liberty of naming it “V2 Beta”.

If you happen to have a PDP-11/20 you should be able to run this operating system for yourself, and for those of us without he’s provided information on which emulator will work. The interesting information for us comes in the README accompanying the tapes themselves, and in those accompanying the analysis. Aside from file fragments left over from previous users of the same tape, we learn about the state of UNIX time in 1972. This dates from the period when increments were in sixtieths of a second due to the ease of using the mains power frequency in a PDP, so with a 32-bit counter they were facing imminent roll-over. The 1970-01-01 epoch and one second increments would be adopted later in the year, but meanwhile this is an unusual curio.

If you manage to run this OS, and especially if you find anything further in the files, we’d love to hear. Meanwhile, this is not the oldest UNIX out there.

Featured image: “PDP-11/20 Rocker Switches” by Don DeBold

Grep By Example is also available as a PDF Minibook, and a Grep playground helps you learn quickly.

Galvanize Your Grip On Grep With This Great Grep Guide

These days, you can’t throw a USB stick without hitting something that’s running Linux. It might be a phone, an embedded device, or your TV. Either way, it’s running Linux, and somewhere along the line of the development of whatever your USB stick smacked into, somebody used the Global Regular Expression Print utility- better known as Grep. But what is Grep, and why do you need it? [Anton Zhiyanov] not only answers those questions but provides Grep by example: Interactive Guide to help you along.

Grep By Example is also available as a PDF Minibook, and a Grep playground helps you learn quickly.
Grep By Example is also available as a PDF Minibook, and a Grep playground helps you learn quickly.

To understand Linux, one must understand its commercial predecessor, Unix. One of the things that made Unix (and then Linux) unique was its philosophy: Write programs that work together, do one thing well, and handle text streams.  This philosophy describes a huge number of programs, and one of these programs is Grep. It’s installed everywhere there’s a *nix installed, and once one becomes familiar with it, their command-line-fu reaches an all new level.

At its core, Grep is simply a bloodhound. It’s scent? A magical incantation called Regular Expressions. Regular Expressions (aka Regex) are simply a way of describing what a stream of text should look like. So when you feed Grep a bit of Regular Expression, it Prints only the text that matches that expression. Neat, right?

The trouble is that Regex can be kind of hard, and Grep has various versions and capabilities that need to be learned. And this is where the article shines- it covers both in an excellent interactive tutorial that’ll help you become a Grep Guru in no time. And if you want to do a deeper dive, check out what it takes to make your own Regex Engine from scratch!

Running UNIX On A Nintendo Entertainment System

Who wouldn’t want to run a UNIX-like operating system on their NES or Famicom? Although there’s arguably no practical reason for doing so, [decrazyo] has cobbled together a working port of Little Unix (LUnix), which was originally written for the Commodore 64 and 128 by [Daniel Dallmann]. The impetus for this project was initially curiosity, but when [decrazyo] saw that someone had already written a UNIX-like OS for the 6502 processor, it seemed apparent that the NES was too similar to the C64 to not port it.

Much of this is relatively straightforward, as the 6502 MPU in the C64 is nearly identical to the Ricoh 2A03 in the NES, with the latter missing the binary-coded decimal support, which is not a crucial feature. The only significant roadblock was the lack of RAM in the NES. The console has a mere 2 KB of RAM and 2 KB of VRAM, which made it look anemic even next to the C64. Here, a Japan-only accessory came to the rescue: the Famicom Disk System (FDS), which is a proprietary floppy disk-based system that slots into the bottom of the Famicom and was used for games as well as storing saves back in the day.

By using a Famicom with FDS, it was possible to gain an additional 32 kB provided by the FDS, making the userspace utilities available in the shell. The fruits of this labor work well enough that he could also pop it up on an EverDrive cartridge that supports FDS ROMs and boot it up on an unmodified NES. Whether this is cooler than the NES-OS, which we covered previously, is up for debate.

Incidentally, [Maciej Witkowiak] seems to have resumed development on LUnix, with a new release in 2023, so maybe UNIX-on-6502 may see a revival after a few decades of little happening.

Continue reading “Running UNIX On A Nintendo Entertainment System”