Designing a Sheet in Interface Builder

Quick tip time! This is an anecdote from a libre project I’m working on, specifically Auctions.

One of the things I am doing right now is implementing the Cocoa/Mac UI. I’m writing a flow using sheets for signing in to accounts. I had a lot of issues making the sheet accept input; it just wouldn’t let any of its fields become the first responder.

Poking around DuckDuckGo, I found a Stack Overflow question that seemed pretty interesting, and the answer was to override NSPanel‘s canBecomeKeyWindow method to return YES. I did some searching around in Apple’s Developer Documentation to see how the system determines when a window can become a key window, and I found this nugget:

A window that uses NSWindowStyleMaskBorderless can’t become key or main, unless the value of canBecomeKeyWindow or canBecomeMainWindow is YES. Note that you can set a window’s or panel’s style mask to NSWindowStyleMaskBorderless in Interface Builder by deselecting Title Bar in the Appearance section of the Attributes inspector.

Apple Developer Documentation

I had turned off Title Bar in Interface Builder as I thought it should be disabled since the window would be shown as a sheet. I re-enabled Title Bar, and voila! The sheet worked perfectly, and did not have a title bar when displayed as a sheet.

Welcome to Windows 2000: The Athlon is Go

It has been a while since I have written an article about retrocomputing. In some ways, it feels weird to refer to Windows 2000 as retrocomputing. I used Windows 2000 as my go-to operating system for the majority of high school, well after Windows XP was released. And yet, it is now 22 years old.

I have a special affinity for Windows 2000 in my heart.  It’s the last version of Windows that has the true “classic” UI.  Windows XP and later do have “Windows Classic” themes, but they are still obviously tweaked.  It is new enough to run some software considered modern yet old enough to run many of the software designed for older Windows versions.  The NTVDM still supports 16-bit Windows 3.x apps, and I’ve had success running DOS applications on it as well.

But none of that can compare to the true reason I find Windows 2000 so comfortable.  Weeks before my grandfather died in 2001, he took me to his new office to show me where he worked.  He had a Windows 2000 workstation and let me unlock it and open some of his files.  It was the first time I used a computer running Windows 2000, and the last time I used a computer with him.

The Athlon: An introduction

I have a Compaq Presario 2100 laptop.  It is a surprising workhorse.  I bought one new, in 2003, and had it for many years – but I gave it away to a friend who needed a computer in 2010.  In 2019, I needed a 32-bit x86 system for testing Qt 5 and Firefox for Adélie, so I found a Presario 2100 on eBay in good condition for a good price.  It ran Adélie for a while, with Windows XP Professional in dual-boot.

This individual specimen has a 2.1 GHz Athlon XP, 1 GB RAM, and a 250 GB WD Blue disk.  It’s a perky little laptop, with enough oomph to play some great games (SimCity 4!  Midtown Madness 2!) and chomp through small builds.  The Presario 2100 is actually one of the systems I did OS development on back in the day, and I ran everything from NetBSD to Solaris to Windows Server on it at one point or another.

The only quirk I’ve noticed – which will be relevant later in this article – is that when booting Linux, the battery needs to be removed.  It doesn’t hold a charge, and the kernel’s ACPI module is angry and deadlocks if the battery is present during initialization.

Installing the Windows 2000.

I inserted my Windows 2000 CD and proceeded through installation.  It took over two hours to perform the “hardware detection” phase, which struck me as odd.  About 20 minutes in, I turned the system off and back on as I was hoping that would help it along.

The GUI was slow and nearly unresponsive. It took multiple seconds to draw simple controls. And installation, in all, took almost four days to complete. When restarting, it was very slow to boot as well. I was concerned there may be a fault somewhere – perhaps the CPU was failing. However, Windows XP still worked fine.

I used the debug logging facility of NTLDR and found it slowed when ACPI.SYS was loaded. I removed the battery and rebooted Windows 2000. It was instantaneous. As it turns out, the Windows 2000 ACPI driver was having the same issue as Linux. After upgrading to SP4, I was able to boot with the battery inserted without issue, so the issue has been worked around in a patch.

You’ve come a long way, baby.

The next step was installing the drivers for all of the hardware. The modem, network adaptor, and display adaptor were simple and worked just fine.

I installed the official Broadcom wireless drivers from HP’s Web site. It worked, but only supported WEP and WPA networks. My network is, of course, WPA2. I found this fantastic backport of the Vista driver to older Windows versions. I installed it, and then installed the Boingo Wireless client for a front-end. To my surprise, the laptop works flawlessly joined to a VLAN on my dd-wrt powered Linksys WRT3200ACM. This allows me access to some internal resources on my network – most importantly, a micro HTTP server on my laptop where I can stage patches and file downloads from the Internet.

