Please check Compaq 510 Hard Drive Native Mode Configuration in BIOS Setup.
1. GOTO BIOS ROM Setup by pressing F10 key on keyboard.
2. Goto Advanced Tab and select On Board Devices.
3. Change the Valeu of SATA Hard Drive Native Mode from Enable to Disable.
4. After Disable the value save and exit from BIOS Setup. and continue to boot from Windows XP CD.
This problem occurs when an application opens a lot of handles but never closes them. This has been seen when an application continually opens a registry key but never closes it. When the application is closed the system attempts to close all of the keys but runs out of system resources while doing it.
when the blue screen appears note down the infected file. It would be some crazy text eg. zpqfkmsipt5.sys (*.sys)
remove the hard drive and plug it as an external drive (you would need external drive casing IDA/SATA etc). If you try to search it in same system it wont show though you enable "show hidden files and folders"
Search for the file eg. zpqfkmsipt5.sys and delete it manually.
then put teh hard drive back in the original systems unit or notebook.
start it. I should work.
After this try to install an anti virus if you don't have it and scan system as precaution.