Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!spdcc!m2c!ulowell!masscomp!jeffrey From: jeffrey@masscomp.UUCP (Jeff Jones) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Delay with no real time clock Message-ID: <2414@masscomp.UUCP> Date: Wed, 14-Oct-87 19:18:42 EDT Article-I.D.: masscomp.2414 Posted: Wed Oct 14 19:18:42 1987 Date-Received: Sat, 17-Oct-87 16:50:40 EDT Reply-To: jeffrey@masscomp.UUCP (Jeff Jones) Distribution: na Organization: MASSCOMP - Westford, Ma Lines: 25 Xref: mnetor comp.unix.questions:4534 comp.unix.wizards:4937 I am working with a driver that must wait for a specified period of time (usually less than one second) after issuing a command before assuming that a device is not present. This must happend during device initialization time. There are no real time clock interrupts during the device initialization phase of our kernel. The system time counter (lbolt in our case) does not get incremented HZ times per second until after all devices are initialized. So, How do you determine how much time has expired when you have no real time clock interrupt? One would suppose the answer would be to set up a loop with a specific number of instructions and then have some macro that tells you how many of these loops occur per second. But that would entail changing the macro everytime you change the clock rate of the processor (or changing the contents of the loop). This is also somewhat non-deterministic due the fact that the loop may or may not be in an instruction cache. I am curious to find our how others have dealt with this problem. Thanx, jeff jones