reading from devices in RAW mode
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines
Yeah, I like it when people have a full mouth of how gotos are for lazy folks (not even bothering to grasp the context of the discussion) and how they could teach masterclass C courses, then ask a total newbie question.
Is it such a newby question? Your suggestion of using dd is totally NOT what I meant: I want to read from devices with the devices ignoring their CRC-checks and such. Like what the CDROMREADRAW ioctl does for CD-ROMs.
Quoted 3 lines
Is it such a newby question? Your suggestion of using dd is totally NOT what I meant: I want to read from devices with the devices ignoring their CRC-checks and such. Like what the CDROMREADRAW ioctl does for CD-ROMs.
CD-ROMs, floppy disks, and hard disks work in completely different ways:
All modern forms of storage use powerful error correction below the sector level. Floppies are the exception here, they typically use MFM encoding, which is relatively straightforward.
Audio Compact discs use powerful error correction anyway, but CD-ROMs use some of the capacity which was previously used for audio data for a second level of error correction, so there are two sector sizes, (RAW, and COOKED). Reading RAW sectors, does not come close to allowing you to read individual pits and flats on the disc, it just lets you bypass the top level of error correction. The data is still being error corrected by lower layers.
There is no floppy or hard disk equivillent to reading raw sectors from CD-ROMs.
John.
Quoted 2 lines
Quoted 2 lines
Is it such a newby question? Your suggestion of using dd is totally NOT what I meant: I want to read from devices with the devices ignoring
their
Quoted 13 lines
Quoted 1 line
CRC-checks and such. Like what the CDROMREADRAW ioctl does for CD-ROMs.
CD-ROMs, floppy disks, and hard disks work in completely different ways:
All modern forms of storage use powerful error correction below the sector level. Floppies are the exception here, they typically use MFM encoding, which is relatively straightforward.
Audio Compact discs use powerful error correction anyway, but CD-ROMs use some of the capacity which was previously used for audio data for a second level of error correction, so there are two sector sizes, (RAW, and COOKED). Reading RAW sectors, does not come close to allowing you to read individual pits and flats on the disc, it just lets you bypass the top level of error correction. The data is still being error corrected by lower layers.
oh, ok. But I will still get more data back then with reading through the regular, say, /dev/hdc-device wouldn't I? As far as I know, read will only give you data when no I/O error occured.
Quoted 2 lines
There is no floppy or hard disk equivillent to reading raw sectors from CD-ROMs.
Really? Are you really sure about that?
Back in the old days, when I did assembly on my Atari ST, I would just say to the controller "gimme this and that track, in RAW" and it would do so. I thought that I could do that at least for floppy, not sure about harddisk (RLL through ACSI interface).
Quoted 4 lines
Quoted 2 lines
There is no floppy or hard disk equivillent to reading raw sectors from CD-ROMs.
Really? Are you really sure about that?
Using a standard PC floppy controller - yes.
Quoted 3 lines
Back in the old days, when I did assembly on my Atari ST, I would just say to the controller "gimme this and that track, in RAW" and it would do so.
Sure, you can do it on the Amiga as well, but not on a standard PC floppy controller.
Quoted 2 lines
I thought that I could do that at least for floppy, not sure about harddisk (RLL through ACSI interface).
Well, you can probably do it with ST-506 interface hard disk, because the data that goes in to that is more or less directly fed from the head-amp, which is partly why it was so sensitive to cable length. The closest you could probably get with any modern device would be "read sector foo, and return data even if ECC appears to have failed".
John.
Quoted 5 lines
Quoted 2 lines
I thought that I could do that at least for floppy, not sure about harddisk (RLL through ACSI interface).
Well, you can probably do it with ST-506 interface hard disk, because the data that goes in to that is more or less directly fed from the head-amp, which is partly why it was so sensitive to cable length.
Those were the times :-)
Quoted 3 lines
The closest you could probably get with any modern device would be "read sector foo, and return data even if ECC appears to have failed".
And that's exactly what I want!
(for the situations where the bad data starts, say, halfway the sector)
Quoted 6 lines
Quoted 3 lines
The closest you could probably get with any modern device would be "read sector foo, and return data even if ECC appears to have failed".
And that's exactly what I want!
(for the situations where the bad data starts, say, halfway the sector)
You'd have to ask the IDE and SCSI subsystem people for programming information about how to do that for disks.
The problem is that as far as I know, if the ECC doesn't work, you won't end up getting back back more or less intact data, with just a flipped bit here and there.
I'm not sure exactly how it works, but the basic theory is something along these lines:
Suppose you are storing 5 data bits using 10 actual bits on disk.
Typically, you might expect a read to read to return 8 bits accurately and 2 bits inaccurately. That's enough to re-construct the data. When 6 bits are read inaccurately, an un-correctable error occurs. Retrying the read might succeed, because only 4 bits might be read inaccurately the second time.
Although reading without using error correction will allow you to access the unreadable data, is quite likely to return some of the 5 data bits incorrectly, which could have been corrected, incorrectly.
I hope that explaination is of some use - maybe somebody else can improve it.
John.