Macintosh 68060 Redux

zigzagjoe

Well-known member
Presenting the first time a Macintosh has booted natively on a 68060, to the extent of my knowledge.


Source for the ROM modifications and supporting documentation may be found here.

This has been floated many a time but I believe this is the first time a 68060 has actually booted Mac OS outside of an emulator. @ivelegacy some years ago modified a LC475 ROM in order to boot Linux directly but this came at the expense of being able to boot as a Macintosh. I wanted to replicate something similar; enough to boot NetBSD or Linux natively to play with the 060 as I've no interest in getting an Amiga.

@stepan has an open source design for the 68040 to 68060 socket adapter which can be found here. He also has a nice series of blog posts about building them. It's a clever design but definitely not for the faint of heart to build. This adapter also uses the handy CLKEN function of the 060 to allow running the 68060 at twice bus speed. 66 mhz for my test machine.

1762288431710.jpeg1762288445152.jpeg1762288459618.jpeg

To make the software changes possible I designed the ISP-SIMM and ROM blinkensimm in late 2023 as I expected to need the ability to debug and rapidly iterate on ROM changes. The ISP-SIMM provides the capability to push a new ROM image in 10 seconds or so and the interposer serves to give both a visual indication of the CPU state and to allow capture of an execution trace with a logic analyzer. The ROM work I anticipated to be a pain so I've kind of let this project go by the wayside for a few years after proving I had basic code working on the 060.

1762285054099.jpeg1762286279277.png

A Quadra 650 will actually sad chime with a 68060 installed (hits an unimplemented instruction) which shows the ROM is at least trying to do something. Thankfully, apple provided mostly-complete ROM maps which indicate what function lives at what offset so it's possible to get an understanding of what is being accessed in ROM (and follow along in IDA) even as I can't see the exact state of the CPU with a debugger. I finally hooked up that LA a few days ago to begin capturing execution traces such as seen above.

So that does it for the hardware preqrequisites. Here's a quick recap of the major difficulties of using a 68060 in an existing 68040 system.
  1. 68060 uses 3.3V VCC, not 5V, though the IOs are 5V-tolerant
  2. 68060 uses IPL lines as configuration straps latched at reset for new features
  3. 68060 has a reduced integer and floating point instruction set
  4. Bus error stack frames have been changed significantly
  5. A whole mess of errata in early 68060 chips
  6. Lack of secondary supervisor stack pointer
1 & 2 are taken care of by the socket adapter. 5 & 6 we just have to live with, but happily don't seem to be an issue. 3 & 4 are the main challenges.

Motorola cut down some of the lesser used instructions in order to keep the die size under control. However, to remedy this they made available an ISP (Integer Support package) and FPSP (Floating point support package). These packages when installed to the appropriate exception vectors (and other integration tasks) give the 68060 nearly complete instruction set compatibility with 040 & 68882 from a user code perspective. The packages are provided as binary code with source for reference; they have a fixed entry point table and you provide a table of call-outs to your code for functions like reading/writing memory or soft exception handlers. The 040 introduced the concept of FPSP due to the differences between the 040 FPU and the MC68882, and the 060 is an extension to that concept.

So: The 040 FPSP package must be replaced with the new bigger 060 FPSP. The 060 ISP must be added to the ROM and added to the exception tables at appropriate times to handle most of the unimplemented instructions. These packages are happily in the public domain with Linux, NetBSD, and Amiga implementations out there to consult.

1762287085134.png

A significant miss in the emulated instructions above is the lack of the PTEST instruction. This is used to get the physical address used by hardware which corresponds to a virtual address (used by code); the 060 replaced it with the PLPAR/PLPAW instructions which perform the same function in a much more direct manner. It would be possible to emulate this - the motorola port guide mentions the existance of sample code for this - but for now I have modifications in the ROM-based cache flush routines to use the new instruction instead. It's a pretty rare instruction since you only need it when you need to deal with cache coherency; only the ROM/OS should deal with that instead of any user code.

The bus error stack frame for the moment I just hacked around, it's not properly implemented. As it sits this is just enough to boot an unmodified System 7.1 install on a 68060. There are many known issues that preclude any kind of actual use, it's a happy accident that it gets this far as it is. System 7.5 hangs during boot due to any number of possible causes.

