Block device

Nicolas Rachinsky fbsd-stable-0 at ml.turing-complete.org
Sat Nov 8 05:55:38 PST 2008


* Scott Long <scottl at samsco.org> [2008-11-04 09:32 -0700]:
> 1. disk access in the driver layer still happens on a block basis.  It's
> true that to the application layer, the device has character dev
> semantics, meaning that arbitrary numbers of bytes can be accessed
> randomly without any restrictions.  But deep down inside the kernel,
> it's still doing block-by-block access.

Isn't it the other way round? It has character device semantics, thus
you cannot do reads and writes of arbitrary size on arbitrary
positions?

# dd if=/dev/ad4 bs=1 count=1
dd: /dev/ad4: Invalid argument

root at pc5 ~# dd if=/dev/ad4 bs=512 count=1 >/dev/null
1+0 records in
1+0 records out
512 bytes transferred in 0.000173 secs (2957966 bytes/sec)

Nicolas

-- 
http://www.rachinsky.de/nicolas


More information about the freebsd-stable mailing list