Re: has anyone installed 5.1 from a SCSI CD?

2003-09-30 Thread Terry Lambert
Peter Jeremy wrote:
 On Sun, Sep 28, 2003 at 06:14:25PM -0400, Sergey Babkin wrote:
 BTW, I have another related issue too: since at least 4.7
 all the disk device nodes have charcater device entries in /dev.
 
 'block' vs 'character' has nothing to do with random or sequential
 access and any application that thinks it does is broken.  Any
 application that directly accesses devices must understand all the
 various quirks - ability to seek, block size(s) supported, side-
 effects of operations etc.

As opposed to the kernel understanding them, and representing the
classes of devices uniformly to the user level software.


 Yes, block devices must be random access,
 but character devices can be either random or sequential-only
 depending on the physical device.

But character devices can't be random-only.  Therefore, you
can assume the ability to perform random access on block devices,
and you can assume character devices require sequential access,
and your software will just work, without a lot of buffer
copying around in user space.


 The only purpose for block devices was to provide a cache for disk
 devices.  It makes far more sense for this caching to be tightly
 coupled into the filesystem code where the cache characteristics
 can be better controlled.

Actually, there are a number of other uses for this.  The number
one use is for devices whose physical block size is not an even
power of two less than or equal to the page size.  The primary
place you see this is in reading audio tracks directly off CD's.

Another place this is useful is in the UDF file system that Apple
was prepared to donate to the FreeBSD project several years ago.
DVD's are recorded in two discrete areas, one of which is an
index section, recorded as ISO9660, and one of which is recorded
as UDF.  By providing two distinct devices to access the drive,
it was possible to mount the character device as ISO9660, and
then access the UDF data via the block device.  Again, we are
talking about physical block sizes of which the page size is not
an even power of 2 multiple.

Another use for these devices is to avoid the need for some form
of intermediary blocking program (e.g. dd, etc.) for accessing
historical archives on tape devices.  Traditional blocking on
tape devices is 20K, and by enforcing this at the block device
layer, it's possible to deal with streaming of tape devices without
adding an unacceptable CPU overhead.

Another issue is Linux emulation; Linux itself has only block
devices, not character, and when things are the right size
and alignment, the block devices pass through and act like
character devices.  However... this means that Linux software
which depends on this behaviour will not run on FreeBSD under
emulation.

Finally, block devices serve the function of double-buffering a
device for unaligned and/or non-physical block sized accesses.
The benefit to this is that you do not need to replicate code in
*every single user space program* in order deal with buffering
issues.  There has historically been a lot of pain involved in
maintaining disk utilities, and in porting new FS's to FreeBSD,
as a result of the lack of block devices to deal with issues like
this.

I'll agree that the change has been mostly harmless -- additional
pain, rather than actually obstructing code from being written
(except that Apple didn't donate the UDF code and it took years to
reproduce it, of course, FreeBSD doesn't appear to have suffered
anything other than a migration of FS developers to other platforms).

On the other hand, a lot of the promised benefits of this change
never really materialized; for example, even though it's more
efficient in theory, Linux performance still surpasses FreeBSD
performance when it comes to raw device I/O (and Linux has only
*block* devices).  We still have to use a hack (foot shooting)
to allow us to edit disklabels, rather than using an ioctl() to
retrive thm or rewrite them as necessary, etc., and thus use
user space utilities to do the work that belongs below an abstract
layer in the kernel.

I'm not saying that FreeBSD should switch to the Linux model -- though
doing so would benefit Linux emulation, and, as Linux demonstrates,
it does not have to mean a loss of performance -- but to paint it as
something everyone agreed upon or even something everyone has
grown to accept is also not a fair characterization.

-- Terry
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: has anyone installed 5.1 from a SCSI CD?

2003-09-29 Thread Peter Jeremy
On Sun, Sep 28, 2003 at 06:14:25PM -0400, Sergey Babkin wrote:
BTW, I have another related issue too: since at least 4.7
all the disk device nodes have charcater device entries in /dev.

As of December 1999 - which is before 4.0-RELEASE.  This was well
advertised and discussed at the time.  Your objections are about
4 years too late.

That's very, very wrong. Even though there may be no difference
any more between the charcater and block drivers, the type of
device node still conveys the information about device types
to the applications. One case in point being a viewer application
(if anyone is interested, http://nac.sf.net ) which must handle
the sequential and random-access devices differently:

'block' vs 'character' has nothing to do with random or sequential
access and any application that thinks it does is broken.  Any
application that directly accesses devices must understand all the
various quirks - ability to seek, block size(s) supported, side-
effects of operations etc.  Yes, block devices must be random access,
but character devices can be either random or sequential-only
depending on the physical device.

The only purpose for block devices was to provide a cache for disk
devices.  It makes far more sense for this caching to be tightly
coupled into the filesystem code where the cache characteristics
can be better controlled.

Peter
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: has anyone installed 5.1 from a SCSI CD?

2003-09-29 Thread Sergey Babkin
Peter Jeremy wrote:
 
 On Sun, Sep 28, 2003 at 06:14:25PM -0400, Sergey Babkin wrote:
 BTW, I have another related issue too: since at least 4.7
 all the disk device nodes have charcater device entries in /dev.
 
 As of December 1999 - which is before 4.0-RELEASE.  This was well
 advertised and discussed at the time.  Your objections are about
 4 years too late.

Well, the previous version I installed was 4.0-snapshot
that did not have this change yet. Also it's never too late
to fix the broken things.

 That's very, very wrong. Even though there may be no difference
 any more between the charcater and block drivers, the type of
 device node still conveys the information about device types
 to the applications. One case in point being a viewer application
 (if anyone is interested, http://nac.sf.net ) which must handle
 the sequential and random-access devices differently:
 
 'block' vs 'character' has nothing to do with random or sequential
 access and any application that thinks it does is broken.  Any
 application that directly accesses devices must understand all the
 various quirks - ability to seek, block size(s) supported, side-

The random-access devices are seekable by definition. And the
OS interface is there to hide the block size issues.

 The only purpose for block devices was to provide a cache for disk
 devices.  It makes far more sense for this caching to be tightly
 coupled into the filesystem code where the cache characteristics
 can be better controlled.

What I'm saying is that it's good to have an easy way for
applications to distinguish the random-access devices from the
sequential-only-acces devices. Are they cacned internally or
not is not that much of an application's concern.

-SB
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]