*BSD News Article 12201


Return to BSD News archive

Path: sserve!manuel.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!caen!nic.umass.edu!noc.near.net!ceylon!genesis!steve2
From: steve2@genesis.nred.ma.us (Steve Gerakines)
Newsgroups: comp.os.386bsd.development
Subject: DELAY() accuracy
Message-ID: <93030220176@genesis.nred.ma.us>
Date: 2 Mar 93 13:19:15 GMT
Organization: Genesis Public Access Minix  +1 508 664 0149
Lines: 20

I created a little patch for my kernel a while back that improved the
accuracy of the DELAY() macro.  Has anyone else officially added a fine
tuned (non-interrupt) delay routine yet?  If not I'll post mine up here.

Basically, as soon as the clock starts running, my kernel runs a few tests
to see how long a delay loop can run.  It then uses this result to tune
the DELAY() macro, so that DELAY(1) will delay 1ms (with interrupts masked)
regardless of what the host's real speed is.  I needed this to do some
critical timing work.  I suppose could've tuned DELAY() to better than 1ms
accuracy but it was convenient at the time.

- Steve
--
Steve Gerakines           |
steve2@genesis.nred.ma.us |  "I have a three user 386BSD TV license." - me
+1 (508)664-0149          |