Full DIY: A UNIX Clone On TTL

Making a CPU or indeed a whole computer system from scratch using discrete logic chips is by no means an unusual project, but it’s still one that requires quite a lot of technical ability and understanding of how computers work. Similarly, writing a UNIX-like operating system from scratch is something that’s been done more than once, but which definitely puts the author in an exclusive breed.  Creating a CPU and computer system from discrete logic and then writing a UNIX-like OS for it? That’s definitely something new, but here’s [RobotMan2412] with both CPU and operating system to prove it!

The GR8CPU as he calls it is an 8-bit design with a 16-bit address space, making it equivalent to a typical mid-to-late 1970s 8-bit chip. He’s on revision 3 of the processor, and even makes the bold suggestion that it might be the most complex breadboard CPU ever made. That’s impressive enough, but to add a UNIX-like operating system makes it special.

While he has a real GR8CPU, it appears he’s also written an emulator with access to a disk filesystem, and it’s on this that he shows us the OS running. Don’t expect an all-singing all-dancing desktop OS here, instead it’s a kernel and very basic command line that’s just about able to run a Hello World. The kernel is hand-coded in assembler and is about 5 kB in size.

We look forward to seeing more of this project, and hope maybe he’ll one day soon publish the source. As a reminder that this is a perfectly capable platform for the job, here’s the original UNIX running on a vintage DEC PDP7.

The Raspberry Pi Pico Can’t Run Linux. But It Can Run Fuzix.

The great divide in terms of single board computers lies between those that can run some form of Linux-based distribution, and those that can not. For example the Raspberry Pi Zero is a Linux board, while the Raspberry Pi Pico’s RP2040 processor lacks the required hardware to run everybody’s favourite UNIX-like operating system. That’s not to say the new board from Cambridge can’t run any UNIX-like operating system though, as [David Given] shows us with his Fuzix port.

Fuzix is a UNIX-like operating system for less capable processors, more in the spirit of those original UNIXes than of a modern Linux-based distribution. It’s the work of the respected former Linux kernel developer and maintainer [Alan Cox], and consists of a kernel, a C compiler, and a set of core UNIX-like applications.

The RP2040 port maybe needs a little more work to be considered stable. For now, the multitasking support isn’t quite there and NAND flash support is broken, but it does have SD card support for a proper UNIX filesystem and the full set of core tools. Perhaps most interestingly, it only occupies a single core of the dual-core chip, leaving the possibility of the other core and those PIOs to be used for other purposes.

Fuzix has made the occasional appearance here over the years, but perhaps not as often as it should. If you’d like to learn a little more about the genesis of UNIX, we took a look in 2019.

Header: Michiel Henzler (CC BY-SA 4.0).

Hackability Matters

The Unix Way™ provides extreme hackability. The idea is that software should be written as tools to accomplish discrete tasks, and that it should be modular, extensible, and play well with others. It’s like software as a LEGO set — you can put the blocks together however you want, within limits, and make stuff that’s significantly cooler than any of the individual blocks alone.

Clearly this doesn’t work for all applications — things like graphics editors and web browsers don’t really lend themselves to being elegant tools that integrate well with others, right? It’s only natural that they’re bloaty walled gardens. What happens in the browser must stay in the browser, right?

But how sad is it that the one piece of software you use all day, your window into cyberspace, doesn’t play well with the rest of your system? I’d honestly never really been bothered by that fact until stumbling on TabFS. It’s an extension to Chrome that represents the tabs on your browser as if they were files on your local system — The Unix Way™. And what this means is that any other program that can read from or write to a file can open tabs, collect them, change webpages on the fly, and so on. It opens up the browser to you.

This is tremendously powerful. Don’t like the bookmarking paradigm of your particular browser? Writing your own would be a snap in Python — and you could do cleverer things like apply a little machine learning to handle putting them in categories. Want to pop open (or refresh) a set of webpages at a particular time every day? Cron, or its significantly more complicated counterpart systemd, and a couple lines of code will do that. Want to make a hardware button that converts dark mode to light mode and vice-versa for every website starting with “H”? Can do.

