you can call up HP support or goto their website and order a restore CD. i would call them up even if you are not under warranty still. you must save your files to CD's, another harddisk, another partition/drive on the same local hard disk, floppies, zip, ect before you use the restore CD.
if you want to not lose your files without backing up data first you need to have a winXP operating system CD. install the OS and do not choose to format when installing, this will simply overwrite you OS files and leave all other files intact