68kMLA Classic Interface
This is a version of the 68kMLA forums for viewing on your favorite old mac. Visitors on modern platforms may prefer the main site.
| Click here to select a new forum. | | Running Linux on a PowerBook 180 | Posted by: demik on 2023-04-02 13:18:07 Hello everyone !
Introduction
This is more of a note. I wanted a Linux install on my lab PowerBook and had some success after a few tries so here is how it was done.
That thing even runs custom modern Linux kernel (6.1.22), which is the latest LTS kernel available as of now !
The issue with this PowerBook series, is that the PMU isn't really supported (no keyboard/ADB/Power), so you have to resort to either to a serial installation or bootstrap from another system. Had a few issues with install ramdisks as well (too little memory), hence why I did the bootstrap method
Due to the low memory ceiling on a PowerBook 180, I choose to install a Debian "Potato" 2.2. It's kinda old, but was released in 2002, so early Mac OS X era.
Requirements
This tutorial will require some sort of modern SD-Card based SCSI disk.
The setup used was:
- PowerBook 180
- System 7.5.5
- ZuluSCSI from @rabbitholecomputing
- RAM Module from @Siliconinsider
- 8-10 MB of RAM should work
A dual disk setup is are recommended. One for each OS.
Install System 7.1 or 7.5 on your first disk.
For Linux, a 500-600MB should be fine. I choose to emulate an old Quantum PD1800S (1.80 GB / 3517856 512-byte blocks)
Partition your second disk using "Apple HD SC Setup" 7.5.3 as follow :
- Macintosh partition, size ± 100MB
- A/UX root partition, size ± 300MB or more
- A/UX swap partition, size 28MB
- Other A/UX Misc partitions if needed (for /home, etc)
As seen under Linux
powerbook:~# mac-fdisk -l /dev/sdc
Disk /dev/sdc
# type name length base ( size ) system
/dev/sdc1 map Apple 63 @ 1 ( 31.5k) Partition map
/dev/sdc2 Dr43 Macintosh 32 @ 64 ( 16.0k) Driver 4.3
/dev/sdc3 HFS MacOS 204800 @ 96 (100.0M) HFS
/dev/sdc4 unix Root file sy 2097520 @ 204896 ( 1.0G) Linux native
/dev/sdc5 unix Swap 57344 @ 2302416 ( 28.0M) Linux swap
/dev/sdc6 unix Random A/UX 1158088 @ 2359760 (565.5M) Linux native
/dev/sdc7 Free Extra 8 @ 3517848 ( 4.0k) Free space
Block size=512, Number of Blocks=3517856
The drive is named "sdc" because it's the third SCSI Disk on this system
Install Penguin-19 on the HFS partition, along with linux kernels. Drive listing for reference:
- Penguin-19
- linux
- vmlinux-4.14.309-mac-backport+
- vmlinux-4.14.309-mac-backport+.gz
- vmlinux-4.4.302-dart
- vmlinux-4.4.302-dart.gz
- vmlinux-6.1.22-dart
- vmlinux-6.1.22-dart.gz
- vmlinuz-2.2.25-mac
- vmlinuz-2.6.8-mac
Bootstraping
For this step, you need to use your disk image with a 68k emulator running Linux (Aranym or QEMU), or use another 68k Linux install
I'm using Aranym, the powerbook linux disk image is hdb below. You will need debootstrap
• Create file systems and swap
aranym:~# mkfs.ext2 /dev/hdb4
aranym:~# mkfs.ext2 /dev/hdb6
aranym:~# mkswap -v1 /dev/hdb5
• mount the root file system
aranym:~# mount /dev/hdb4 /mnt
• Bootstrap using debootstrap the operating system
aranym:~# debootstrap --no-check-gpg potato /mnt http://archive.debian.org/debian
That's about it. You should have a basic system installed now. It needs some configuration
• Create devices files
aranym:~# chroot /mnt
aranym:~# cd /dev
aranym:~# MAKEDEV generic-m68k
aranym:~# exit
• Mount special devices, chroot again into your install and configure a few things
aranym:~# mount -o bind /dev /mnt/dev
aranym:~# mount -o bind /proc /mnt/proc
aranym:~# chroot /mnt
• configure fstab.
You need to configure fstab according to your system. here is mine for reference :
powerbook:~# cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/sdc4 / ext2 defaults,errors=continue 0 0
/dev/sdc5 none swap sw 0 0
/dev/sdc6 /home ext2 defaults 2
proc /proc proc defaults 0 0
/dev/fd0 /floppy auto defaults,user,noauto 0 0
/dev/cdrom /cdrom iso9660 defaults,ro,user,noauto 0 0
Setup hostname (files /etc/hostname and /etc/hosts)
powerbook:~# echo "powerbook" > /etc/hostname
powerbook:~# echo "127.0.0.1 powerbook localhost" /etc/hosts
Now it's a good time to add additional packages as well
powerbook:~# apt-get install sudo file minicom zsh ppp macutils mac-fdisk hfsutils nano
Edit your inittab file, add a serial console
T0:23:respawn:/sbin/getty -L ttyS0 57600 vt100
ttyS0 is the modem port, ttyS1 the printer port. Using the modem port is recommended. The hardware will go as high as 57600, use 9600 as a safe value.
Tweaking
A few tweaks are needed. Before rebooting, you may want to do the following changes
• securetty
Add ttyS0 and ttyS1 at the end of /etc/securetty. This will allow you to log as root using a serial console
Booting Linux
To boot Linux, you need to boot MacOS without virtual memory or similar (no RAM Doubler, etc).
Your PowerBook will also need to be in 32-bit mode. Force32 by @cheesestraws may help here
Launch Penguin, go to settings, select kernel, set up serial ports and put the the kernel command line. I'm using something like :
root=/dev/sdc4 elevator=noop
But you may want to add console=ttyS0,57600 if you want the boot serial console.
After a few moment, you should have the Linux prompt. Connect using your serial port (I had success using ClarisWorks and another Mac, or a modern Mac with an USB to RS232 cable and a RS232 to RS422 cable (Lindy 30249 from Amazon)
Penguin documentation is here http://www.mac.linux-m68k.org/docs/penguin.php
A few outputs and a photo
zulubook:~# uname -a
Linux zulubook 6.1.22-dart #1 Fri Mar 31 23:07:21 CEST 2023 m68k unknown
zulubook:~# cat /proc/hardware
Model: Macintosh PowerBook 180
System Memory: 14336K
zulubook:~# cat /proc/cpuinfo
CPU: 68030
MMU: 68030
FPU: 68882
Clocking: 31.5MHz
BogoMips: 7.88
Calibration: 39424 loops
zulubook:~# free -m
total used free shared buffers cached
Mem: 9 9 0 0 2 3
-/+ buffers/cache: 3 6
Swap: 27 0 27
Full dmesg
Spoiler content hidden.

Bottom line
I build a custom kernel for this (6.1.22-dart). You can also use the kernel build by Finn Thain here
The 6.1.22 is running very well on that hardware, given it's about 30 years newer. 4.14 is fine as well, 4.4 is slower for some reason and I cannot recommend older kernels as a log of bugs were fixed in recent releases.
If someone need that kernel or config file, just message me. | Posted by: cheesestraws on 2023-04-02 13:26:58 I'm actually a bit gobsmacked that 6.1.22 runs on it. Good stuff and a good writeup! | Posted by: demik on 2023-04-02 15:02:21
I'm actually a bit gobsmacked that 6.1.22 runs on it. Good stuff and a good writeup!
Thanks ! I was especially surprised by the low RAM usage 🙂 | Posted by: AndiS on 2023-04-02 15:02:49 This is pretty awesome. Debian Potato was the first Linux I installed (While I was happily running MacOS 9 and X). I installed it on a Performa 475 back around potato's release and took my first steps into this new World
Nowadays I use Linux exclusively and Macs are only a Nostiagia thing. But with Linux on M2 even this might change again ;-) | Posted by: cbmuser on 2023-08-07 05:08:44 Debian is also still providing updated installation images for m68k machines:
Downside is you will need sufficient amount of RAM for the current kernel configurations.
We're planning a small footprint memory kernel configuration in the near future though.
Adrian | Posted by: demik on 2023-08-08 14:40:00
Debian is also still providing updated installation images for m68k machines:
Downside is you will need sufficient amount of RAM for the current kernel configurations.
Running unstable on Aranym here. Should work fine on Quadra with enough RAM indeed. Thanks for your work ! | Posted by: luRaichu on 2023-09-20 13:02:07 Deleted, wrong thread | Posted by: lauland on 2024-02-13 12:56:55 I'm assuming the Aranym/qemu mkfs step is needed due to the kernel using endian-swapped filesystems (for speed), correct?
I've had Debian on a Performa 630 (with full '040 swapped for lc version) for years, so could build the filesystem there.
Would love to have linux on my 540, but, of course, no fpu... | Posted by: demik on 2024-02-14 12:28:41 Not really, it was because of two tho things :
- not enough RAM for the installer
- no ADB working.
As far as I know, ext2 is always written in little-endian. I used aranym because running m68k binaries was easier, you could probably have gone with any other old Linux host for that | Posted by: lauland on 2024-02-26 07:34:42 Ha! Showing my age. I actually contributed early fixes to the 1.x kernel for m68k, way back when it was new (on my Amiga). The first versions used a byte swapped filesystem for speed (I think?). I never checked that they'd switched to little endian (like everyone else).
Such a bummer that ADB doesn't work on (some) powerbooks. Wonder why it's been difficult...you wouldn't think the chips would be THAT different, and, although never officially documented, people could look at the working *BSD code to see how to do it.
It's possible it's just because there's so few m68k linux devs out there, and interest in the '030 powerbooks isn't high since they're slow, and memory is limited. If that's the case, it might be something like nobody's taken the time to figure out the correct interrupts or io ports. Not promising anything, but, once I get it actually running on my 180 with a serial console, it's something I can look into...I can build test kernels on my quadra.
I was trying to use the installer on the internal drive and running into all the problems you had...your awesome notes should help me get it going! | | 1 |
|