tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: DIOC{G,S}STRATEGY not implemented for all disk devices



On Mon, Jan 28, 2008 at 12:10:39PM -0800, John Nemeth wrote:
> On May 14,  9:15am, Gary Thorpe wrote:
> } > On Jun 19,  3:10pm, Reinoud Zandijk wrote:
> } > } On Wed, Jan 16, 2008 at 10:21:27PM -0800, John Nemeth wrote:
> } > } > } There seem to be several almost-identical implementations, in
> } > } > } sys/dev/dksubr.c, sys/dev/ld.c, and sys/dev/ata/wd.c; an 
> implementation
> } > } > } in sys/dev/scsipi/cd.c that always returns EIO; and implementations 
> in
> } > } > 
> } > } >      I'm not sure it makes sense for cd.c since that is a read-only
> } > } > device and isn't truely random access.
> } > } 
> } > } I have code here for cd.c that actually permits setting the strategy; 
> not 
> } > } used anymore though but for dvd+rw/dvd-ram its a truely random access 
> } > } device allthough it wouldn't be fast.
> } > 
> } >      Do these devices work using concentric cylinders similar to the
> } > way magnetic media works, or do they use the one long spiral track the
> } > way most optical media (and old vinyl records) work?
> } 
> } Optical disks are...disks. The last time I read up on them, they did
> 
>      Just because they are flat and round does not mean that they work
> like every other device that is flat and round.
> 
> } indeed support random access (all have seek times that are far below
> 
>      More like quasi-random access.  Magnetic media organises data in
> concentric cylinders with each level of the cylinder being a track that
> is divided into sectors.  To seek, you move the heads to the
> appropriate cylinder, select the appropriate head, and wait for the
> appropriate sector to appear under the head.  Optical media such as CDs
> and (most?) DVDs use a single spiral groove similar to old vinyl
> records.  To seek, you would have to move the head to position shortly
> before where you expect the sector to be, wait until you are properly
> aligned with the track, then follow the track to the desired sector.
> It is not something that is designed for true random access (remember,
> it was originally designed to play music and then was adapted to
> data).

How exactly does that matter? You seek, and then wait up to one head 
rotation. Sounds the same as a hard disk. The one difference I could see 
is that you might have more chance of missing the track, but I suspect 
that modern hard disks have the same issue too.

The biggest issue I see with making CD random access slow is the fact that
CDs are CLV, not CAV. That's Constant Linear Velocity, not Constant
Angular Velocity. That means that the speed of the disk under the optical
head stays the same, not the rotational speed of the disk. So if you seek
from the inside to the outside such that your radius around the disk
doubles, the whole disk has to halve its rotational velocity. Changing the 
speed of the whole CD makes disk head seeks seem fast. :-)

You could play games in the control electronics and mimic CLV with a CAV 
disc assembly (rather than change the speed of the disk to keep the disc 
under the optics at a constant linear speed and thus your data transfer at 
a constant electrical frequency, you could linerarly change the data clock 
rate). I however don't know if anyone does this.

Take care,

Bill

Attachment: pgpVpG8U08R3i.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index