Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!nbires!hao!hplabs!sdcrdcf!trwrb!scgvaxd!wlbr!wlbreng1!steve From: steve@wlbreng1.UUCP (Steve Childress) Newsgroups: comp.sys.amiga Subject: Re: Help w/Disked for hard disks Message-ID: <169@wlbreng1.UUCP> Date: Thu, 22-Jan-87 11:32:05 EST Article-I.D.: wlbreng1.169 Posted: Thu Jan 22 11:32:05 1987 Date-Received: Fri, 23-Jan-87 07:28:18 EST References: <159@wlbreng1.UUCP> <11186@sun.uucp> <163@wlbreng1.UUCP> <11655@sun.uucp> Reply-To: steve@wlbreng1.UUCP (0000-Steve Childress) Organization: Eaton Inc. IMSD, Westlake Village, CA Lines: 53 In article <11655@sun.uucp> cmcmanis@sun.uucp (Chuck McManis) writes: >In article <163@wlbreng1.UUCP>, steve@wlbreng1.UUCP (Steve Childress) writes: >*> Could someone explain what is meant by "DISKENV"? As far as I have read >*> and understand, to find the in-memory rendition of the data found for >*> mounted disks, I must write a routine to chase the list of devices looking >*> for those associated with my driver (using my driver's ASCII name) and >*> the look for the desired sub unit by somehow knowing its ASCII name too. >*> >*> I don't know how to do the latter. Sure would like to add code to my >*> driver so's it could automatically discover the extents of the disk >*> partition for any arbitrary subunit. Also-- still looking to learn what >*> is passed in D0 to the driver OPENDEVICE routine. >*> >*> Steve Childress > >DISKENV is an array of longwords that describes your disk layout. It >contains such interesting things as the number of sectors per track, >the starting cylinder number, the ending cylinder number, the number >of heads, etc. All of the entries are documented in the include >file "libraries/filehandler.h". As it turns out the handler task that >is talking to your device automatically adds in the offset to the >first cylinder when you try to read or write file data, however if >you are using the Exec I/O calls (DoIO, SendIO, etc) then you will >have to add in this offset yourself. Chasing the device names is >fairly simple, although it might be easier to store a pointer to >your device node at startup time (when you are loaded). Currently, >as far as I can tell the default behaviour of ADOS is to insert >new devices at the head of the DeviceList, thus when you are >started your device node will be pointed to by the DeviceList pointers >in the RootNode (I think it is called DevInfo) Also the AddDevice >calls requires an address to a DeviceNode structure so assuming >your driver built its device node structure then it knows where >it is. > >As it turns out there is also a Unit subfield in the DISKENV array >and that is what I pass to the OpenDevice call in D0. > >Final comment is why does your driver care how the disk is partitioned? >Since the file handler takes care of that stuff for you? > >-- >--Chuck McManis >uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com In my driver, I want to access the info in mountlist so I can decide which physical drive is being opened. My system, like many, has multiple hard disks, and sometimes they differ in I/O techniques, e.g., stepping rate on the head positioner. My old Tandon lacks buffered seek so whenever I change drives I have to do a seek with a different stepping rate. Also, there is a driver call "tell number of cylinders" or some such which requires access to this sort of data, and it should not be hard coded. I'll study that .h file -- thanx.