Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!oliveb!sun!cmcmanis From: cmcmanis@sun.uucp (Chuck McManis) Newsgroups: comp.sys.amiga Subject: Re: Help w/Disked for hard disks Message-ID: <11655@sun.uucp> Date: Mon, 19-Jan-87 14:28:57 EST Article-I.D.: sun.11655 Posted: Mon Jan 19 14:28:57 1987 Date-Received: Tue, 20-Jan-87 05:02:16 EST References: <159@wlbreng1.UUCP> <11186@sun.uucp> <163@wlbreng1.UUCP> Organization: Sun Microsystems, Inc. Lines: 43 Summary: look in filehandler.h 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 These opinions are my own and no one elses, but you knew that didn't you.