Hi mate, Sounds like your 40gb hdd could be on its way out and has corrupted some OS files, hence the blue screen.
As the above post suggests your 1st move should be attempting a CHKDSK (checkdisk). You can run this from the windows XP install CD. This can pften recover bad parts of the...