• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

Installing Debian 12 on 68040

eharmon

Well-known member
The *nix forum didn't have enough Linux in it, so I figured I'd give it a swing. I've got Debian 12 (yes, 12, the latest revision) running on my Quadra 650:

IMG_1638.jpeg
And shockingly, running pretty well! The boot process is a bit painful (5+ minutes), even running on a 68040 at 42MHz, but once it's booted it actually chugs along pretty good.

Combined with a pass through QEMU, it only takes a couple hours to setup.

The instructions are pretty long, so I've posted them up on my site if anyone wants to give it a go: https://eharmon.net/retro/macintosh/linux/

Feedback appreciated! I've run through everything but it's easy to miss stuff when you write it up.

I think there's some pretty fun extensions you could apply here, like mapping /boot to HFS to allow for cleaner updates, or mounting A/UX partitions to make it significantly more easy to futz with A/UX by having a local, modern *nix.
 

Phipli

Well-known member
That's impressive. 5 minutes boot is actually really fast! I've known OS9 machines take a couple of minutes to boot.
 

cgp

Active member
Very impressive but pretty silly :cool:

I too have a Q650 (@33MHz) and I run Debian 3.0 (Woody). That's much more retro and snappy: from a SCSI2SD it boots to console login in just under 2 mins. And it'll rebuild its kernel in about 150 mins. I also run NetSBD 3 and that's even snappier.
 

eharmon

Well-known member
That's impressive. 5 minutes boot is actually really fast! I've known OS9 machines take a couple of minutes to boot.
8 minutes actually, with another 30 seconds to boot the Mac itself. Still not awful:

Code:
Aug 27 04:12:01 sixfifty systemd[1]: Startup finished in 2min 29.670s (kernel) + 5min 41.452s (userspace) = 8min 11.122s.

I think there's something wrong with newer SCSI drivers though. The machine is fast (I mean, it's all relative), the disk is dog slow. I actually think it wouldn't be too much slower than Woody with some fixes.
 

rplacd

Well-known member
Interesting - have you had problems where apt refuses to use the CD as a repo? I know that Debian hardened apt a while ago to only work with repos that have a signed Release file, and the CD doesn't seem to have one.
 

Melkhior

Well-known member
And shockingly, running pretty well! The boot process is a bit painful (5+ minutes), even running on a 68040 at 42MHz, but once it's booted it actually chugs along pretty good.
Do you know if such recent Linux kernels (or some older version in older Debians) support SMP on the 68040? And do they require a FPU or not? I know NetBSD has some level of FPU emulation if you have an appropriate FPU-less '040 (i.e. not a XC680LC040), though not sure if there's some SMP there either...

Reason I ask - there's been 68030 homebrew supporting Linux before. and I was wondering about the feasibility of a SMP 68040V homebrew (FPU-less but 3.3V so easier to interface with 'modern' stuff) based around a recent FPGA that would handle, among other things, bus arbitration to implement SMP.
 

cgp

Active member
Do you know if such recent Linux kernels (or some older version in older Debians) support SMP on the 68040? And do they require a FPU or not? I know NetBSD has some level of FPU emulation if you have an appropriate FPU-less '040 (i.e. not a XC680LC040), though not sure if there's some SMP there either...
There's no SMP support in the m68k v2.2 kernel of Debian 3.0 and I'm pretty sure it hasn't changed subsequently. FPU is required for userspace (something I discovered before I added an FPU to my LC III).

NetBSD indeed has FPU emulation but no multiprocessor support.
 

demik

Well-known member
Interesting - have you had problems where apt refuses to use the CD as a repo? I know that Debian hardened apt a while ago to only work with repos that have a signed Release file, and the CD doesn't seem to have one.

You just have to use [trusted=yes] after the deb keyword and it will work with repos without signed Release file. That also work with FTP, but you also have to add Dir::Bin::Methods::ftp "ftp"; in apt.conf IIRC
 

Melkhior

Well-known member
There's no SMP support in the m68k v2.2 kernel of Debian 3.0 and I'm pretty sure it hasn't changed subsequently. FPU is required for userspace (something I discovered before I added an FPU to my LC III).

NetBSD indeed has FPU emulation but no multiprocessor support.
OK thanks! A bit annoying for me this combination of behavior, as in my head the design was 'Litex Soft-SOC with a real 68k'. However, Litex drivers (ethernet in particular) are in Linux but not in NetBSD... Also 68040-with-FPU are all 5V and more expensive due to higher demand.

SMP would be the last step anyway, it figures no-one bothered as I don't remember ever seeing (or heard report of) a working shared-memory SMP 680x0...
 

eharmon

Well-known member
Interesting - have you had problems where apt refuses to use the CD as a repo? I know that Debian hardened apt a while ago to only work with repos that have a signed Release file, and the CD doesn't seem to have one.
Yeah, though it can pull from the CD to install packages instead of downloading them, if they're listed in the network repos. But:
You just have to use [trusted=yes] after the deb keyword and it will work with repos without signed Release file. That also work with FTP, but you also have to add Dir::Bin::Methods::ftp "ftp"; in apt.conf IIRC
I'll add that to my instructions, thanks!
Do you know if such recent Linux kernels (or some older version in older Debians) support SMP on the 68040? And do they require a FPU or not? I know NetBSD has some level of FPU emulation if you have an appropriate FPU-less '040 (i.e. not a XC680LC040), though not sure if there's some SMP there either...

