iMac won't fully boot and gets stuck in a loop
I have a 2008 24" iMac (4GB RAM and 3mhz). It had Yosemite installed on it soon after it came out and worked fine. However a week or so ago it froze and wouldn't do anything, so I turned it off by pressing and holding the power button. I left it over night and unplugged it. Upon trying to re-start it i get the initial chime and a white screen, with a grey progress bar with the apple logo above it. About a quarter way through the progress bar I get a message saying
Your computer restarted because of a problem. Press a key or wait a few seconds to continue starting up.
Once I do that, it appear to shut down, screen goes black and the same process repeats. This will continue until i get bored and press and hold the power button down again.
Ive done an extended hardware test, which shows no issues.
What's happening and what can i do?
iMac (24-inch Early 2008), OS X Yosemite (10.10.1)