Explore Linux Space Time

If you’ve ever wondered how much memory a process uses, you’ve probably used a form of task manager or system monitor. System monitors can be useful to identify resource hogs, but are often less versatile if you want more details about just one process. If you’ve ever faced this problem, then [Fabien Sanglard]’s Space-Time explorer is for you!

The wonderfully punny Space-Time tool records physical memory usage, time spent in user space vs. kernel space and even threads and subprocesses created. These words may not mean much to some readers, so let’s quickly go over them: Physical memory usage is the actual amount of RAM given (not always the same as requested). The kernel (which lives in kernel space) is the supervisor to all processes on a computer. In contrast, every process lives in it’s own “user space”, a way of protecting the kernel. Finally, a subprocess (or “child process”) is simply a process started by another process (the “parent”). Continue reading “Explore Linux Space Time”

The Python documentation for str.strip().

Faster String Processing With Bloom Filters

At first, string processing might seem very hard to optimize. If you’re looking for a newline in some text, you have to check every character in the string against every type of newline, right? Apparently not, as [Abhinav Upadhyay] tells us how CPython does some tricks in string processing.

The trick in question is based on bloom filters, used here to quickly tell whether a character possibly matches any in a predefined set. A bloom filter works by condensing a set of more complex data to a couple of bits in an array. When an element is added, a bit is set, the index of which is determined by a hash function. To test whether an element might be in the filter, the same is done but by testing the bit instead of setting it. This effectively allows a fast check of whether an element might be in the filter.

CPython doesn’t stop optimizing there: instead of a complicated hash function, it simply uses the lowest 6 bits. It also has a relatively small bit array at only 64 bits which allows it to avoid memory all together, which in turn makes the comparisons much faster. [Abhinav] goes far into more detail in his article, definitely worth a read for any computer scientists among us.

Nowadays there is ever increasing amounts of talk about AI (specifically large language models), so why not apply an LLM to Python to fix the bugs for you?

A colorful diagram representing the inner structure of the Linux kernel.

Find That Obscure Function With This Interactive Map Of The Linux Kernel

Linux has become one of the largest operating systems on the servers that run large websites, and hopefully, one day, it will be big in the desktop market too. Some of you may know how Linux as an operating system is structured, but have you ever wondered how the kernel itself is structured? Maybe you’ll find this colorful interactive map of the Linux kernel by [Costa Shulyupin] useful.

The interactive map depicts the major levels of abstraction and functionalities, dotted with over 400 prominent functions from the Linux kernel, which are also links to a cross-reference site so you can see all the definitions and usages. It divides the kernel into 7 rows and 7 columns containing domains with well-known terms like security and debugging, but also more obscure things like block devices and address families. These are also links, this time to the definition of the term in question. Finally, there are arrows flying everywhere, to show the relationships between all the many functions in the kernel.
Continue reading “Find That Obscure Function With This Interactive Map Of The Linux Kernel”

A rotary subwoofer made out of a speaker coil, a medium-size fan an a grey wooden box to stand on.

Tear Apart Your House For $200 With This Rotary Subwoofer

Many movies and songs use a lot of of bass to make it feel more real to the viewer or listener. Because of this, subwoofers are common in high-quality audio setups, often costing a substantial part of the budget. [Daniel Fajkis] takes the subwoofer to it’s logical extreme by building a rotary subwoofer on a $200 budget.

The principle of a rotary subwoofer is that a normal subwoofer physically moves the air, and so does a fan. If you could make a fan oscillate the air instead of only pushing it, you could turn it into such a subwoofer, which is exactly what [Daniel] did. [Daniel] mounts a large electric motor on the case of an ex-subwoofer to spin the fan. Then, he uses the rotor linkage of a model helicopter and a modified subwoofer speaker to pitch the fan blades, spinning around to create a truly impressive gust of air oscillating at as low as 1 Hz.

The video, after the break, is well made with some good humor, including the legendary quote: “It’s gonna tear apart my household, there’s no way we’re surviving this one.”
Continue reading “Tear Apart Your House For $200 With This Rotary Subwoofer”

An array of 2D barcodes stored on a ceramic medium. Each 2D barcode is 25 micrometers wide.

Cerabyte: One Terabyte Per Square Centimeter

