Apollo Guidance Computer Gets The Rust Treatment

Seems like all the cool kids are rewriting legacy C programs in Rust these days, so we suppose it was only a matter of time before somebody decided to combine the memory-safe language with some of the most historically significant software ever written by way of a new Apollo Guidance Computer (AGC) emulator. Written by [Felipe], the Apache/MIT licensed emulator can run either ROM files made from the computer’s original rope core memory, or your own code written in AGC4 assembly language.

It’s worth noting that the emulator, called ragc, needs a bit of help before it can deliver that authentic Moon landing experience. Specifically, the code only emulates the AGC itself and stops short of recreating the iconic display and keyboard (DSKY) module. To interact with the programs running on the virtual AGC you’ll need to also install yaDSKY2, an open source project that graphically recreates the panel Apollo astronauts actually used to enter commands and get data from the computer.

Of course, the next step would be to hack in support for talking to one of the physical recreations of the DSKY that have graced these pages over the years. Given the limitations of the AGC, we’d stop short of calling such an arrangement useful, but it would certainly make for a great conversation starter at the hackerspace.

Thanks for the tip, [CJ].

8 thoughts on “Apollo Guidance Computer Gets The Rust Treatment

  1. I’d be very curious to hear from people doing active development in bare metal rust.
    I recently spent a week learning rust to potentially use it for quite a complex project.
    Unfortunately, even though the community is really amazing and extremely willing to help, I wasn’t really able to create a firmware solution split in multiple files/modules in an elegant manner. As most modules need to share in some way or another the hardware resources (GPIOs, interrupts), rust ownership model gave me some serious headaches (before someone mentions it, I extensively used mutex, refcells and options).
    I nearly had something perfect from my use until I hit the major roadblock that for speed reasons rust doesn’t allow borrowing of single functions inside a module (I needed that to call multiple functions from an interrupt).
    Looking online, when hitting that roadblock it seems most persons using RTIC (previously RTFM), with all the extra overhead that comes with it.

    1. Rust ownership actually solves a gaping design problem C has with HW.
      Compiler can track and prevent you from accidentaly using a nonatomic register or even just a nonatomic part of a partly atomic register from different interrupts or threads/tasks (without generating any code whatsoever until you want to really share the nonatomic part in runtime).

      Just read the Rust’s official manual for embedded systems.

Leave a Reply to phuzzCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.