Building A Dependency-Free GPT On A Custom OS

The construction of a large language model (LLM) depends on many things: banks of GPUs, vast reams of training data, massive amounts of power, and matrix manipulation libraries like Numpy. For models with lower requirements though, it’s possible to do away with all of that, including the software dependencies. As someone who’d already built a full operating system as a C learning project, [Ethan Zhang] was no stranger to intimidating projects, and as an exercise in minimalism, he decided to build a generative pre-trained transformer (GPT) model in the kernel space of his operating system.

As with a number of other small demonstration LLMs, this was inspired by [Andrej Karpathy]’s MicroGPT, specifically by its lack of external dependencies. The first step was to strip away every unnecessary element from MooseOS, the operating system [Ethan] had previously written, including the GUI, most drivers, and the filesystem. All that’s left is the kernel, and KernelGPT runs on this. To get around the lack of a filesystem, the training data was converted into a header to keep it in memory — at only 32,000 words, this was no problem. Like the original MicroGPT, this is trained on a list of names, and predicts new names. Due to some hardware issues, [Ethan] hasn’t yet been able to test this on a physical computer, but it does work in QEMU.

It’s quite impressive to see such a complex piece of software written solely in C, running directly on hardware; for a project which takes the same starting point and goes in the opposite direction, check out this browser-based implementation of MicroGPT. For more on the math behind GPTs, check out this visualization.

Continue reading “Building A Dependency-Free GPT On A Custom OS”

C64 Gets A Modern Interactive Disassembler

If you want to pull apart a program to see how it ticks, you’re going to need a disassembler. [Ricardo Quesada] has built Regenerator 2000 for just that purpose. It’s a new interactive disassembler for the Commodore 64 platform.

Naturally, Regenerator 2000 is built with full support for the 6502 instruction set, including undocumented op-codes as well. It’s able to automatically create labels and comments and can be paired with the VICE C64 emulator for live debugging. You can do all the usual debug stuff like inspecting registers, stepping through code, and setting breakpoints and watchpoints when you’re trying to figure out how something works. It can even show you sprites, bitmaps, and character sets right in the main window.

Files are on Github if you’re ready to dive in. You might find this tool to be a useful companion to C64 assembly tools we’ve featured previously, as well. If you’re pulling off your own retro development hacks, be sure to notify the tipsline.

[Thanks to Stephen Waters for the tip!]

NASA Uses Mars Global Localization As GNSS Replacement For The Perseverance Rover

Unlike on Earth there aren’t dozens of satellites whizzing around Mars to provide satellite navigation functionality. Recently NASA’s JPL engineers tried something with the Perseverance Mars rover that can give such Marsbound vehicles the equivalent of launching GPS satellites into Mars orbit, by introducing Mars Global Localization.

Although its remote operators back on Earth have the means to tell the rover where it is, it’d be incredibly helpful if it could determine this autonomously so that the rover doesn’t have to constantly stop and ask its human operators for directions. To this end the processor which was originally used to communicate with its Ingenuity helicopter companion was repurposed, reprogrammed to run an algorithm that compares panoramic images from the rover’s navigation cameras with its onboard orbital terrain maps.

Much like terrain-based navigation as used in cruise missiles back on Earth, this can provide excellent results depending on how accurate your terrain maps are. This terrain mapping process used to be done back on Earth, but for the past years engineers have worked to give the rover its own means to perform this task.

Continue reading “NASA Uses Mars Global Localization As GNSS Replacement For The Perseverance Rover”

Pan-Tilt Head For Camera Motion Control

Historically, moving and pointing a camera while filming was the job of a highly-skilled individual. However, there are machines that can do that, enabling all kinds of fancy movement that is difficult or impossible for a human to recreate. A great example is this pan-tilt build from [immofoto3d.]

The build uses a hefty cradle to mount DSLR-size cameras or similar. It’s controlled in the tilt axis by a chunky NEMA 17 stepper motor hooked up to a belt drive for smooth, accurate movement. Similarly, another stepper motor handles the pan axis, with an option for upgrade if you have a heavier camera rig that needs more torque to spin easily. Named Gantry Bot, it’s an open-source design with source files available, so you can make any necessary tweaks on your own. You will have to bring your own control mechanism, though—telling the stepper motors what to do and how fast to do it is up to you.

