RAW IO PARTIAL BLOCK(SECTOR) READ/WRITE

Tzung Liu tzung at cadovax.UUCP
Tue Nov 14 04:22:19 AEST 1989


I am working on a project to modify our SCSI disk drivers for partial sector
R/W via the RAW I/O entry points hdread() and hdwrite().  The system I am
working on is a 386 box running AT&T 386/UNIX V.3.2.  After digging into
the codes and SCSI protocol supporting chips in our system, we have made it
working.  But I still have some questions regarding the basics of partial
sector(block) R/W:
	1. Which part of kernel needs partial R/W?
	   The only place I can find in AT&T V.3.2 kernel is in the
	   RDUBLK variant of the sysi86() system call which does a RAW I/O
	   partial read to the swap device.  Is there any other place
	   in kernel which does this?
	2. How do we handle u.u_offset when it's not multiple of block size?
	   We chose to truncate it to the nearest sector and use it as the
	   starting sector number.  Is this a safe approach?
	3. How do we handle partial write?
	   For partial read, data is read from disk in blocks and transferred
	   back to the host up to the byte numbers requested.  For partial
	   write, do we have to read in the block, merge it with the
	   data supplied by user process and write it back again?
	   Or just pad the partial data with some predefined value(zero?)
	   and write it as a whole block?

I was told that the the AT&T 3B2's Integra disk drivers does something like
	. u.u_offset is truncated to the nearest sector.
	. partial write is padded with 0's and written as a whole block.

Can anybody from AT&T verify this?

We would like to make our disk drivers compatible with AT&T's and not fall into
the problems caused by inconsistent assumptions made by the kernel(AT&T source)
and drivers(our implementation).

Tzung Liu.   VERSYSS Inc.   cadovax!tzung
	   



More information about the Comp.unix.wizards mailing list