• 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.

m68040 optimized NetBSD 5.0.2 sets

johnklos

Well-known member
Hi, all,

NetBSD 5.0.2 just came out. If you'd like to run it on your '040 Mac but want it to run the best it can, I have made sets compiled with -m68040 optimizations. Things like ssh run faster since the compiler uses '040 specific instructions like 64 bit integer multiplies and so on. The difference between non-optimized and optimized on the same machine isn't significant (not nearly as significant as '060 optimization), but in general is good for around 5%, and we all know every bit counts.

The sets are available here:

ftp://ftp.mac68k.org/pub/NetBSD/5.0.2/mac68k-m68040/

Enjoy!

 

ChristTrekker

Well-known member
NetBSD 5.0.2 just came out. If you'd like to run it on your '040 Mac but want it to run the best it can, I have made sets compiled with -m68040 optimizations. Things like ssh run faster since the compiler uses '040 specific instructions like 64 bit integer multiplies and so on. The difference between non-optimized and optimized on the same machine isn't significant (not nearly as significant as '060 optimization), but in general is good for around 5%, and we all know every bit counts.
Is this the sort of thing that would be enabled (in pkgsrc) if using the USE_CPUFLAGS toggle? Honestly, I've never looked at CPU-specific optimization.

 

Bunsen

Admin-Witchfinder-General
'060 optimization
Hmmm....

Now it's been established elsewhere that there is no way, no how of getting Mac OS running on an '060, even if one can be fitted to a Mac. I believe it was danamania who got a Mac to partway boot with an '060 in an Amiga voltage adapter socket (fell over when the system started to load).

But could it be possible (I emphasise possible, rather than feasible or practical) to make it work with *BSD? If, perhaps, an adapter was fitted that retained the '040 for booting, and then handed off to the '060, in the manner of some PPC upgrades?

 

ChristTrekker

Well-known member
NetBSD on Macs still uses a Mac OS to bootstrap, since the hardware is simply built for booting into Mac OS.

You can, however, get other 060-based computers to run NetBSD just fine. I believe the old Amigas do.

 

ClassicHasClass

Well-known member
I think Bunsen is more referring to get-ups like the PPC upgrade cards. I'm sure it's technically possible; NetBSD has been made to work with CPU upgrades such as the Daystars (I used a 50MHz Daystar '030 as a NetBSD server for a bit before I stole the card for something else). I forget how easy or hard it is to worm an '060 into an '040 design, but I imagine it can be done if someone did the kernel tweaks needed.

Dang, that someone is a busy dude with all those projects we keep giving him or her ...

 

johnklos

Well-known member
The best way to run Mac OS on an m68060 is to run it under ShapeShifter under AmigaDOS. There are some definite advantages to running it on bare hardware. For instance, AmigaOS uses DMA and does other things (preemptive multitasking) while transfers occur, so when Mac OS is doing heavy disk, the CPU is mostly idle on the Amiga side. Disk access is also a lot faster. Other things are possible, too, such as running NAT under the Amiga TCP/IP stack to provide networking to the emulation, direct file transfer between AmigaOS and Mac OS, and so on. Add to that the ability to run whatever you like under AmigaDOS while running whatever you want under Mac OS on the same machine at the same time, and you'd probably agree that it's a pretty cool setup.

The only advantage to running NetBSD on an m68060 fitted to a Mac would be if one could be fitted to a Quadra 840av, and then only if it's true that it can take 512 megs as some people have said (but others have failed to confirm). The CyberStorm Mk III for the Amiga takes 128 megs and has 64 bit memory access for the m68060, so it's already pretty well endowed.

 

Bunsen

Admin-Witchfinder-General
If, perhaps, an adapter was fitted that retained the '040 for booting, and then handed off to the '060, in the manner of some PPC upgrades?
NetBSD on Macs still uses a Mac OS to bootstrap, since the hardware is simply built for booting into Mac OS.
Yes, hence the very sentence you are quoting. Boot to MacOS on '040, bootstrap to *BSD on '060.

 

Bunsen

Admin-Witchfinder-General
Thanks johnklos, I just read your above reply properly. It does seem like as far as practical and feasible goes, the best (or currently only) choice is an Amiga/060. For starters, it's known to work. Those systems are still pretty spendy though, right?

My question was more about the technical possibility of doing it, on a suitably voltage-adapted '060-in-'040, given dana's partial boot success, and my unfamiliarity with the intricacies of NetBSD bootstrapping.

 

johnklos

Well-known member
Well, one could probably make a QuadDoubler-type CPU adapter which adapts the 3.3 volt m68060 to the 5 volt motherboard, then make a reprogrammable ROM SIMM which loads m68060 specific exception handlers, initializes the m68060, and skips or redirects the parts of the real Mac ROM which are too m68040-specific.

There are plenty of examples of work out there which would help. NetBSD, for one, has lots of CPU initialization code, AmigaDOS has plenty of free m68060-enhancing software with source code (for instance, there are programs similar to CyberPatcher which rewrites emulated instructions as they're encountered so later emulation isn't necessary), and programs such as ShapeShifter can help with lots of places where the ROMs need to be patched or otherwise can't be used in order to run MacOS on an m68060.

If someone got a boatload of cheap m68060s and intended to sell them as upgrades for Quadras, it might be worthwhile. But for one or just a few, it's MUCH easier to get an Amiga on eBay and a decent m68060 accelerator.

 

Bunsen

Admin-Witchfinder-General
Thankyou, and apologies for thread derailment and the possible influx of "OMG we must build it!" replies

 

MidnightCommando

Well-known member
Well, one could probably make a QuadDoubler-type CPU adapter which adapts the 3.3 volt m68060 to the 5 volt motherboard, then make a reprogrammable ROM SIMM which loads m68060 specific exception handlers, initializes the m68060, and skips or redirects the parts of the real Mac ROM which are too m68040-specific.
... Imagine that. A Quadra 405 which kicks the pants off the early Power Macs performance-wise running system 7 ... and using the beating heart of one of the most advanced pure CISC microprocessors ever built!

I honestly suspect that NetBSD would be a waste on such a machine - System 7.6.1 all the way, or even A/UX! ;-)

I've got to wonder if the reason the Mac won't boot on 68060 is some sort of sanity check - "hrm, this processor doesn't have x, it does however do x, meaning this isn't a processor we know about, OMG NOT A MAC" or some such?

And of course now I'm wondering (idly, of course) if one could do this to an LC575 to get a 68060 running, which in turn would lend itself to the possibility of a... 68060 Colour Classic! ... The voltage regulator addon would need to be compact, but using modern SMT and tight assembly it wouldn't be hard to arrange that. Hell, as I recall they did it in little enough space with the Pentium Overdrives!

(p.s. thanks, I'll go grab those sets now.)

 

Anonymous Freak

Well-known member
What about the 300 MHz Freescale ColdFire?

It's a 680x0 derivative that is code-compatible enough with 68040 to allow use in Atari ST and Amiga clones...

Imagine a Color Classic fast enough to run 640x480 30fps modern codec video, while still using its original architecture? (Of course, that would require that someone write an MPEG-4 decoder for the 68k; which would be very limited use, since no "mainstream" 68k computer is anywhere near fast enough to decode it...)

 

johnklos

Well-known member
I honestly suspect that NetBSD would be a waste on such a machine - System 7.6.1 all the way, or even A/UX! ;-)
Why would you think that? NetBSD runs wonderfully on an m68060. Or are you saying that an m68060 is overkill for NetBSD?

A/UX isn't doable unless someone either finds the sources to recompile or wants to do a lot of binary patching to the kernel.

I've got to wonder if the reason the Mac won't boot on 68060 is some sort of sanity check - "hrm, this processor doesn't have x, it does however do x, meaning this isn't a processor we know about, OMG NOT A MAC" or some such?
Nope. The ROMs are the same for many models, and Apple didn't really care where they were run or on what hardware which is why programs like ShapeShifter and Basilisk could be made. They load real Mac ROMs into memory, patch some stuff, then run.

The simple fact is that the exception handlers would need to be loaded somehow, and the cleanest way to do that would be to patch the ROMs. Since Basilisk II is open source, anyone could get already working patches to Mac ROMs easily. Note that these patches would be useful for running Mac OS on an m68060, but not booting, since Basilisk II runs on top of an OS already booted on an m68060.

And of course now I'm wondering (idly, of course) if one could do this to an LC575 to get a 68060 running, which in turn would lend itself to the possibility of a... 68060 Colour Classic! ... The voltage regulator addon would need to be compact, but using modern SMT and tight assembly it wouldn't be hard to arrange that. Hell, as I recall they did it in little enough space with the Pentium Overdrives!
Physically, it wouldn't be difficult. The m68060 takes much less power at 50 MHz than an m68040 at 25 MHz, and the latest masks take even less (and can run at up to 100 MHz). An adapter board (which did exist for rapid prototyping of m68060 systems using m68040 boards) isn't complex, and there's plenty of room in a Quadra 1 meg ROM to add stuff, so it'd just take someone with some time, money, and interest.

(p.s. thanks, I'll go grab those sets now.)
Since 5.1 will be released any day now, I'm about to make some 5.1 m68040 optimized sets. I'll post a URL soon. I also have m68k pkgsrc binaries being built continuously using both a 66 MHz m68060 Amiga and a 50 MHz m68040 Mac...

 

johnklos

Well-known member
What about the 300 MHz Freescale ColdFire?
It's a 680x0 derivative that is code-compatible enough with 68040 to allow use in Atari ST and Amiga clones...

Imagine a Color Classic fast enough to run 640x480 30fps modern codec video, while still using its original architecture? (Of course, that would require that someone write an MPEG-4 decoder for the 68k; which would be very limited use, since no "mainstream" 68k computer is anywhere near fast enough to decode it...)
It'd be more reasonable to imagine someone adapting the Atari ColdFire-on-a-PCI card to make it load a Mac ROM and run MacOS than seeing one of those chips shoehorned into a real Mac. If it was possible to make an m68040 pin-compatible drop-in CPU card, it would've been done already. It is possible, but like the m68060, it'd need an updated & patched ROM.

 

MidnightCommando

Well-known member
Why would you think that? NetBSD runs wonderfully on an m68060. Or are you saying that an m68060 is overkill for NetBSD?
Neither. I'm saying that one of the core advantages of NetBSD is that it makes good use of older hardware while providing a modern, stable OS. With a 68060, you have enough raw power to throw at the problem that you can run a suitably contemporary Mac OS and it will be "snappy" - 7.6.1 on a 68060 would be Wicked Fast, 8.1 would probably also be quite respectable.

Note that these patches would be useful for running Mac OS on an m68060, but not booting, since Basilisk II runs on top of an OS already booted on an m68060.
It's quite possible they wouldn't be needed for the very first stages of booting. Bunsen mentioned that Danamania managed to get a 68060-proto-mac-thingy to start booting, and was successful up to the point where things started loading ... at which point it all went to hell in a handbasket. Basilisk II goes through the boot process itself - it does actually /boot/ the (emulated) Mac - if it can use a host 68060 that means that it has the capability to boot on the raw metal - and that the patching to make it work is already pretty much present.

What is a more worrying issue is software written in assembly for the 68020/30 or 68040 (or heavily optimised code from more modern compilers) - we already see some things that work on macs but not mac IIs because of the change, and while I've never personally seen a piece of software needing the '030 that won't run on an '040 my experience is limited, and it is feasible that such exists. Of course the 68060 is a 'major revision' - it breaks things (as we've noted) ... perhaps this could affect applications to an extent that Basilisk II hasn't patched to? I mean... it's not as though the entire Mac world uses an Amiga to run their Mac software ;)

Of course, there is one last resort that might be reasonable - shoehorn an Amiga into a LC580 case somehow - get that Genuine Mac Aesthetic and that Pure 68060 Power without all this messing around with ROMs and Exception Handlers and Traps *ducks* :cc:

 
Top