Boingo Wireless, happily running WPA2 on Windows 2000

At some point, I do think it would be an interesting project to set up a proxy server and allow the laptop limited access to the real Internet.  It will require a lot of research to ensure full security.

And now for the fun!

So far, some of the productivity software I’ve installed includes Office 97, Office 2000, Visio 2002, Liquid Motion, and Crystal Reports.  In fact, this blog article has been written entirely on the Athlon in Word 2000.

For development, I’ve installed Visual Studio 6.0 Enterprise including Visual J++ 6.0.  I have some SDKs and tools that I would like to add, but I haven’t found a lot of time yet.  Some of the tools available in the Platform SDK may start to be useful to me soon.  I am definitely having strong ideas for software to write targeting these older platforms.

Games I’ve had success with include Hasbro’s Yahtzee, Chessmaster 7000, and Need for Speed: Hot Pursuit. Hoyle Solitaire from Sierra On-Line also runs flawlessly despite being a 16-bit game for 3.1 and even warning during setup that “Windows NT has not been tested”. The only game that gave me issue was Slingo. It crashes on startup, before the intro screen, and running the included DXDIAG gives a DirectDraw error.

Final thoughts.

This has been a blast to set up and I have been enjoying running this laptop again with the software from yesteryear.

This project has been everything that I had no longer felt with my other projects. Personal accomplishment, inspiration for future projects and ideas, and surprisingly, a significant amount of fun!

I am looking forward to writing some projects to enhance the retrocomputing experience for the community at large. Here’s to the future, with one paw still in the past.

Fixing a 20 year old laptop, part 1: We know what is working

Some of you may have noticed that I Tweeted a few weeks back about my trusted Pentium III laptop having some pretty massive failures.

I decided to drag it out last night and see how it was going. Maybe it could be better after a rest…?

Bug Check c0000218. Not better, but worse.

It had a new bug check, STOP 0xc0000218. The SOFTWARE registry hive, where Windows 2000 keeps its HKLM\Software keys, is now apparently corrupted. This is significantly worse than before, when it was randomly having Kmode exceptions during use.

I asked one of my retrocomputing buddies that knows a lot about older Windows versions — my mother — who suggested booting to Safe Mode and trying to defragment. Safe Mode runs only on the SYSTEM hive, so the SOFTWARE corruption isn’t an issue. Apparently sometimes Windows can get very angry if the SOFTWARE hive is fragmented, because it has to load entire sectors in the boot environment.

Safe Mode was not quite the joy I had hoped for.

Always a bug check in win32k.sys on this one.

I tried to boot the Windows 98 partition, wondering if perhaps it could at least serve as a sentinel of any hardware issues.

It claimed various system files were no longer present. It still seemed to work, other than some networking functions. I used ScanDisk, which found no errors in the FAT nor surface errors. Onward to the memory diagnostic. I used a Vista-era Windows Memory Diagnostics boot CD that I had laying around from 2008 and ran two passes of the basic test and a single pass of the extended test.

Succeeded!

No errors were found. Unfortunately, this leaves me in an unenviable place: from all I can tell, the hardware is fine, but multiple operating systems are failing to boot properly. Additionally, the computer refused to boot Windows install media at all.

At some point, I will pull my Windows XP laptop out and try to use WinDbg to find out what I can from the bug check screen. Hopefully I can remember how to do that. Until then, Erin (the Armada) will unfortunately remain unusable.

Really leaving the Linux desktop behind

I’m excited to start a new chapter of my life tomorrow. I will be starting a new job working at an excellent company with excellent benefits and a comfortable wage.

It also has nothing to do with Linux distributions.

I have asked, and been granted, clearance to work on open source software during my off time. And I do plan on writing libre software. However, I really no longer believe in the dream of the Linux desktop that I set out to create in 2015. And I feel it might be beneficial for everyone if I describe why.

1. Stability.

My goal for the Linux desktop started with stability. Adélie is still dedicated to shipping only LTS releases, and I still feel that is useful. However, it has made more difficult because Qt has removed LTS from the open source community, plainly admitting they want us to be their beta testers and that paid commercial users are the only ones who deserve stability. This is obviously an antithesis to having a stable libre desktop environment.

Mozilla keeps pushing release cycles narrower together, in a desperate attempt to compete with evil G (more on this in the next section). This means that the yearly ESR releases, which Adélie depends on for some modicum of stability, are unfortunately being left behind by whiz bang web developers that don’t understand not everyone wants to run Fx Nightly.

I think that stability may be the point that is the easiest to argue it could still be fixed. You might be able to sway me on that. There are some upstreams finally dedicating themselves to better release engineering. And I’ve been happy to find that even most power users don’t care about running the bleeding edge as long as their computer works correctly.

