Gimbals used in Spaceships have three sets of three gyroscopes in the Inertial Measurement Unit. One for each axis (X, Y and Z).
Gimbal lock occured when all three gyros hit the limits of their ability to move within the sensing mechanism - they hit hard stops and stopped moving around.
These gyros provided the "platform" that was (and still is) referred to. It gives a stable reference to the vehicles position and attitude in all three dimensions.
In a normal situation, the gyros are aligned with the vehicle's local reference - +x being in the velocity vector, +z being in a radial vector pointing to the earth (for earth orbiting vehicles) and basically pointing downward (using the control panel for reference) in the Apollo CM, and +y being a right-handed compliment to the +x vector. Aligning the platform (the IMU's) was done at launch (to give an initial position) and at various times during the mission when the vehicles position is accuratly known. During AS-XII, the movement of the vehicle exceeded the normal rates for movement in the respective axis, and was nearly hitting the stops in the IMU.
The "eight-ball" was used for gravity-oriented flight parameters only. It was basically the same as the "eight-ball" flown on airplanes - that is - a gyroscopic platform which aligned to the local gravity field.