Check to see all cables leading to the faulty CD drive are in firmly, including the motherboard connector. Check for dust as well.
If that fails, unplug your DVD drive and see if your faulty CD drive causes the restarts still.
If you have a spare IDE cable I would test that out, as well as tryin the drive in another computer if possible?
Assuming you have Windows XP: If the above fail to give any clues off, go into device manager (hold windows key down and press the PAUSE BREAK key once and click on hardware tab, then Device Manager ), and under DVD/CDROM drives heading, right click on the faulty drive, click uninstall and reboot.