The Apollo Guidance Computer had only 2k RAM and 32kb storage.
Also what O.S. did they use, and who made it?
The equations required for flight to the moon are not all that complicated, particularly given that much of the work was done by larger computers based on the Earth. Some of the computer programs (e.g. P40-P42) run on the Apollo guidance computer simply calculated what direction to point the ship and how long to fire the engine in order to achieve a change in course called for by Mission Control. Others (e.g. P51, P52) computed what the current orientation of the ship was based on what direction various stars were found.
The hardest real-time problem solved by the Apollo computers was probably the landing guidance itself -- pointing and throttling the engine on the Lunar Module over the course of several minutes in order to reach the surface of the moon at a low speed. The central equations for this guidance are not complex at all:
In fact, you could compute one iteration of the guidance loop by hand in a few minutes. The computer was fast enough to run the loop ten times a second, which was more than sufficient to control the lander.
The software was developed by a team at MIT led by Margaret Hamilton, whose work advanced the state of the art of software engineering significantly. The software was based around a simple real-time scheduling kernel for which "operating system" might be too grand a term.
Modern operating systems provide a vast array of complex facilities to software, most of which aren't needed by any single program. With no graphical display, audio output, network connection, disk I/O, support for software written for legacy systems, etc. it's not that difficult to keep a complete system in a few kilobytes.
You can read the assembly source code itself here. The EXECUTIVE module, for example, comes to about 500 lines of heavily-commented assembly, and the maneuvering subroutines P40-P47 come to about five times that.
I personally find the source code very difficult to follow, as the instruction set of the AGC has a very different flavor from that of the modern CPUs I'm more familiar with.