Hello and welcome to Bleepingcomputer.
I am not sure if when you booted to the Windows XP cdrom if it was showing you how much space you have used or not.
It may have been telling you how space was used and what was left in case you planned on installing it on another partition.
I am thinking maybe that is why you feel it was not saying 40 Gb and only listed the used space as 8 GB.
If my theory is incorrect, you may want to first boot up the system and enter your BIOS setup utility and check to see if the drive or all drives are detected by the BIOS.
If you continue getting a problem, you may have to start your computer from the XP disk and choose repair.
Follow the instructions on the screen.
You may have to get to a command prompt and choose fixboot as one option or fixmbr.
There is a way to get windows XP to re-install its self without deleting anything on the hard drive.
I am hoping of course that you are not infected with a Trojan or boot virus. But before you can determine that, you have to be able to boot back into windows either by safe mode or real mode to do such a scan.
Edited by MrBruce1959, 13 July 2010 - 02:15 PM.