From owner-freebsd-hackers Tue Jun 1 12:11:45 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mail-out2.apple.com (mail-out2.apple.com [17.254.0.51]) by hub.freebsd.org (Postfix) with ESMTP id 5E022151CF for ; Tue, 1 Jun 1999 12:11:36 -0700 (PDT) (envelope-from justin@rhapture.apple.com) Received: from mailgate1.apple.com (A17-128-100-225.apple.com [17.128.100.225]) by mail-out2.apple.com (8.8.5/8.8.5) with ESMTP id MAA60522 for ; Tue, 1 Jun 1999 12:11:33 -0700 Received: from scv2.apple.com (scv2.apple.com) by mailgate1.apple.com (mailgate1.apple.com- SMTPRS 2.0.15) with ESMTP id ; Tue, 01 Jun 1999 12:09:08 -0700 Received: from rhapture.apple.com (rhapture.apple.com [17.202.40.59]) by scv2.apple.com (8.9.3/8.9.3) with ESMTP id MAA14620; Tue, 1 Jun 1999 12:09:07 -0700 Received: by rhapture.apple.com (8.9.1/8.9.1) id MAA00780; Tue, 1 Jun 1999 12:09:07 -0700 (PDT) Message-Id: <199906011909.MAA00780@rhapture.apple.com> To: Wes Peters Subject: Re: Accessing special device files Cc: Julian Elischer , Zhihui Zhang , freebsd-hackers@freebsd.org Date: Tue, 1 Jun 1999 12:08:58 -0700 From: "Justin C. Walker" Reply-To: justin@apple.com X-Mailer: by Apple MailViewer (2.105.dev) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > From: Wes Peters > Date: 1999-06-01 11:50:23 -0700 > To: Julian Elischer > Subject: Re: Accessing special device files > Cc: Zhihui Zhang , 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