Retro Battestation: just received my 2002 Power Mac G4 Quicksilver

I just picked up a pretty good eBay deal on a 2002 Power Mac G4 Quicksilver. It was sold as working, and yes it does boot up and it did come with OS X 10.4.11 installed as advertised.

 

Inside, it looks almost new. When I recently took some old PC towers to the electronics recycling inside they looked like they’d accumulated 100 years worth of dust and god knows what. By comparison, for a 15 year old machine, this looks like it was kept sealed in a box for most of that time – it’s spotless with no dust in sight.

Clean!

It looks like it has 10.4.11 cleanly installed, but I also picked up a used OS X 10.4 Tiger DVD to do a clean install myself.

The DVD drive in the machine does not want to open. It whirs and clicks when you hold F12, but no go. I used the paper clip trick in the manual open hole on the front of the drive, it opens up and there’s nothing jammed in there, it just doesn’t want to open. I tried putting the DVD in there, manually closing the drive and then powering on, but it doesn’t spin up and read the disk.

By the way, on this Power Mac G4 Quicksilver, the DVD manual open hole is obscured by the front of the case, so the only way to get a paper clip in the hole is to physically remove the drive from the case to get access to the hole.

Given the issues with the DVD drive, I discovered that this machine will boot from a USB flash drive (there’s a discussion in this thread about all Intel Macs will boot from USB, but this feature apparently was supported on some G4 and G5 machines but apparently not all).

To install Mac OS 9 I copied the ISO from OS9Lives universal installer to a USB using Infrarecorder on a Windows 10 desktop, and holding down Option/Alt to get the boot menu, it shows the USB, and clicking on it starts to boot. I wasn’t sure about using the ‘Restore’ option on the OS9Lives universal installer, as it seems from the instructions that it wipes your partition.

 

 

Instead I’ve read in a few different forum posts if you just copy the ‘System Folder’ from an OS 9 image to the drive, along with ‘Applications’ (rename it ‘Applications (OS 9)’ if you’re dragging them to the same partition as OS X, if it’s a different partition then the name can stay as Applications).

 

Interesting that this just works – if you select the OS 9 System Folder as the Startup Disk in System Preferences, then when you reboot it just starts up.

To get a copy of the OS X 10.4 DVD onto a USB flash drive, I used Infrarecorder again to make an image, and then used ‘dd’ on my MacBook Pro to write the image to a flash drive.

I’m going to do a fresh install, but booting it up and looking around at what’s already on there, OS X 10.4 on a single PowerPC cpu machine, not a dual, and only 800Mhz with 512MB, performance is not bad, it’s pretty responsive. Both Tiger and OS 9 boot pretty quick (Tiger boots a few seconds faster which is surprising).

Quick observations:

  • Safari on OS X is terribly slow, practically unusable
  • Ten Four Fox on OS X is usable but sluggish on scrolling any page. Makes you appreciate how fast modern day machines are
  • Classilla on OS 9 is pretty snappy. Of the browsing options available, this is the better choice on this machine so far.

Next up I’ll be trying to boot from the image of the 10.4 DVD and doing a fresh install. More to come later.

Getting status from dd when writing disk images on MacOS

dd is a pretty useful tool for creating and writing disk images from a source to a destination, for example writing disk .img files to SD Cards for your Raspberry Pi (see here, and here).

The trouble is if you’re writing images that are several GB that can run for 20mins or so, you don’t get any feedback on the progress until it’s complete. Well turns out if you send a ‘kill -INFO’ signal to the PID of the process, it will output the current status of bytes written and bytes remaining. Found this tip here.

Serving static content, REST endpoints and Websockets with Express and node.js

I’ve yet to see a framework that is as simple as Express for developing REST endpoints. I’m experimenting with a React app that receives push updates from the server using Websockets. Is it possible to use Express to serve all the requests for this app: static content (the React app), REST endpoints and Websocket? Turns out, yes, and it’s pretty easy too.

Starting first using Express to serve static content:

This uses the static middleware for serving the static content.

Handling REST requests with Express is simple using the get(), post(), put(), and delete() functions on the Router. Adding an example for a GET for /status now we have this:

 

Next, adding support for Websockets, using the ws library. Incrementally adding to the code above, now we create a WebSocket.Server, using the option to pass in the already created HTTP server:

const wss = new SocketServer({ server });

At this point we add callbacks for ‘connection’ and ‘message’ events, and we’re in business:

This is the starting point for a React app to build a websockets client, more on that in a future post. The code so far is available in this github repo: https://github.com/kevinhooke/NodeExpressStaticRESTAndWebsockets