For the CD drive, I'm not sure what you mean by "not showing up" but if you put a disk in the drive, and the computer does not recognize it, then what operating system?
The battery, is defective. The operating system as you have described is corrupted, black screen until restarted.
sounds like the best solution is to have HP repair it or replace it. It's going to cost some bucks to replace the battery and reload the operating system.