Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!necntc!custom!boykin From: boykin@custom.UUCP (Joseph Boykin) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: Delay with no real time clock Message-ID: <769@custom.UUCP> Date: Fri, 16-Oct-87 10:30:05 EDT Article-I.D.: custom.769 Posted: Fri Oct 16 10:30:05 1987 Date-Received: Sat, 17-Oct-87 23:15:34 EDT References: <2414@masscomp.UUCP> Distribution: na Organization: Custom Software Systems; Natick, MA Lines: 37 Xref: mnetor comp.unix.questions:4543 comp.unix.wizards:4948 In article <2414@masscomp.UUCP>, jeffrey@masscomp.UUCP (Jeff Jones) writes: > 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? There are two solutions which I've used. One has the advantage that you don't have to do anything, the other means you might have to do a little patching after the kernel is built. 1) Since you're doing this at initialization time and hence not overly concerned about real-time performance, and since the timeout is relatively short, I would just wait long enough for your 'best' CPU performance. If you're running a 10MHz 68000 vs. a 25MHz 68020 with cache the same code for the 68K will timeout in, say, 3 seconds instead of 0.5. Not great, but not a disaster either. 2) Just as you patch the kernel once to change the 'uname' structure to whatever name you want your system to have, add another location (or struction) which has whatever other info you might find useful. I've including things such as clock rate, CPU type, Kernel virtual offset, plus any other tunable parameters I thought would be of use. -- Joe Boykin Custom Software Systems ...necntc!custom!boykin