Reason I ask - there's been 68030 homebrew supporting Linux before. and I was wondering about the feasibility of a SMP 68040V homebrew (FPU-less but 3.3V so easier to interface with 'modern' stuff) based around a recent FPGA that would handle, among other things, bus arbitration to implement SMP.
No idea about SMP myself, but FPU emulation supposedly works. However, you need a mask without the famous LC SoftFPU bug: http://www.mac.linux-m68k.org/docs/faq.php#sec-4.5. So a 68040V should work.
 

rplacd

Well-known member
Bravo, this is very, very amusing. Thanks for getting this working; I have it working on QEMU right now, since I don't have enough RAM for my real machines. What's the dumbest, most anachronistic thing I could install?

A few things things I learned the long way the first time around, trying to get this working on macOS:
– If you're used to using other emulators, SheepShaver will work to move files on and off disk images compatible with QEMU;
– I've attached kernel/ramdisk files for both the installer and installed versions of Debian, in case you can't open ext4 filesystems;
– You'll inevitably have to increase the amount of memory allocated to Penguin.
 

Attachments

  • Debian mac68k 6.1.27-1 kernels.zip
    23.9 MB · Views: 9

eharmon

Well-known member
Bravo, this is very, very amusing. Thanks for getting this working; I have it working on QEMU right now, since I don't have enough RAM for my real machines. What's the dumbest, most anachronistic thing I could install?

A few things things I learned the long way the first time around, trying to get this working on macOS:
– If you're used to using other emulators, SheepShaver will work to move files on and off disk images compatible with QEMU;
Really this is standing on the shoulders of the 68k kernel and qemu giants. Fantastic work they’ve done to get this all supported.

Most anachronistic? A full Gnome install with all the bells and whistles works, theoretically. At least in qemu where you can pump memory up to 1GB.

How are you using SheepShaver for file transfer?
 

luRaichu

Well-known member
This is great. I'd like to get modern Linux/BSD running on a 68k Mac myself to see if I can get graphical framebuffer software like w3m, fbi/fim and Mutt to run (If you could, you'd be able to do many tasks on the modern Internet!). However, installing on real hardware seems like an involved process so I'd like to do some testing in Basilisk II before I make any commitment. Unfortunately Basilisk doesn't seem to fully emulate SCSI so I can't use HD SC Setup. I also tried QEMU but I never got it to work (on MacOS 10.13). So perhaps somebody can share a disk image with everything pre-installed?

Also, how feasible would it be to run modern Linux/BSD on 14MB of RAM? I'd like to try installing on a Powerbook 180 too, but it seems 14MB is not enough for Linux... So maybe an older version will be more feasible.
 

eharmon

Well-known member
Also, how feasible would it be to run modern Linux/BSD on 14MB of RAM? I'd like to try installing on a Powerbook 180 too, but it seems 14MB is not enough for Linux... So maybe an older version will be more feasible.
Unfortunately 14MB won't do. The kernel + ramdisk for modern Debian is larger than 14MB already, so you'd fail to boot. You might be able to use something very, very old like Debian 2 or 3, but that's 20 years old so I wouldn't call it modern ;) .

That said it's abundantly possible to get Linux to work on 14MB, but only by building it yourself with something like https://buildroot.org/.
 

Snial

Well-known member
This is great. I'd like to get modern Linux/BSD running on a 68k Mac myself to see if I can get graphical framebuffer software like w3m, fbi/fim and Mutt to run (If you could, you'd be able to do many tasks on the modern Internet!). However, installing on real hardware seems like an involved process so I'd like to do some testing in Basilisk II before I make any commitment. Unfortunately Basilisk doesn't seem to fully emulate SCSI so I can't use HD SC Setup. I also tried QEMU but I never got it to work (on MacOS 10.13). So perhaps somebody can share a disk image with everything pre-installed?

Also, how feasible would it be to run modern Linux/BSD on 14MB of RAM? I'd like to try installing on a Powerbook 180 too, but it seems 14MB is not enough for Linux... So maybe an older version will be more feasible.
IMHO, it's kinda better to treat an old Mac as an embedded system, as though it was an ESP32 and then try to build up something linux-like based on the kinds of libraries it has, rather than trying to cut down a modern, desktop linux.

Or you could try something like Yocto, if it can be built for 68K.

 

eharmon

Well-known member
Unfortunately 14MB won't do. The kernel + ramdisk for modern Debian is larger than 14MB already, so you'd fail to boot. You might be able to use something very, very old like Debian 2 or 3, but that's 20 years old so I wouldn't call it modern ;) .

That said it's abundantly possible to get Linux to work on 14MB, but only by building it yourself with something like https://buildroot.org/.
Sometimes I create my own distractions...just built a 68k distribution with Buildroot and it's idling at 5MB, even with working networking. I'll whip up some instructions sometime soon.
 

joshc

Well-known member
At least in qemu where you can pump memory up to 1GB.

Not sure how much you've got in your Quadra 650, but it can handle more than 128MB.


 

Snial

Well-known member
Sometimes I create my own distractions...just built a 68k distribution with Buildroot and it's idling at 5MB, even with working networking. I'll whip up some instructions sometime soon.
When you say working networking, are you using lwip, µIP, something else or a standard desktop library?
 
Top