Port-amiga archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Amiga delay implementation



Ignatios Souvatzis wrote:

>> As I found several calls to delay() with <= 25us in amiga/dev I would
>> prefer to restore the former calibrated loop method.
>
> Generally I agree. In some drivers, there are delays of only a few
> µs, which are prolonged a lot even for the timer method on Amiga,
> [...]
> (And you didn't mention the dev/ic drivers yet that are used by 
>  Amiga frontends - or did you count them?)

No, I just checked amiga/dev.


> DELAY() and delay() are documented not to be precise; but occasionally
> prolonging long delays, that have a greater danger of being hit by
> a higher level interupt, doesn't seem as bad to me as prolonging
> short delays, as the latter would increase interupt overhead in a
> lot of hardware drivers.

And it is not recommended to use delay/DELAY for long delays. For short
delays the calibrated loop is certainly best.


I finished the re-implementation of the calibrated delay-loop into the
current timecounter-based clock.c. Modified files were:
  amiga/amiga_init.c
  amiga/locore.S
  dev/clock.c

You find the source together with a generic kernel at:
  ftp://ftp.netbsd.org/pub/NetBSD/misc/phx/clock522.tar.gz

Maybe you want to give it a try on a DraCo. Also everybody else is invited
to check the new kernel, especially to verify whether the A1200 keyboard
problems are still gone.

On my A3000/060 the divisor is now calibrated as "21/1024 us", which is
exactly the same value as with the 4.0 or 3.1 kernel. The kernel works as
far as I can see in multiuser mode with A3k-SCSI, CSPPC-SCSI, X-Surf
ethernet, CV64, etc., and I can even dump the contents of a floppy disk, so
the timing can't be too bad.

Even mounting an AmigaDos floppy disk works again, which was broken in
previous kernels!

-- 
    _  Frank Wille (frank%phoenix.owl.de@localhost)
 _ //  http://sun.hasenbraten.de/~frank/
 \X/   Phx @ #AmigaGer



Home | Main Index | Thread Index | Old Index