Running a Neural Network on a Mac 128K

KenDesigns

New Tinkerer
Sep 7, 2025
4
14
3
Hello all, my first post here. I have been working on a small project where I tried getting a neural network to run (performantly) on the original Macintosh line, including the original 128K (which was a pain). You can try out the booter disk image for it, which I have uploaded here: https://github.com/KenDesigns/MacNIST68000

Please read the README carefully as there are some gotchas for running it ;)

I've also made a YouTube video here where I go over how I managed to go about it, and the challenges that needed to be solved here:

Please excuse the cringe thumbnail, that's just how its gotta be on YouTube...

Feel free to ask any questions :)
 

KenDesigns

New Tinkerer
Sep 7, 2025
4
14
3
Ken, I just finished watching your video and I must say, you have a truly brilliant mind. Absolutely ingenious!

@frontein1 and @David Cook , you two gentlemen might find this work intriguing as well!

Note that the SNOW emulator mention is found here:

Thank you for the kind words :)

If you like this, I have some good news, this is just the beginning of the tom foolery I have planned for these original Mac models. I have some stuff cooking right now (including a much larger and perhaps more interesting AI model) you may enjoy.
 
  • Love
Reactions: JDW

KenDesigns

New Tinkerer
Sep 7, 2025
4
14
3
the math was way WAY over my head, but basically you're running it like a game console, boot loading one app to take advantage of the whole machine?
Yep! That's correct! When this app is running it is the only thing on the machine, there isn't even an operating system in the way like normal.
 
  • Like
Reactions: Dave928

KenDesigns

New Tinkerer
Sep 7, 2025
4
14
3
so would it be possible to make a bootloader that would load any app all my itself, without the OS?
I can confirm it is possible! It is what I had to do to write this program (and is an integral part of the SDK I am developing which I used to write it). If you start any of the apps I've written so far and see that loading screen with the rolling fuzz, that is the boot-loader itself! Apple included some provisions that let you load a tiny bit (like less than 1KB) of code to arbitrarily run early in the boot process. The intention I think was to then use the parts of MacOS that are ROM resident (like the floppy driver) to then bootstrap yourself to do whatever.

I personally had set a challenge though to explicitly avoid using or depending on any ROM code, so I ended up writing my own tiny floppy driver to cram into that tiny less than 1KB chunk. Was a huge PITA since the floppy "controller" (the IWM) in these machines are a notoriously difficult part to interface with, and to make matters worse, I wanted to remain compatible with standard Macintosh floppy sector encoding which is another somewhat difficult thing to parse (and ate up alot of my precious code space to do).

In the end though, it worked out well I think! Also, its not just apps this boot-loader can load. Not to spoil any future projects, but I have managed to load some alternative operating systems as well, but more detail on that will come in the future ;)
 
  • Like
Reactions: Dave928