Re: speaking of 1541..

From: Spiro Trikaliotis (ml-cbmhackers_at_trikaliotis.net)
Date: 2005-04-27 08:36:09

Hello Christopher,

* On Tue, Apr 26, 2005 at 09:31:10AM +0800 Christopher Phillips wrote:
 
> Curious.  Of course, now that I have posted about some code I wrote
> some weeks ago, I pull it out to try something MagerValp suggested and
> cannot get it to fail...

This is totally normal. :-)

 
> If it breaks again I will put together enough of the code to get to
> the failure point and post it - although the code I posted earlier
> includes all the relevant drive code aside from the port equates.

Yes, but:

1. the labels might contain some surprising definitions. ;-)

2. as I did not see anything obvious, I thought tested the code might
   have helped. It is always much easier to execute complete code.

 
> Thanks.  I did notice that Lasse Öörni leaves interrupts enabled for a
> little while at the start of his loader, with a comment about
> "allowing the motor to stop"
> 
> Marko also starts his drive code with a cli with a comment about "; 
> interrupts enabled until first sector read".
> 
> Can anyone share any light on either of the above, or should I be 
> asking Lasse? :)

It's simple. Most job codes (except $E0) for the job loop tell the job
routine to start spinning the drive before executing the job.

Thus, if I put a jobcode other than $E0 into the drive, the drive will
start spinning before my job is executed. Anyway, the job loop is
executed in the IRQ, thus, I have to enable them in order for the drive
to start spinning.

The same applies for stopping the motor: If the job routine does not
encounter another job for some time, it stops the motor. Again,
interrupts are required for this. Thus, if I put a code in a job loop,
allow interrupts and I stop interrupts immediately, then the motor will
not stop at all.


> >Of course, you could set a timeout, but I think this is over-doing.
> 
> If I were to set a timeout, I don't know what I could do after it ran
> out other than cancel the entire load and resend the drive code, as I
> don't think the job code had been removed.  Of course, I am only
> checking it's sign, not it's value, so I could be wrong on that count.

It might help if you test it more thoroughly. ;-)

BTW: Do you hear some noise of the R/W head moving? The job routine
tries to move the head a half-track in and out whenever an error occurs.
Do you use your own job routine, or a standard job routine?

Regards,
   Spiro.

-- 
Spiro R. Trikaliotis
http://www.trikaliotis.net/
http://cbm4win.sf.net/

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.