Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Jun 1999 12:08:58 -0700
From:      "Justin C. Walker" <justin@apple.com>
To:        Wes Peters <wes@softweyr.com>
Cc:        Julian Elischer <julian@whistle.com>, Zhihui Zhang <zzhang@cs.binghamton.edu>, freebsd-hackers@freebsd.org
Subject:   Re: Accessing special device files
Message-ID:  <199906011909.MAA00780@rhapture.apple.com>

next in thread | raw e-mail | index | archive | help
> From: Wes Peters <wes@softweyr.com>
> Date: 1999-06-01 11:50:23 -0700
> To: Julian Elischer <julian@whistle.com>
> Subject: Re: Accessing special device files
> Cc: Zhihui Zhang <zzhang@cs.binghamton.edu>,  
freebsd-hackers@FreeBSD.ORG
> X-Accept-Language: en
> Delivered-to: freebsd-hackers@freebsd.org
> X-Mailer: Mozilla 4.5 [en] (X11; U; FreeBSD 3.1-RELEASE i386)
> X-Loop: FreeBSD.ORG
> Organization: Softweyr LLC
>
> Julian Elischer wrote:
> >
> > Bzzzt!
> >
> > On Tue, 1 Jun 1999, Wes Peters wrote:
> >
> > > Zhihui Zhang wrote:
> > > >
> > > > I write a small program to read/write each FreeBSD partition  
via special
> > > > device file names, e.g. /dev/wd0s2e, /dev/rwd0s2e, etc. I  
have two
> > > > questions about doing this:
>....
> >
> > I know this is confusing but you are 100% backwards..
> >  .....
>
> ???
>
> dd verifies the behavior you report:
>  ....
> The rwd device is clearly a character-special device, the wd device a 
> block special.  Character devices can always be read byte-at-a-time, 
> by definition.  When did the semantics of this change?

Don't let the name fool you.  The term 'character device' doesn't  
mean "byte-at-a-time".  It's just a name in opposition to "block  
device", which is buffered.  The real distinction is buffered (block)  
v. un-buffered (character), and even that's a bit blurry.

Raw (character) disk devices have always had this behavior.  Back in  
The Good Old Days, physio() actually worked direct to user buffers,  
so the rule was "block size and granularity", was dictated by a combo  
of what physio() and the device driver were willing to do.

Regards,

Justin

--
Justin C. Walker, Curmudgeon-At-Large *
Institute for General Semantics       |
Manager, CoreOS Networking            |   Men are from Earth.
Apple Computer, Inc.                  |   Women are from Earth.
2 Infinite Loop                       |       Deal with it.
Cupertino, CA 95014                   |
*-------------------------------------*-------------------------------*


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906011909.MAA00780>