I don't intend to go too much farther and it will probably never reach something that is complete & tested. If you have interest in finishing the job, please by all means go for it! :D

Just to re-iterate, though: This is in no way something that's practical to use, it is an experimental proof of concept only!!!

Thanks to @stepan for the socket adapter design, @Jockelill for supplying code to map 8MB of ROM space, and @rabbitholecomputing for sending me a couple of scrap 68060s to play with.

FAQs

Is it faster? How much faster?
- Yes. But it is too early to say definitively as implementation is incomplete and suboptimal. Seems to be 2-3x in CPU heavy benchmarks, but let's refrain from counting our chickens before they hatch.:)

It doesn't work, will you fix it? Will you be doing this for other ROMs?
- No.

Where can I download it? How do I use it?
-
Without offense, if you don't know the answer to these questions you probably aren't ready :) You will at a minimum need a CPU, CPU adapter, Quadra-compatible ROM SIMM, and means to program it.

Will you be building/selling adapters? Where can I get one?
- No. The adapter I used not my design to sell and it's also not fun to build. It's open source, good luck!
 

Powerbase

Well-known member
Take that Amiga nerds./s

I was just saying to myself there's nothing interesting going on in the classic Mac sphere at the moment. Thank you for this. Neat!
 
Last edited:

Nixontheknight

Well-known member
In your face, miggy nerds! Would be cool to see something like this be available for all non-PowerBook 68040 Macs, though I think that is a rather lofty goal
 

Phipli

Well-known member
Excellent work @zigzagjoe. Nice to see a proof of concept even to get this far.

What difference would using a 68LC060 make? Would it simplify things? Would it work (within current bounds) with the current hacks?
 

zigzagjoe

Well-known member
Excellent work @zigzagjoe. Nice to see a proof of concept even to get this far.

What difference would using a 68LC060 make? Would it simplify things? Would it work (within current bounds) with the current hacks?
It'd probably work, at least to the current degree that things are "working". This particular ROM IME is not well behaved with LC040 CPUs to begin with. 040LC crashes clockometer, for instance, and I've found that ROM always installs the 040 FPSP (potentially problematic). I am suspecting that SANE is not behaving correctly when an FPU-less CPU is present. I think the slightly different Centris 650 ROM behaves better.

I've heard that a 475/605 ROM will boot a wombat and certainly has runtime detection of the FPU presence for 040 CPUs; it'd probably be a better basis to work from if that behavior carries over to the wombat platform.
 

Nixontheknight

Well-known member
It'd probably work, at least to the current degree that things are "working". This particular ROM IME is not well behaved with LC040 CPUs to begin with. 040LC crashes clockometer, for instance, and I've found that ROM always installs the 040 FPSP (potentially problematic). I am suspecting that SANE is not behaving correctly when an FPU-less CPU is present. I think the slightly different Centris 650 ROM behaves better.

I've heard that a 475/605 ROM will boot a wombat and certainly has runtime detection of the FPU presence for 040 CPUs; it'd probably be a better basis to work from if that behavior carries over to the wombat platform.
620/630 roms probably also have FPU presence detection as well, as TattleTech apparently thinks the computer is a Quadra if a non-LC 040 is used
 

luRaichu

Well-known member
Presenting the first time a Macintosh has booted natively on a 68060, to the extent of my knowledge.

I applaud your choice of soundtrack :)
For those curious, the Motorola 68060 is roughly equivalent to the original Intel Pentium. Guess which one is more performant though
 

stepan

Member
Fantastic work, @zigzagjoe !

And all the jealousy on the Amiga pouring out in the answers here makes me giggle :) The fastest (working) Mac is still a 68060 Amiga ... Let's make sure we change that 😜
 

Byrd

Well-known member
So good to see the 060 that never was before PPC came into the fray - can't wait to see benchmarks and things like gaming FPS.

Understand there won't be too many examples in the field, with full 060 prices being so whacked now - even beyond the reach of Amiga users I feel!
 

zigzagjoe

Well-known member
Fantastic work, @zigzagjoe !