I’m picking on browsers, but many large pieces of software are inaccessible in the same way — even if they’re open source, they don’t open up channels for interaction with user code or scripts. (Everything “in the cloud” or “as a service”, I’m looking at you! But that’s a further rant for another day.) And that’s a shame, because most of these “big” pieces of software actually do the coolest things.

So please, if you’re working on a big software package, or even just writing a plug-in for one, do think about how you can make more of its abilities available to the casual scripter. Otherwise, it’s just plastic blocks that don’t fit with the rest of the set.

Linux Fu: Alternative Shells

On Unix — the progenitor of Linux — there was /bin/sh. It was simple, by comparison to today’s shells, but it allowed you to enter commands and — most importantly — execute lists of commands. In fact, it was a simple programming language that could make decisions, loop, and do other things to allow you to write scripts that were more than just a list of programs to run. However, it wasn’t always the easiest thing to use, so in true Unix fashion, people started writing new shells. In this post, I want to point out a few shells other than the ubiquitous bash, which is one of the successors to the old sh program.

Since the 7th Edition of Unix, sh was actually the Bourne shell, named after its author, Stephen Bourne. It replaced the older Thompson shell written in 1971. That shell had some resemblance to a modern shell, but wasn’t really set up for scripting. It did have the standard syntax for redirection and piping, though. The PWB shell was also an early contender to replace Thompson, but all of those shells have pretty much disappeared.

You probably use bash and, honestly, you’ll probably continue to use bash after reading this post. But there are a few alternatives and for some people, they are worth considering. Also, there are a few special-purpose shells you may very well encounter even if your primary shell is bash.

Continue reading “Linux Fu: Alternative Shells”

Open-Source ARM Development Simplified

The ARM series of processors are an industry standard of sorts for a vast array of applications. Virtually anything requiring good power or heat management, or any embedded system which needs more computing power than an 8-bit microcontroller is a place where an ARM is likely found. While they do appear in various personal computers and laptops, [Pieter] felt that their documentation for embedded processors wasn’t quite as straightforward as it could be and created this development board which will hopefully help newbies to ARM learn the environment more easily.

Called the PX-HER0, it’s an ARM development board with an STM32 at its core and a small screen built in. The real work went in to the documentation for this board, though. Since it’s supposed to be a way to become more proficient in the platform, [Pieter] has gone to great lengths to make sure that all the hardware, software, and documentation are easily accessible. It also comes with the Command Line Interpreter (CLI) App which allows a user to operate the device in a Unix-like environment. The Arduino IDE is also available for use with some PX-HER0-specific examples.

[Pieter] has been around before, too. The CLI is based on work he did previously which gave an Arduino a Unix-like shell as well. Moving that to the STM32 is a useful tool to have for this board, and as a bonus everything is open source and available on his site including the hardware schematics and code.

Happy 50th Birthday To All You Epoch Birthers

Good morning everyone, and what a lovely start to the new year it is, because it’s your birthday! Happy birthday, it’s your 50th! What’s that you say, you aren’t 50 today? (Looks…) That’s what all these internet databases say, because you’ve spent the last decade or so putting 1970-01-01 as your birth date into every online form that doesn’t really need to know it!

It’s been a staple for a subset of our community for years, to put the UNIX epoch, January 1st 1970, into web forms as a birth date. There are even rumours that some sites now won’t accept that date as a birthday, such is the volume of false entries they have with that date. It’s worth taking a minute though to consider UNIX time, some of its history and how its storage has changed over the years.

Continue reading “Happy 50th Birthday To All You Epoch Birthers”

Hackaday Links Column Banner

Hackaday Links: November 24, 2019

