It is a fascinating topic!
1)Lets say the cd-reader encounters a bad sector on a data disk, now is the data “repaired” in the cd-rom hardware or by the software reading the cd-rom. In the same manner is the EFM encoding done in the cd-burner hardware or software
The first levels of processing (including EFM decoding, de-interleaving, and C1/C2 Reed-Solomon error-correction stuff) happen transparantly to your computer; it is normally done by a chip within the CDR player housing.
The computer then receives sectors of 2352 bytes of data. If your playing an audio CD, that’s it: these represent raw audio samples.
However, if the CD is a CD-ROM, we’re not done yet. In this case, another layer of error de-interleaving correction is performed that results in 2048 bytes per sectors of useful data. Although I am not an expert on how this “higher” level works, I am quite sure that this work is usually done by the operating system on the computer (specifically, the CD-ROM driver).
2)What happens if the error-checking is unable to repair a certain sector.
On the low level (the stuff that happens in the CDR player), the data is interpolated or (if the error is too bad) zeroed.
On the high level (2352->2048 bytes step), the problems are detected and will result in an ‘error’ result code from the driver to the application program.
3)Is there a way to copy damaged data off of a cd while simply leaving the damaged sections out.
There are ways to read the “raw” contents of CDs and CD-ROMs (including the errors). So the answer is yes.
There are some types of errors (very bad scratches) that make this impossible though. The laser can lose track of the signal track, in which case it has to re-synchronize. This can lead to gaps, of course.
4)When a damaged sector is found how exactly does a cd-reader “repair” that sector.
If you want to know it exactly you should consult the relevant standard (ECMA-130). This will presume you know quite a bit about the relevant mathematics concerning Reed-Solomon codes…
I know some of these questions may sound simple but I would appreciate any answers someone could give me. Thanks.
Hope this helps.