And all the jealousy on the Amiga pouring out in the answers here makes me giggle :) The fastest (working) Mac is still a 68060 Amiga ... Let's make sure we change that 😜
If anyone is willing to run Norton System Info 3.2 under Basilisk on an 68060 Amiga, I would appreciate it as a point to compare to.

It seems to get on with my crap cache dev board and exhibits the expected performance boost.... so if I can get branch prediction working at least clock for clock it should exceed emulation on Amiga :) until you start clocking to the moon or high speed local RAM anyways.

1762308589852.jpeg
 

eharmon

Well-known member
If anyone is willing to run Norton System Info 3.2 under Basilisk on an 68060 Amiga, I would appreciate it as a point to compare to.

It seems to get on with my crap cache dev board and exhibits the expected performance boost.... so if I can get branch prediction working at least clock for clock it should exceed emulation on Amiga :) until you start clocking to the moon or high speed local RAM anyways.

View attachment 92324
Double socket stack making me laugh. The bottom is just a riser?
 

Jockelill

Well-known member
It'd probably work, at least to the current degree that things are "working". This particular ROM IME is not well behaved with LC040 CPUs to begin with. 040LC crashes clockometer, for instance, and I've found that ROM always installs the 040 FPSP (potentially problematic). I am suspecting that SANE is not behaving correctly when an FPU-less CPU is present. I think the slightly different Centris 650 ROM behaves better.

I've heard that a 475/605 ROM will boot a wombat and certainly has runtime detection of the FPU presence for 040 CPUs; it'd probably be a better basis to work from if that behavior carries over to the wombat platform.
It sure does :). I'd say that is probably the best base for a "generic" 68060 ROM for 475/575/605/650/800. Also absolutely amaing work! Very scientific and analytic, not like the usual "quick fix" myself tends to lean on :D.

Do you know how much rom space the ISP and other things occupy? or more like "how big does the new rom needs to be"?

620/630 roms probably also have FPU presence detection as well, as TattleTech apparently thinks the computer is a Quadra if a non-LC 040 is used
Likely yes, only catch is that then you are limited to quite few machines. One benefit with the LC630 is that it's 32bit only by default, so you'd be free from dealing with potential 24bit issues. At least from my own rom disk hackings, the 24bit support has caused some isseus and the LC630 was one of the easier to get things working in.
 

Jockelill

Well-known member
If anyone is willing to run Norton System Info 3.2 under Basilisk on an 68060 Amiga, I would appreciate it as a point to compare to.

It seems to get on with my crap cache dev board and exhibits the expected performance boost.... so if I can get branch prediction working at least clock for clock it should exceed emulation on Amiga :) until you start clocking to the moon or high speed local RAM anyways.
I dub this picture "The Tower Of Power":
1762328762771.png
 

zigzagjoe

Well-known member
Double socket stack making me laugh. The bottom is just a riser?

Yep. My crap cache board is a minimum effort cache implementation for Q605/475 so it's rotated the wrong direction. It was a simple dev board so I could digest the DiimoCache 040 logic within a CPLD for my end goals but it worked for testing that the 060 works with external cache (@33mhz) too.

It sure does :). I'd say that is probably the best base for a "generic" 68060 ROM for 475/575/605/650/800. Also absolutely amaing work! Very scientific and analytic, not like the usual "quick fix" myself tends to lean on :D.

Do you know how much rom space the ISP and other things occupy? or more like "how big does the new rom needs to be"?


Likely yes, only catch is that then you are limited to quite few machines. One benefit with the LC630 is that it's 32bit only by default, so you'd be free from dealing with potential 24bit issues. At least from my own rom disk hackings, the 24bit support has caused some isseus and the LC630 was one of the easier to get things working in.

I'm of the opinion 32 bit only would be required anyways both for sanity's sake and limited addressing space for ROM in 24 bit mode. The updated ISP and FPSP adds about 60KB and currently it is beyond the 1MB boundary. I don't know how tight the ROM resource section is, but I doubt you'd find a large enough contigious block in the ROM code proper. The 040FPSP is dead code now so if it could be identified it'd probably be big enough for the ISP package - it's pretty small - but the 060FPSP is huge.
 
Top