2 years later..........!
4MOT/40000003: HDD 1221 error after eventually getting AHT to work from CD shipped with my imac (late-2009).
This followed 'kernal panic' and then looping grey screen - tried the full list of tips, hints before deciding to re-install Mavericks from the internet (cmd_r). Had taken full backup of disk using 'disk utility', but decided to just re-install OSX. Thankfully, a good choice as it doesn't reformat the disk and therefore all user data intact.
System back as normal (after many hours).
Then I ran AHT, which worked, resulting in the above error code.
I then read 'star studios'.
I took out a couple of 4GB memory chips (cheap ones) - ran AHT and this time no errors (imac at normal operating temperature) . Ran it again some time later to make sure.... again no errors (not from cold).
The upshot is, if you have non-Apple purchased RAM.....a) keep the original RAM if you've taken it out. b) can't trust AHT to report actual errors, so do the test with only Apple RAM installed. c) keep the CDs that arrived with the imac and remember also that the AHT is on the 'Applications CD' (it wouldn't work from 'cmd_d' or 'option_d').