Re: SMP & /sbin/clock past 1.3.72

Paul Gortmaker (gpg109@rsphy1.anu.edu.au)
Mon, 15 Apr 1996 16:01:58 +1000 (EST)


"Markus Maresch" at Apr 12, 96 00:43:45 am

> My ASUSTEK PCI/E-P54NP4 also hangs at /sbin/clock with SMP and 1.3.85
> Questions:
> is there a simple workaround ?

Yes, don't run /sbin/clock at boot. You can set the date as root
once booted via "date 0412183596" (April 12, 6:35pm). Of course
this is a pain, and you don't want to do this every time.

> Is the /dev/rtc kernel patch as described above necessary ??
> yes: does it solve the hang (alone)?

It is necessary if you want access to reading/setting the CMOS clock
in a way that is compatible with SMP machines. It does not solve the
hang alone because the present /sbin/clock has to be taught to use
the /dev/rtc interface, instead of doing evil stuff from user space via
iopl(3) which is what kills you. Using the current /sbin/clock on an
SMP box is about as intelligent as doing "cat /dev/urandom > /dev/port".

> Or do I also have to replace /sbin/clock ??
> yes: available at ??

Yes, you must replace it as well, with one that knows about the /dev/rtc
interface and uses that first, before trying the iopl(3) nasties. Also
don't forget to mknod the /dev/rtc or /sbin/clock will revert to
iopl(3).

You can grab a 1.3.88 "rtc kit" (uuencoded tar.gz) from

http://rsphy1.anu.edu.au/~gpg109/rtc.uu

which contains a diff against 1.3.88 to install the rtc driver, source
and a.out binary of /sbin/clock that uses /dev/rtc and source+binary for
rtctest, a simple driver test/example program.

Note that I changed the output of /dev/rtc to an unsigned long instead
of an unsigned char. It became obvious that 4 bits wasn't enough to
store the amount of "interrupt pileup" under load at 8kHz IRQ frequency.
So you should use the "rtctest" and "/sbin/clock" included in the above,
and not any that I sent out earlier.

I have sent the driver off to Linus, so hopefully it will appear in
1.3.8x -- otherwise Linux-SMP v2.0 will look a bit silly if it can't
even set the system time at boot.

Those without a web browser handy can always do a:

% telnet rsphy1.anu.edu.au 80 > rtc.uu
GET /~gpg109/rtc.uu

and then uudecode it just like you would otherwise. It is about 20k.

Paul.