From owner-freebsd-hackers Tue Feb 11 15:21:38 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id PAA28041 for hackers-outgoing; Tue, 11 Feb 1997 15:21:38 -0800 (PST) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id PAA28031 for ; Tue, 11 Feb 1997 15:21:34 -0800 (PST) Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id AAA22615 for freebsd-hackers@FreeBSD.ORG; Wed, 12 Feb 1997 00:21:27 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.8.5/8.6.9) id AAA26360; Wed, 12 Feb 1997 00:04:37 +0100 (MET) Message-ID: Date: Wed, 12 Feb 1997 00:04:37 +0100 From: j@uriah.heep.sax.de (J Wunsch) To: freebsd-hackers@FreeBSD.ORG Subject: Re: Raw I/O Question References: X-Mailer: Mutt 0.55-PL10 Mime-Version: 1.0 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: ; from Simon Shapiro on Feb 11, 1997 13:38:03 -0800 Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk As Simon Shapiro wrote: > Can someone take a moment and describe briefly the execution path of a > lseek/read/write system call to a raw (character) SCSI partition? I can't explain your observed behaviour, but here's the rough picture: . every call has to walk down through the upper VFS layers, until it eventually will arrive in specfs_vfsops (that's where the operations to /dev nodes end up) . lseek()'s are no-ops wrt. the drive operation, they are just noted by the VFS layers to later setup the request . read and write ops are finally being handed off to rawread(9) or rawrite(9), which will in turn call physio(9) (actually writing these man pages is left as an exercise to you :-) . physio will setup a buffer header for the request, call the device strategy routine, and wait for completion . the SCSI drivers attempt to issue the READ or WRITE commands for the full range as specified by the buffer header at once; since these commands take both, offset and length parameters, no separate SCSI operation is required to formulate the seek operation -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)