Miniature Macintosh Plus Build

A few weeks ago I fell down the rabbit hole of vintage computing and I realized I thoroughly enjoy the idea of the challenge of getting old computers to either a) do things they can’t anymore or b) do things they were never intended to do. I also really liked the idea of learning how to develop software on these old platforms. The only issue for me is vintage computer restoration and maintenance has become very cost-prohibitive. So unless I was going to inherit an old computer from someone, I wasn’t really keen on buying old hardware off eBay in who knows what shape.

Oh wait, I did inherit an old Macintosh! This will be another project…

However, during my foray into the world of vintage computing, I discovered an Instructables page where someone had the genius idea of 3D printing a beige case and putting a Raspberry Pi + LCD into it to make it look like a tiny Macintosh. I must create this!

Hardware Build

The list of all the parts and supplies I needed for this build became longer than I originally thought it would, but here it is in its exhaustive glory. No, I don’t get any money from these links.

1x Raspberry Pi Zero 2 $20
1x 32GB Standard Size SD Card $12
1x 1kg Roll, Elegoo Beige PLA $20
1x 2.8″ Waveshare DPI LCD $45
1x 5 pack Barrel Jacks $7
1x 5V, 4A Wall Wart $10
1x SD to Micro SD Dongle $7
1x 10 pack Right Angle, Double Row Dip Headers $8
1x 8 pack Power Switch $10
1x 216 pack 3M Rubber Feet $7
1x Set of M2/M3 Assorted Screws and Nuts $12

Modifications

Back Case: Airflow, Power Jack, and Power Switch

The original build from the Instructables page exposes all of the ports of a Raspberry Pi Zero to the outside of the case. While this has its uses and the original CAD designer did a great job with the original model, I wanted to update it to allow for a more uniform experience with the final device. I wanted the device to have a dedicated power connector and a large clacky switch like all of the classic macintoshes have on them. I decided a barrel jack for the power source fit the bill, and it would be easy enough to create a small switched circuit that tied directly to the Raspberry Pi’s 5V power source rail which it normally gets from the USB Power port. I also modified the case to have air vents that somewhat matched the original classic Macintosh cases, which would also allow me to add a fan where Apple should have added a fan to the Macintosh Plus anyway.

Vents! Oh and the barrel jack and power switch mounting holes. I am not a fan of SketchUp…

Say No to the Ribbon Cable

The original Instructables build also suggests to purchase a somewhat large ribbon cable to connect the LCD and the Raspberry Pi which I decided was a massive waste of space in the small case. I modified this to use a right-angle, dual row DIP header so the Raspberry Pi will sit just behind the LCD and use the electrical header also as a mechanical support.

So much ribbon cable! I did not end up using this in the final build. Mostly because I was concerned about air flow.

Direct SD Card Connection

The removal of the use of the ribbon cable forces the Raspberry Pi board to be mounted along the back side of the LCD assembly. This change mandates that I cannot use the SD Card extension cable as it was originally manufactured, due to how far out from the side it protrudes.

Holy smokes the micro SD Card board sticks way out! I did not end up using this in the final build due to space constraints.

This modification took several iterations to figure out what would work. The original ribbon cable passed a ground net between

Let’s talk colors for a minute. When I say “vintage computer beige” we all kind of know what that means. It’s a yellow-y, tan-y, cream-y color, yes? Well not all PLA manufacturers think of “beige” as that color. I originally bought “beige” made by Hatchbox, which is NOT beige. My mother in law calls it “blush” in that it is very pink/peach in color without even a hint of yellow to it. So I ended up buying a whole other roll from Elegoo which is the correct beige for what I need. The link in the materials list above is for this correct Elegoo beige PLA.

Hatchbox Beige, left
Elegoo Beige, right
Yes, the Elegoo is the correct beige color.

Emulation

Before I began this build I had already been looking into emulating System 6 or System 7 on my Mac to try and learn how to write software for these old systems. I saw it as an opportunity to help keep these old development platforms alive.

Basilisk II emulating System 7.5.3 on my Intel MacBook.

I came across the tool Basilisk II which has been around for a long time and has a dedicated installer for macOS, which made this a fast and easy entry into old Macintosh System emulation. The download locations feel like a bit of a circular loop of links so here is the breakdown of files needed to get up and running with Basilisk II:

Basilisk II for macOS
Basilisk II Config GUI for macOS
Macintosh ROM Image
Boot Floppy Disk Image
System 7.5.3 Install Disks Image

Prior to booting for the first time, the Basilisk Configuration GUI is needed to be run to setup the system. What it does is create a .basilisk_ii_prefs file in the $HOME directory which contains all the emulation system configuration information such as what services to forward, how much memory to provide the system, what disks are mounted, etc. To boot, the emulation software needs the system ROM which I believe is a precursor in Apple’s history to the NVRAM on most modern Macintosh systems. The system then needs a boot floppy image to bring up the temporary OS. If I wanted to emulate a system with only a Floppy drive and no HDD, I could stop here. However, if it is desired to have a HDD in the emulated system, a set of system install floppy disk images is needed to then install the OS onto a HDD image. A full set of necessary files (sans the HDD image) can be found on my GitHub page here.

Let’s Talk ROMs

From what I can tell the ROMs on the classic Macintosh systems were used to run POST and initialize the CPU and RAM and then give the system enough information that it could boot from either the Floppy or a HDD. These ROMs were different sizes based on the system. They ranged in size from 128kB to a couple MB in size. Basilisk II, however, seems to only like 1MB ROMs. From my experience, they can be images from any of the classic Macintosh systems, as long as they are 1MB in size.

