*BSD News Article 26629


Return to BSD News archive

Newsgroups: comp.os.386bsd.development
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!decwrl!decwrl!netcomsv!netcom.com!jmonroy
From: jmonroy@netcom.com (Jesus Monroy Jr)
Subject: Re: [Q] Logical vs Phygical Block
Message-ID: <jmonroyCKB8Gn.6ou@netcom.com>
Organization: NETCOM On-line Communication Services (408 241-9760 guest)
X-Newsreader: TIN [version 1.2 PL1]
References: <CK9wu8.F6r@specgw.spec.co.jp>
Date: Thu, 27 Jan 1994 22:43:34 GMT
Lines: 66

Atsushi MURAI (amurai@specgw.spec.co.jp) wrote:
: Dear Netter,

:   I am working around CD-ROM/DA(PhotoCD,Reading Degital Audio) for
:	:: [deleted stuff] ::
:
:  For example, when invoke a read function for raw device, Starting
: point of Data is offset from partition. 
:	
	For most partition devices I have seen this is true.

: Read funtion call the phisio
: in kernel for converting from offset to Logical Block Number (512byte).
: and then this routine call a stratagey routine in driver is converting 
: Logical Block number plus partition to Phygical Block Number. 
:
	I am not certain of your statement, but I think the
	answer is YES.  That is, the XXstratagey() routine gets
	an "offset" number from the physical beginning
	boundary of the disk(ette).

: This implementation will work only Phygical Block size is multiple 512
: bytes. ( i.e. CD-ROM block 2048/ SCSI 512Bytes)
:
	By "this implementation" I take it to mean your CD driver.
	If not, please correct me.

: But block(sector) size for Degital Audio Data on CD is 2352byts.  So
: it will miss reading a block.........
:
	You will miss a few bytes. OK, I understand this.

: I am planning(actually done) to pass a data offset ( uio->uio_offset )
: pointer to stratagey routine in cd.c and re-make a new(next) offset and
: calculating Phygical Block Number.( I beleive other stratagy routine
: in disk/fd is just ignore extra argument from kern_physio.c ;-)
:
: But I would like to get any comment/suggestion for my idea from you
: just in case.
:
	I don't know this argument (pointer/data item).
	My recommondation is NOT to do this.
	
	1) Unless the "data point" is intended for your
	   use, then don't use it. Interweaving into
	   data structures to the kernel makes your
	   driver NOT transportable.

	2) A new design in the kernel may kill your driver
	   That is, is the *uio_offset* is removed by
	   someone doing kernel redesign - your driver
	   will quickly be removed or redesigned 
	   (maybe without your name.


	If you need a suggestion for a better solution,
	then I need a day to think about it.
	
	Then again, maybe someone else has a commment.

	I will monitor the conversation.
-- 
Jesus Monroy Jr                                          jmonroy@netcom.com
Zebra Research
/386BSD/device-drivers /fd /qic /clock /documentation
___________________________________________________________________________