It barely seems like it, but it’s been a week since the 2019 Hackaday Superconference wrapped up in sunny Pasadena. It was an amazing weekend, filled with fun, food, camaraderie, and hacks galore. For all who were there, it’ll likely take quite some time before spinning down to Earth again from the post-con high. For those who couldn’t make it, or for those who did but couldn’t squeeze in time for all those talks with everything else going on, luckily we’ve got a ton of content for you to review. Start on the Hackaday YouTube channel, where we’ve got videos already posted from most of the main stage talks. Can’t-miss talks include Chris Gammell’s RF deep-dive, Kelly Heaton’s natural electronic art, and Mohit Bhoite’s circuit sculpture overview. You’ll also want to watch The State of the Hackaday address by Editor-in-Chief Mike Szczys. More talks will be added as they’re edited, so watch that space for developments.

One of the talks we missed – and video of which appears not to be posted yet – was Adam Zeloof’s talk on thermodynamic design for your circuits. While we wait for that, here’s an interesting part that might prove useful for your next high-power design. It’s a Thermal Jumper Chip, which is essentially a ceramic SMD component that can conduct heat but not electricity. It’s intended to be used where a TO-220 case needs to be electrically isolated but thermally connected to a heatsink. Manufacturer TT Electronics has a whole line of the chips in various sizes and specs, plus a lot of other cool components like percussive igniters.

We got an interesting tip this week about a new development in the world of 3D-printing. A group from Harvard demonstrated a multinozzle extruder that can print multimaterial objects in a single pass. The work is written up in a Nature article entitled “Voxelated soft matter via multimaterial multinozzle 3D printing”, which is unfortunately paywalled, but the abstract and supplementary videos are really interesting. This appears not to be a standard hot plastic extrusion process; rather, the extruder uses elastomeric inks that cure after they’re extruded. They manage some clever tricks, including a millipede-like, vacuum-powered soft robot extruded in one pass from both soft and rigid silicone elastomers. It’s genuinely interesting stuff, and watching the multimaterial extruder head switch materials at up to 50 times per second is mesmerizing.

People really seemed to get worked up over the transit of Mercury across the face of the Sun last week, and for good reason – astronomical alignments such as these which can be seen from Earth are rare indeed, and worth taking time to see. Not everyone was in the right place at the right time with the right gear to view the transit directly, though, which is why we were glad that Justin over at The Thought Emporium did a video on leveraging online assets for space-based observations. We’ve featured a ton of hacks using SDRs and the like to intercept data from weather satellites, and while those hacks are fun and you should totally try them, Justin points out that most of these streams are readily available for free over the Internet. Clouds, lightning, forest fires and Earth changes, and yes, even the state of the Sun can all be monitored from the web.

Speaking of changes, do you know what has changed in Unix over the last 50 years? For that matter, did you know that Unix turned 50 recently? Sean Haas did after reading this article in Advent of Computing, which he shared on the tipline. The article compares a modern Debian distro to documentation from 1971 that pre-dates Unix version 1; we assume the “Dennis_v1” folder in the doc’s URL refers to none other than Dennis Ritchie himself. It turns out that Unix is remarkably well-conserved over 50 years, at least in the userspace. File system navigation and shell commands are much the same, while programming was much different. C didn’t yet exist – Dennis was busy – but there were assemblers and linkers, plus a FORTRAN compiler and an interpreter for BASIC. It’s comforting to know that if you drop into a wormhole and end up sitting in front of a PDP-11 with Three Dog Night singing “Joy to the World” on the radio in the background, you’ll at least be able to look like you belong there.

And finally, it’s nearly Sparklecon time again. Sparklecon VII will be held on January 25 and 26, 2020, at the 23b Shop hackspace in Fullerton, California. We’ve covered previous Sparkelcons and we’ve even sponsored the meetup in the past, and it looks like a blast. The organizers have put out a Call for Proposals for talks and workshops, so if you’re in the mood for some mischief, get your application going. And be quick about it – the CFP closes on December 8.