Xref: utzoo comp.sys.amiga:68511 comp.sys.amiga.tech:15038 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!sdd.hp.com!wuarchive!mit-eddie!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!sci.kun.nl!cs.kun.nl!rhialto From: rhialto@cs.kun.nl (Olaf Seibert) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Re: Should CrossDos/MSH work on my 3000? Summary: Is this documented now? (see below) Message-ID: <2286@wn1.sci.kun.nl> Date: 12 Oct 90 10:50:20 GMT References: <08Oct90.151432.944@ckctpa.UUCP> <7811@ucdavis.ucdavis.edu> Sender: root@sci.kun.nl Followup-To: comp.sys.amiga.tech Organization: University of Nijmegen, The Netherlands Lines: 119 In article <7811@ucdavis.ucdavis.edu> zerkle@iris.ucdavis.edu (Dan Zerkle) writes: >In article <08Oct90.151432.944@ckctpa.UUCP> crash@ckctpa.UUCP (Frank J. Edwards) writes: >>[MSH does not work on a 3000] > >I have been able to get MSH to read but not write (or format). I think that the messydisk.device indefinitely waits for an index interrupt. The way these things are installed is not really documented, as far as I know, except by suggestive names in a structure. What usually is the problem when messydisk can't write, is that the IndexIntCode doesn't get called for some reason. (Usually these are hardware problems, so not my problem ;-) The ~~~ marked part is what is questionable. But if it can read, the block interrupt works, so why doesn't the index interrupt work? Specifically, what I do is the following: (file devio.c excerpted) /*- * $Id: devio.c,v 1.30 90/06/04 23:18:52 Rhialto Rel $ -*/ struct DiskResource *DRResource;/* Argh! A global variable! */ void *CiaBResource; /* And yet another! */ _SafeEnableICR: move.l _CiaBResource,a6 move.b 4+1(sp),d0 jsr _LVOSetICR(a6) ; clear pending interrupt move.b 4+1(sp),d0 or.b #$80,d0 ; then enable it jsr _LVOAbleICR(a6) rts ;;;; ; ; Disk index interrupt code. ; is_Data (A1) is the value to stuff into the DSKLEN register. ; A0 points to the custom chips already. ; It then enables the disk block interrupt and disables the ; index interrupt. _IndexIntCode: ; movem.l A2-A4/D2-D7,-(sp) move.w #dskdmaoff,Dsklen(a0) move.w a1,Dsklen(a0) move.w a1,Dsklen(a0) ; this enables the DMA move.w #intf_setclr|intf_dskblk,Intena(a0) move.l _CiaBResource,a6 move.b #ciaicrf_flg,d0 jsr _LVOAbleICR(a6) ; disable index interrupt ; movem.l (sp)+,A2-A4/D2-D7 rts ;;;; ; ; Disk DMA finished interrupt code. ; (a1) is the task to Signal, 4(a1) is the signal mask to use. ; Disables the disk block finished interrupt. _DskBlkIntCode: move.w #dskdmaoff,Dsklen(a0) ; disable disk DMA move.w #intf_dskblk,Intena(a0) ; disable the interrupt move.w #intf_dskblk,Intreq(a0) ; clear 'diskblock finished' flag move.l 4(a1),d0 ; signal mask move.l (a1),a1 ; task to signal jsr _LVOSignal(a6) rts struct { struct Task *task; ulong signal; } tasksig; tasksig.task = FindTask(NULL); tasksig.signal = 1L << unit->mu_DmaSignal; (this is done once on the initialisation of the device's unit:) unit->mu_DRUnit.dru_Index.is_Node.ln_Pri = 32; /* high pri for index int */ unit->mu_DRUnit.dru_Index.is_Code = IndexIntCode; unit->mu_DRUnit.dru_DiscBlock.is_Code = DskBlkIntCode; unit->mu_DRUnit.dru_Index.is_Data = (APTR) ((WLEN >> 1)|DSKDMAEN| dskwrite); unit->mu_DRUnit.dru_DiscBlock.is_Data = (APTR) &tasksig; /* Clear signal bit */ SetSignal(0L, tasksig.signal); /* Allocate drive and install index and block interrupts */ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GetDrive(&unit->mu_DRUnit); /* Select correct drive and side */ /* Set up disk parameters */ /* Set up disk buffer address */ /* Enable disk DMA */ /* Enable disk index interrupt to start the whole thing. */ SafeEnableICR((int) CIAICRF_FLG); Wait(tasksig.signal); FreeDrive(); void * GetDrive(drunit) register struct DiskResourceUnit *drunit; { Basically just GetUnit(drunit); Note no AllocUnit() is done, because trackdisk already has done this so we fail if we try. } void FreeDrive() { GiveUnit(); } > Dan Zerkle zerkle@iris.ucdavis.edu (916) 754-0240 -- Olaf 'Rhialto' Seibert rhialto@cs.kun.nl How can you be so stupid if you're identical to me? -Robert Silverberg -- Olaf 'Rhialto' Seibert rhialto@cs.kun.nl How can you be so stupid if you're identical to me? -Robert Silverberg