I'm Chris. I blog here. I do it for me but if you enjoy it too then that makes me happy!

NetBSD & iBooks & Python, oh my!

Published on: 2025-05-14 16:52:30 • 3 min read

Preamble

NetBSD is my favorite of the "proper" Unix operating systems. There are many technical reasons one could point to, including its speed, simplicity, and small install footprint. My favorite reason, however, is in NetBSD's slogan: "Of course it runs NetBSD!"

It is no secret that I am a fan of old hardware. My rule to prevent my collecting from becoming hoarding is that each piece has to have an actual use. Since NetBSD runs on everything from high end modern systems all the way down to the Sega Dreamcast, I decided to use an iBook G4 for game development in Python with pygame.

The Hardware

This is my 12 inch iBook G4 from early 2004. Her name is Brick. An iBook G4 named "Brick"

Brick is decked out with:

  • A 1 GHz G4 PowerPC Processor
  • 1.25 GB or RAM
  • A 128 GB SSD
  • An ATI Mobility Radeon 9200
  • 1024x768 LCD

NetBSD

Obviously an iBook G4 is long out of support for OS updates. We need an alternate OS if we want to run up-to-date software on this device. NetBSD fits the bill perfectly.

NetBSD is a free and open-source Unix-like operating system based on the Berkeley Software Distribution (BSD). It's initial release was April 19, 1993 and continues to be developed today. The current version is 10.1 and is the version I am currently running. Why NetBSD on an iBook G4 and not Linux?

  • First and foremost, it runs! Most Linux distributions have all but dropped PowerPC 32 bit support. There is still a community supported version of Debian Sid but the installer is hit or miss. Even when I do get it running, things like CPU frequency scaling requiring ancient packages, brightness control wonkiness, audio difficulties, video driver problems, and other various issues make the experience death by a thousand cuts.
  • It's fast! Even compared to Linux running on my much faster PowerMac G4, the iBook runs pygame at 60 FPS vs the PowerMac's 25 FPS. Both were running on a non-hardware accelerated X environment.
  • NetBSD runs better. All the issues I mentioned previously do not exist for me on NetBSD. Volume and brightness control keyboard shortcuts work even outside of a desktop environment (even in the console!). CPU frequency scaling works. Audio works. Video drivers work. While not everything works like suspend and 3D acceleration, what I need does and does without issue.
  • Modern and up-to-date packages. The iBook gets a new lease on life with modern encryption ciphers and certificates. Most importantly, modern Python!

pygame

Per their about page, "Pygame is a set of Python modules designed for writing games. It is written on top of the excellent SDL library. This allows you to create fully featured games and multimedia programs in the python language. Pygame is highly portable and runs on nearly every platform and operating system."

On the date of this post, 32 bit PowerPC NetBSD has pygame's latest 2.6.0 release available. The only adjustment I had to make to get it to run on the iBook was to disable GLX in my xorg.conf.

The Desktop Environment

Don't expect miracles. There will be no 3D and no GPU or acceleration due to older video cards not being as well supported. Gnome or KDE, while available, won't run at all. XFCE runs OK, but is rather slow.

NetBSD ships with CTWM by default which is very small, basic, and fast, but still quite usable.

CTWM

I opted for i3 which is a dynamic tiling window manager.

The Editing Environment

Why Vim of course! I use that plus The Ultimate vimrc which provides a lovely, pre-built, and capable Vim environment so I can just get to work and stop messing with my configs! The biggest advantage of Vim for this use case is it's every bit as powerful as larger editors like Visual Studio Code but runs with a mere fraction of the resources.

What Kind of Game?

Kind of like a geometric puzzle game meets Dominoes where scoring is based on volume and symmetry. It is called "Slantics". I can't take credit for the concept. That goes to my buddy Rick. Here is my source code for it. Here is a tiny sample of what it looks like.

Slantics

And here it is running on Brick!

iBook G4 Running Slantics

Conclusion

Just because a computer is old does not mean that it's trash. It also does not mean that it can't run more modern software even if in a more limited fashion. In the case of this computer, it's gorgeous and a joy to code on and deserves to be used for something enjoyable.

Thank you for reading!