Nuances of Basilisk II

When the classic Macintosh systems first came out, the industry was moving from 16bit and 24bit operating systems and software to 32 bit operating systems and software. Similar to the change from 32 bit to 64 bit back at the beginning of the 2010s, the systems needed to still be backward compatible with older 16 bit or 24 bit applications, which is typical when architectural changes like this happen. No one wants to get a new computer and have absolutely nothing work on it because all the developers are still trying to port their applications to the new framework.

There is more nuance here than I care to dive into, but basically System 6 is a 24 bit OS and it cannot run through Basilisk II on a 32 bit or 64 bit host OS such as is the case with modern macOS.

Basilisk II attempting to boot System 6 which throws an error.

I have seen rumors that simply recompiling Basilisk II in 24 bit mode may be possible, but this is beyond the scope of this project. Maybe at a future time I will work on learning how it could be possible to run System 6 in Basilisk II.

Host System Setup

Swap Space

It seems there is an issue with 64bit Desktop Raspbian OS running on the Pi Zero 2 due to its limited amount of RAM, which in turn causes the setup to set the Swap Size to only 100MB by default. This will cause any actions with aptitude (the package management system) to fail. Therefore the swap size needs to be increased to the maximum of 2048MB.

# Turn off the swapspace while it is changed
sudo dphys-swapfile swapoff
# Edit /etc/dphys-swapfile
# Update the swapspace size from 100MB:
# CONF_SWAPSIZE=100
# To 2048MB (the max supported on the Pi Zero 2):
# CONF_SWAPSIZE=4096
# Setup the new swapspace
sudo dphys-swapfile setup
# Turn on the swapspace while it is changed
sudo dphys-swapfile swapon

Waveshare LCD Setup

The Waveshare LCD needs some kernel overlays installed on the boot disk and those overlays enabled in the Raspbian OS config file. Thankfully, all of this can be done before the system is booted the first time. Waveshare has a great Wiki page about the setup of this LCD.

Confusingly, Waveshare mentions the need to load six different kernel overlays in the config.txt file, but that is just not true. There are only at most, four overlays needed.

# Overlays needed to use the DPI Interface
dtoverlay=vc4-kms-v3d
dtoverlay=vc4-kms-dpi-2inch8

# Overlay needed to use the Waveshare display
dtoverlay=waveshare-28dpi-4b

# Overlay needed to use the Waveshare touch interface
dtoverlay=waveshare-touch-28dpi

In my case, I do not use the touch interface so I don’t even need to include the final line in the config.txt file.

Oddly, Waveshare doesn’t use standard overlay formatting, so the LCD cannot be rotated from within the config.txt file. Therefore, the system needs to be booted where the LCD will initially be in portrait mode, and the following needs to be added to the /etc/xdg/lxsession/LXDE-pi/autostart file:

xrandr -o 3

This is easiest to do through SSH since the LCD won’t need to be referenced while it is rotated.

Connecting Keyboard and Mouse

This is fairly straight forward from the terminal once I did it a time or two. There are always four steps to properly connect a device to the system: scan, pair, connect, and trust.

bluetoothctl

This opens a new prompt where other bluetooth controller commands can be entered.

scan on

This will show the MAC addresses for all devices that the system can detect along with a description of what the device is. Once the device is detected, the MAC address needs to be copied and the next three commands are run:

pair aa:bb:cc:dd:ee:ff
connect aa:bb:cc:dd:ee:ff
trust aa:bb:cc:dd:ee:ff

Now the device will be reconnected after the system reboots.

Building Basilisk II from Source

Building Basilisk II from source is similar to building any other Linux software from source. However, there are conflicting sets of commands strewn across the internet about how to properly configure the build. I finally stumbled unto this subpage of information whose section “Building BasiliskII and SheepSaver in Linux” contains the correct configuration command. The section, though, doesn’t include the final step, so here is the exhaustive set of commands to run:

git clone https://github.com/kanjitalk755/macemu
cd macemu/BasiliskII/src/Unix
NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-video=yes --enable-sdl-audio=yes --with-bincue
make
strip BasiliskII
sudo make install

Technically the –enable-sdl-audio=yes configuration is not needed as the DPI LCD uses all of the PWM pins on the 40pin GPIO header so the Raspberry Pi Zero couldn’t create audio even if it wanted to.

Seemless Integration

I originally created the Miniature Macintosh Plus system with a Raspberry Pi Zero (1st generation), where I attempted to simply boot the XFCE Desktop environment and run Basilisk II from within the Desktop GUI. This turned out to be ridiculously slow and more layers of GUIs than I wanted. I wanted the system to boot to terminal and then just launch the Basilisk II emulated system as if it were the emulated system. I also wanted the system to physically shutdown if the emulated OS was shutdown.

First, to disable the Desktop Environment, I had to modify the system configuration with raspi-config, sub menu 3 Boot Options, 1 Desktop / CLI. Selecting the option B2 Console Autologin will cause the system to boot up to the terminal with the default user logged in. Digikey has a great article about this configuration process.

Second, I needed to setup the X Server to run the Basilisk II emulator when invoked. The easiest way I found to do this was to modify the ~/.xsession file with a set of commands. The set of commands I placed into this file can be found on my GitHub page. These commands are run when the user executes:

startx

Finally, these two sequences can be tied together by simply adding the command startx to the bottom of the user’s ~/.bashrc file. Since this configuration file is run whenever a bash terminal is started, it guarantees the launch of the .xsession commands when the system finishes booting.

Final Result

It almost looks like a real Macintosh!

I installed a bunch of legacy software, including James Thomson’s Pcalc.

Leave a comment