Patent ID: 7171607

Claim:
A storage controller for controlling, in accordance with a read/write command from a host, reading of data from a recording medium or writing of data to the recording medium, and transfer of read data or write data to or from the host, comprising: an error correction code generator which generates an error correction code in accordance with data to be written to the recording medium, the error correction code being attached to the data; an erasure pointer memory which stores pointer information indicative of a location at which an error exists, the error being contained in data read from the recording medium; an error correction circuit which corrects the error in the data, read from the recording medium, by erasure correction and random correction, using the error correction code attached to the data and the pointer information stored in the erasure pointer memory; an inhibition circuit which inhibits the error correction code generator from attaching the error correction code to data to be written to the recording medium, when a special write command from the host is executed; and a programmable erasure pointer generator which sets, in the erasure pointer memory, special pointer information indicating a location as an error location, in accordance with an erasure pointer setting command from the host, the location being designated by the erasure pointer setting command, the special pointer information set in the erasure pointer memory being used by the error correction circuit to correct an error in data written to the recording medium by executing the special write command, and read therefrom in accordance with a normal read command from the host.