It’s a heavy-duty build, this one, and you’ll really want a decent metal-capable CNC to get it done, along with a 3D printer for all the plastic pieces. With that said, we’ve featured some other similar builds that might be more accessible if you don’t have a hardcore machine shop in the basement. If you’ve got your own impressive motion rig in the works, be sure to notify the tipsline!

SNES Controllers Are (Almost) SPI-Compatible

Considering that the Serial Peripheral Interface bus semi-standard has been around since the early 1980s, it’s perhaps not that shocking that the controllers of the Super Nintendo Entertainment System (SNES) would take at least some strong design hints for the used protocol. This does however raise the question of exactly how compatible a SNES controller is when connected to the SPI master peripheral of any random MCU. Recently [James Sharman] set out to answer this question decisively.

The impetus for answering this question came after [James] designed a separate SNES controller board for his homebrew computer system, which led to many comments on that video saying that he could just have hooked the controller up to the SPI board in said homebrew system.

Here the short answer is that the SNES controller protocol is very close to SPI Mode-1, with a similar arrangement of clock/data/chip select (latch) lines and clocking. If you think of the SNES controller as an SPI device with just a MISO line, you’re basically there already. The only niggle that popped up was that the ‘MISO’ line does not get pulled into a high-impedance state when the active-low latch connection is pulled high.

This was fixable by introducing a 74HC125 tri-state buffer IC, after which both the original SD card and twin SNES controllers could be used simultaneously.

Continue reading “SNES Controllers Are (Almost) SPI-Compatible”

Cynus Chess Robot: A Chess Board With A Robotic Arm

Downward-facing camera and microphone in the arm. (Credit: Techmoan, YouTube)
Downward-facing camera and microphone in the arm. (Credit: Techmoan, YouTube)

There are many chess robots, most of which require the human player to move the opposing pieces themselves, or have a built-in mechanism that can slide the opposing pieces around to their new location. Ideally, such a chess robot would move the pieces just like how a human would, of course. That’s pretty much the promise behind the Manya Cynus chess robot, which [Matt] over at the Techmoan YouTube channel bought from the Kickstarter campaign.

Advertising itself as a ‘Portable AI Chess Robot’, the Manya Cynus chess robot comes in the form of a case that unfolds into a chess board and also contains the robotic arm that contains the guts of the operation. Powered by the open source Stockfish chess engine, it can play games against a human opponent at a few difficulty levels without requiring any online connectivity or a companion app. It moves its own pieces by picking up the metal-cored chess pieces with its arm, while its front display tries to display basic emotions with animated eyes. A 3-MP downward-facing camera is located on the head section, along with a microphone.

As for how well it works, [Matt] isn’t the best chess player, but he had a fair bit of fun with the machine. His major complaints circle around how unfinished the firmware still feels, with e.g., invalid moves basically ignored with only a barely visible warning popping up on the screen. In general, he’d rather classify it as an interesting development kit for a chess robot, which is where the BLE 5.1-based interface and a purported Python-based development environment provided by Manya seem to come into focus.

Continue reading “Cynus Chess Robot: A Chess Board With A Robotic Arm”

LED Printers: The Quiet Achievers You May Not Have Heard Of

Many different types of printers have entered the market over the years. Most of us are intimately familiar with the common inkjet and laser, both of which can be found in homes and offices all over the world. Then there are those old dot matrix printers that were so noisy in use, thermal printers, and even solid ink printers that occupied a weird niche for a time.

However, very little attention is ever paid to the LED printer. They’re not actually that uncommon, and they work in a very familiar way. It’s just that because these printers are so similar to an existing technology, they largely escaped any real notability in the marketplace. Let’s explore the inner workings of the printer tech that the world forgot.

Continue reading “LED Printers: The Quiet Achievers You May Not Have Heard Of”