*BSD News Article 1824


Return to BSD News archive

Xref: sserve comp.unix.bsd:1859 comp.unix.internals:4922
Path: sserve!manuel!munnari.oz.au!spool.mu.edu!think.com!ames!sun-barr!sh.wide!wnoc-tyo-news!hoffman!jmasgw!green!rai!tetsuji
From: tetsuji@rai.juice.or.jp (Tetsuji Rai)
Newsgroups: comp.unix.bsd,comp.unix.internals
Subject: Re: Writing a device driver for CDROM
Keywords: bsd devicedriver cdrom
Message-ID: <1992Jul6.113142.436@rai.juice.or.jp>
Date: 6 Jul 92 11:31:42 GMT
Article-I.D.: rai.1992Jul6.113142.436
References: <1992Jun20.152106.159@rai.juice.or.jp> <24289@dog.ee.lbl.gov>
Organization: Rai's home in Tokyo
Lines: 38

In article <24289@dog.ee.lbl.gov> torek@horse.ee.lbl.gov (Chris Torek) writes:
>In article <1992Jun20.152106.159@rai.juice.or.jp> tetsuji@rai.juice.or.jp
>(Tetsuji Rai) writes:
>
>>The scsi source files coming with BSD/386 are for hard disks and tape
>>drives; ie non-removable devices, so "match" and "attach" routine (sdmatch
>>and sdattach, internally) are called upon booting.  As for CDROM, the
>>device is often changed, so I assume sdattach should be called each time
>>it is mounted.
>
>No: match and attach are used to find hardware.  The CDROM *drive* is
>not physically removed from the bus; only the media are removable.
>(Well, it is possible to move hardware with live power, but be *sure*
>you know what you are doing.)
>
Thanks.  I've got it.

>The interface between a CDROM ``disk'' driver and the rest of the
>system is up to you, but once matched and attached, the device entry is
>there to stay.  (Currently, the configuration code allows devices to
>appear `magically' on a bus iff the bus driver code notices and calls
>config_found---that is, config_found is intended to be usable at any
>time---but there is no support for ``unfinding'' a device.  This would
>be easy now, but would complicate dynamic driver loading, if anyone
>were to implement that.)

  Thank you.  I got the hierarchy, making CDROM driver, and have another
problem.    I can attach and get the capacity of a CDROM, but cannot
read.   I cannot explain without the source code, so cannot talk in a
newsgroup.

   Thank you very much!

---
RRR              Tetsuji Rai    tetsuji@rai.juice.or.jp
R  R   aaa   i    5-12-21, Toyotamakita, Nerimaku, Tokyo 176, Japan
RRR   a  a   i   voice: +81-3-3557-3936   fax: +81-3-3993-0323
R  R  aaaaa  i