QEII Student IT
At startup, hold +S simultaneously, then when the code stops, type fsck -fy, this will run a hard drive repair. Hopefully it will repair your hard drive and you can type logout to boot up as normal.
If it does not work, you will need to try re-imaging your hard drive.
If that doesn't work, replace the hard drive.
I repeatedly had this issue after installing OSX 10.5 and then upgrading it to 10.5.8, eventually I realised that I had only 256MB of ram in the machine, so I swapped it for 1GB, and it booted up straight away. Also worth bearing in mind is that if one of the RAM slots has disappeared, as they do, this may leave you with only 256MB of RAM where you thought you had more! Another way to check what is happening is to boot while holding down Apple key and the letter 'V', this will boot the computer in verbose mode, which will allow you to see how far the machine has got, and if it has stalled.