Transforming A Keyboard To A Mouse In Software

You’ve probably heard the old saying that if it looks like a duck, and it quacks like a duck… So when is a keyboard a mouse? When software makes it quack like a mouse — that is, if mice quacked. [Blackle Mori] took a cheap USB keypad and, using the libevdev Linux system, made it impersonate a mouse.

The code on GitHub isn’t complex, but the details can take some time to get right. The code takes over all input events from the device. [Blackle] dumped out events sent from the keypad, but the stock evtest program would probably have done just as well.

Continue reading “Transforming A Keyboard To A Mouse In Software”

Linux Kernel From First Principles

Want to learn the internals of the Linux kernel? Version 6.5-rc5 has about 36 million lines of code in it, so good luck! [Seiya] has a different approach. Go back to the beginning and examine the 0.01 version of the kernel. Now you are talking about 10,000 lines and, removing comments and blanks, way less.

Sure, some things have changed, but the core ideas are the same. [Seiya] reports, “Reading V0.01 was really for me. It was like visiting Computer History Museum in Mountainview…”

Continue reading “Linux Kernel From First Principles”

Blackberry Pi Puts Desktop Linux In Your Pocket

Let’s face it — Android wasn’t what most of us had in mind when we imagined having Linux running on our phones. While there’s a (relatively) familiar kernel hiding at the core of Google’s mobile operating system, the rest of the environment is alien enough that you can’t run Linux software on it without jumping through some hoops. While that’s fine for most folks, there remains a sizable group of users who still dream of a mobile device that can run a full Linux operating system without any compromises.

Judging by the work put into the Blackberry Pi, we’re willing to bet that [IMBalENce] falls into that camp. The custom handheld combines the Raspberry Pi Zero, a 320×240 LCD, and the BBQ20KBD keyboard from Solder Party with a 2500 mAh LiPo pouch cell and associated charging circuitry. Optionally, it also supports modules such as the Raspberry Pi Camera, a Real-Time-Clock, a ADS1015 ADC to read the battery voltage, and even a USB hub — although you can’t have all the goodies installed at once as it draws too much current.

Everything is packed into a 3D printed case that looks roughly like an original DMG-01 Game Boy if somebody replaced the bottom half with a tiny keyboard. We appreciate the ZX Spectrum theme, even if it’s not immediately clear how it relates to the project other than being an excuse to play around with multi-color printing. [IMBalENce] says the final product works quite well, though the relatively limited keys on the BlackBerry keyboard does make it tricky to use the device for writing code.

Interested in mobile Linux, but not trying to build the hardware yourself? We recently took a look at the SQFMI Beepy, which is fairly similar in terms of hardware, but very much in need of some talented penguin wranglers who are willing to come in and work on the software and documentation. Think you’re up for the challenge?

Linux Containers The Hard Way

If you want to make containers under Linux, plenty of high-level options exist. [Lucavallin] wanted to learn more about how containers really work, so he decided to tackle the problem using the low-level kernel functions, and he shared the code with us on GitHub.

Containers are more isolated than processes but not quite full virtual machines. While a virtual machine creates a fake computer, a container is more like a fake operating system. Applications can run with their own idea of libraries, devices, and other resources, but it doesn’t try to abstract the underlying hardware.

Continue reading “Linux Containers The Hard Way”

Debian Officially Adds RISC-V Support

As time goes on, more and more computer manufacturers are moving towards the ARM architecture and away from the bloated and outdated x86 instruction set. Apple is the most prominent producer to take this step, but plenty others are using ARM for its flexibility and efficiency. The only problem with ARM is that it’s licensed, so if you want to go even further down the open-source path the RISC-V instruction set is the next logical step. Now at least one mainline Linux distribution will officially support this architecture.

While Debian did have some support for RISC-V before this as a Debian port, which was not officially part of Debian. However, the official support will begin with the release of Debian 13, which is currently in the testing phase and hasn’t seen a stable release yet. To that end, the current state of this official version is extremely limited, being described as “almost empty” but with planned support for an initial 90 packages in the coming days. Most users working on a RISC-V platform will most likely to continue to use their Debian ports version.

It might be a little while before the RISC-V version is as full-featured as the ARM or x86 versions of this Linux distribution, but we are happy to see it move in this direction at all. And don’t think that RISC-V is limited to embedded systems or otherwise limited computing platforms, either. We’ve seen full Linux desktops with RISC-V processors since at least 2019.

Selectric Typewriter Goes From Trash Can To Linux Terminal

If there’s only lesson to be learned from [alnwlsn]’s conversion of an IBM Selectric typewriter into a serial terminal for Linux, it’s that we’ve been hanging around the wrong garbage cans. Because that’s where he found the donor machine for this project, and it wasn’t even the first one he’s come across in the trash. The best we’ve ever done is a nasty old microwave.

For being a dumpster find, the Selectric II was actually in pretty decent shape. The first couple of minutes of the video after the break show not only the minimal repairs needed to get the typewriter back on its feet, but also a whirlwind tour of the remarkably complex mechanisms that turn keypresses into characters on the page. As it turns out, knowing how the mechanical linkages work is the secret behind converting the Selectric into a teletype, entirely within the original enclosure and with as few modifications to the existing mechanism as possible.

Keypresses are mimicked with a mere thirteen solenoids — six for the “latch interposers” that interface with the famous whiffletree mechanism that converts binary input to a specific character on the typeball, and six more that control thinks like the cycle bail and control keys. The thirteenth solenoid controls an added bell, because every good teletype needs a bell. For sensing the keypresses — this is to be a duplex terminal, after all — [alnwlsn] pulled a page from the Soviet Cold War fieldcraft manual and used opto-interrupters to monitor the positions of the latch interposers as keys are pressed, plus more for the control keys.

The electronics are pretty straightforward — a bunch of MOSFETs to drive the solenoids, plus an AVR microcontroller. The terminal speaks RS-232, as one would expect, and within the limitations of keyboard and character set differences over the 50-odd years since the Selectric was introduced, it works fantastic as a Linux terminal. The back half of the video is loaded with demos, some of which aptly demonstrate why a lot of Unix commands look the way they do, but also some neat hybrid stuff, like a ChatGPT client.

Hats off to [alnwlsn] for tackling a difficult project while maintaining the integrity of the original hardware.

Continue reading “Selectric Typewriter Goes From Trash Can To Linux Terminal”

Ask Hackaday: What’s Linux Anyway?

Any time we mention Linux, it is a fair bet we will get a few comments from people unhappy that we didn’t refer to it as GNU/Linux or with some other appellation. To be fair, they aren’t wrong. Linux is a kernel. Much of what we think of as a Linux desktop OS is really from other sources, including, but not limited to, GNU. We thought about this after reading a report from [The Register] that Linux has nearly half of the desktop OS Linux market. Wait, what?

If you are like us, you probably think that’s a typo. It isn’t. But the more you think about it, the less sense it makes. You know that half of the world’s desktops don’t run Linux. But maybe they mean Unix? Nope. So how can Linux have almost half of the Linux market? That’s like saying nearly half of Hackaday readers read Hackaday, right?

Continue reading “Ask Hackaday: What’s Linux Anyway?”