from Hacker News

Virtualizing the 6502 on a 6502 with 6o6

by goldenskye on 5/12/24, 2:00 AM with 28 comments

  • by vertnerd on 5/12/24, 11:39 AM

    > Here's the first of my bucket list projects I'm completing which I've intermittently worked on for literally two decades.

    This one hell of a bucket list you must have. Respect.

  • by userbinator on 5/12/24, 5:14 AM

    Despite how simple and limited the 6502 is, it's always interesting to see this almost 50-year-old architecture being stretched to new limits. 6502 cores are still found in some SoCs aimed at the ultra-low-cost high-volume market.
  • by andrea76 on 5/12/24, 9:27 AM

    Can it run GEOS in a GEOS window?
  • by varispeed on 5/12/24, 10:01 AM

    I had goosebumps reading it. I will have to read again and again... Amazing!
  • by sitkack on 5/12/24, 5:49 AM

    This post has been hanging out with no comments for ages. I was like, I'll skim it later.

    > It's almost burying the lede to announce that, though, because the real meat in this entry is how the Commodore 64 manages to emulate a very different 6502-based system. That piece is "6o6," for "6502-on-6502," and is a full virtualized software NMOS 6502 CPU that runs on a 6502 CPU — which I've open-sourced too. It has full control of guest code execution, including trapping undocumented and jam opcodes, and completely abstracts all memory access, making it possible to remap addresses, intercept illegal reads or writes, or even run entirely from virtual memory. On top of that, it's complete enough to not only pass a full functional test but also virtualize itself virtualizing itself:

    This is incredible! Not just from a 6502 perspective, but from an everything perspective! Amazing work.

    Also, it reminded me of this "The Zilog Z80 has a Protected Mode" https://www.youtube.com/watch?v=DLSUAVPKeYk posted to hn, but got no discussion.

  • by cobbzilla on 5/12/24, 3:29 PM

    This is amazing. It brings back memories of the first time I taught myself 6502 assembly, there was a book called “The Visual Computer” that came with an emulator on a floppy disk. It was very eye opening! I found a PDF of the book [1] but not sure if the software on the floppy survives anywhere.

    [1] https://files.commodore.software/reference-material/books/c6...

  • by drpossum on 5/12/24, 8:59 AM