My overall hope for the future: more libre devs understand the value of stable cycles and release engineering.

My fear for the future: everything is running off Git main forever.

2. Portability.

It’s been harder and harder for me to convince upstreams to support PowerPC, ARM, and other architectures. This even as Microsoft and Apple introduce flagship laptop models based on ARM, and Raptor continues to sell out of their Talos and Blackbird PPC systems.

A significant portion of issues with portability come from Google code. The Go runtime does not support many non-x86 architectures. And the ones it does, it does poorly. PPC support in Golang is 64-bit only and requires a Power8, which is equivalent to an x86 program requiring a Skylake or newer. You could probably get away with it for an end-user application, but no one would, or should, accept that in a systems programming language.

Additionally, the Chromium codebase is not amenable to porting to other architectures. Even when the Talos user community offered a PowerPC port, they rejected it outright. This is in addition to their close ties to glibc which means musl support requires thick patches with thousands and thousands of lines. They won’t accept patches for Skia or WebP for big endian support. They, in general, do not believe in the quality of portability as something desireable.

This would be fine and good since GCC Go works, and we do have Firefox, Otter (which can still use Qt WebKit), and Epiphany for browsers. However, increasingly, important software like KMail is depending on WebEngine, which is a Chromium embedded engine. This means KDE’s email client will not run on anything other than x86_64 and ARMv8, even though the mail client itself is portable.

This also has ramifications of user security and privacy. The Chromium engine regularly has large, high-risk security holes, which means even if you do have a downstream patch set to run on musl or PowerPC, you need to ensure you forward-port as they release. And their release models are insanely paced. They rewrite large portions of the engine with significant, distressing regularity. This makes it unsuitable for tracking in a desktop that requires stability and security, in addition to portability.

And with more and more Qt and KDE apps (IMO, mistakenly) depending on WebEngine, this means more and more other apps are unsuitable for tracking.

My overall hope for the future: more libre devs care about accepting patches for running on non-x86 architectures. The US breaks up Google and kills Chromium for violating antitrust and RICO laws.

My fear for the future: everything is Chrome in the future.

3. The graphics stack.

I’ve made no secret of the fact that my personal opinion is that it would still, even today, be easier to fix X11 than to make Wayland generally acceptable for widespread use. But, let’s put that aside for now. Let’s also put aside the fact that they don’t want to work on making it work on nvidia GPUs, which represent half of the GPU market.

At the behest of one of my friends, who shall remain nameless, I spent part of my December break trying to bring up Wayland on my PowerBook G4. This computer runs KDE Plasma 5.18 (the current LTS release) under X11 with no issues or frameskip. It has a Radeon 9600XT with hardware OpenGL 2.1 support.

It took days to bring up anything on it because wlroots was being excessively difficult with handling the r300 for some reason. Once that was solved, it turned out it was drawing colours wrong. Days of hacking at it revealed that there are likely some issues in Mesa causing this, and that this is likely why Qt Quick requires the Software backend on BE machines.

When I asked the Wayland community for a few pointers at what to look at, since Mesa is far outside of my typical purview of code (graphics code is still intimidating to me, even at 30), I was met with nothing but scorn and criticism.

In addition, I was still unable to find a Wayland compositor that supports framebuffers and/or software mode, which would have removed the need to fix Mesa yet. Framebuffer support would also allow it to run on computers that run LXQt fine, like my Pentium III and iBook G3, both of which having Rage 128 cards that don’t have hardware GL2. This was also met with scorn and criticism.

Why should I bother improving the Wayland ecosystem to support the hardware I care about if they actively work against me, then blame the fact that cards like the S3 Trio64 and Rage128 don’t have DRM2 drivers?

My overall hope for the future: either Wayland compositors supporting more varied kinds of hardware, or X11 being improved and obviating the need for Wayland.

My fear for the future: you need an RX 480 to use a GUI on Linux.

4. Usability.

This is more of an objective point than a subjective one, but the usability of desktop Linux seems to be eternally stuck just below that of other environments. ElementaryOS is closest to fixing this, but there is still much to be desired from my point of view before they’re ready for prime time.

In conclusion.

I still plan to run Linux – likely Adélie – on all servers I use. (My fallback would be Gentoo, even after all these years and disagreements, if you were wondering.)

However, I have been slowly migrating my daily personal life from my Adélie laptop to a Mac running Catalina. And, sad as it is to say, I’ve found myself happier and with more time to do what I want to do.

It is my genuine hope that maybe in a few years, if the Linux ecosystem seems to be learning any of these lessons, maybe I can come back to it and contribute in earnest once again. Until then, it’s system/kernel level work and hacking POSIX conformance in to musl for me. The Linux desktop has simply diverged too far from what I need.