Most of us will at one point have run out of storage and either had to buy a larger driver or delete some of those precious files. This problem can happen to data centers, too, with the ever-increasing amount of data stored on servers across the world. [Cerabyte] aims to fix this, with their ceramic-based media promising 1 TB/cm² of areal density.

To put into perspective just how much better this density is, we can compare it against SSDs and hard drives. At the time of writing, the densest SSD (NAND flash storage) is claimed to be 0.1825 TB/cm² and the densest hard drive is claimed to be 0.1705 TB/cm², which means 5.48 times and 5.87 times more dense respectively. The density improvement doesn’t end there — both an SSD and a single HDD platter might be a couple millimeters tall, while a [Cerabyte] layer claims to be merely 50 atoms tall.

[Cerabyte] aims to create 10 PB (10,000 TB) and later 1 EB (1,000,000 TB) racks with their technology, a feat difficult to achieve with mere hard drives. The ceramic-based media is written to using lasers and read from with a microscope, though throughput is limited to a “mere” 1 GB/s, which means filling that one rack could take as long as 110 days. Despite the relatively slow access times, we think this new storage technology is impressive, assuming [Cerabyte] succeeds.

Do you need so much storage that even [Cerabyte] can’t satisfy your needs? Simply use YouTube as infinite storage!

A Heathkit H8 in which hides an 8008 instead of the normal 8080

Downgrade Your Heathkit H8 To The World’s First 8-bit Microprocessor

Typically when you’re replacing parts in an old computer it’s either for repairs or an upgrade. Upgrades like adding a more capable processor to an old computer are the most common, and can help bring an old computer a bit closer to the modern era. [Dr. Scott M. Baker] had a different idea, when he downgraded a Heathkit H8 from an 8080 to an 8008.

Despite the very similar numbers, the 8080 runs at four to nearly sixteen times the speed of its predecessor. In addition to this, the 8008 is far less capable on multiple fronts like address space, I/O ports, the stack and even interrupts. The 8008 does have one thing going for it though: the 8008 is widely known as the world’s first 8-bit microprocessor.

A green circuit board with an 8008 and supporting electronics.
The custom 8008 CPU board for the Heathkit H8.

In the video after the break, [Scott] goes into great detail about the challenges presented in replacing the 8080 with the 8008, starting with the clock. The clock is two-phase, so that what would otherwise be a single oscillator now also has a clock divider and two NAND gates.

Boring clock stuff aside, he does some great hacking using the I/O ports including expanding the I/O port count from 32 to the full 256, bit-banging serial, implementing an interrupt controller and even memory mapping 64 KiB into 16 KiB of address space! With that and a few more special adapter circuits, we think [Scott] has done a great job of downgrading his H8 and the resulting CPU board looks fabulous.

Maybe you’re wondering what happens if you upgrade the computer instead of the CPU? What you get is this credit-card sized 6502 computer.

Continue reading “Downgrade Your Heathkit H8 To The World’s First 8-bit Microprocessor”

An automatic laser turret playing with a cat.

Entertain Your Cats Automatically With LazerPaw

Most of us would agree that kittens are very cute, but require lots of attention in return. What would you do if you adopted three abandoned cats but didn’t have all day to play with them? [Hoani Bryson] solved his problem by building LazerPaw — an autonomous, safe way to let your cats chase lasers.

Having recently tinkered with computer vision in the form of OpenCV, [Hoani] decided he would make a laser turret for his cats to play with. An infrared camera, used so that the LazerPaw works in the dark, is mounted to the laser and the Raspberry Pi. These electronics are then mounted on a servo-based pan/tilt module, which is in turn mounted with two smartphone clamps to the ceiling. That way, when the cats chase the laser, they will be looking away from the beam source. Additionally, if the device is aiming directly at a cat, the laser is turned off. Finally, [Hoani] added some NeoPixels with an Arduino-based controller for extra hacker vibes.

The LazerPaw’s software takes in a 30 FPS stream from a webcam, scales it down for performance, and applies a threshold filter to it. When a black pixel, which is assumed to be a cat, is detected, it “pushes” the camera away from it depending on how close to the laser it is. The effect of this is that every time a cat catches up to the laser, it moves away again. The processed images are also sent to an interactive website for remote cat playtime. Finally, there is also a physical start button so you don’t need WiFi to use it.

Is your cat more of a sunbather than a deadly murder beast? Maybe it’ll like this cat chair that follows the sun.

Continue reading “Entertain Your Cats Automatically With LazerPaw”