you are correct there cyr, with just about every other imu you have to correct for offset and scale on all 3 accelerometer axis's first, then rotate in a random direction to build up a point map to correct the mag, then with both of those correct you can test for scale errors on the gyro (high pass filtering in the algorithms used generally mean there is no zero issue,

There calibration would be the zero correction for the accelerometer and gyros, which for a basic imu (only controlling roll and pitch) you could likely get away with,

When you dig deeper into the subject and tack on gps sources, barometers and optical flow meters, the equations become things that you will need to teach yourself university level math to start to crack :/.. (quaternions! and rotation matrices! )