Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Nov 1998 20:22:10 +0900 (JST)
From:      sanpei@sanpei.org (MIHIRA Yoshiro)
To:        toasty@home.dragondata.com
Cc:        current@FreeBSD.ORG, sanpei@sanpei.org, cjohnson@netgsi.com
Subject:   Re: MediaGX and calcru: negative time
Message-ID:  <199811171122.UAA01911@lavender.sanpei.org>
In-Reply-To: Your message of "Tue, 17 Nov 1998 03:30:32 JST". <199811161830.MAA16210@home.dragondata.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>> Ok... I'm using a Media GXm in an embedded product with FreeBSD... I'm
>> getting the annoying 'calcru' messages, and processes dying.
>> 
>> Copyright (c) 1992-1998 FreeBSD Inc.
>> Copyright (c) 1982, 1986, 1989, 1991, 1993
>>         The Regents of the University of California.  All rights reserved.
>> 
>> FreeBSD 2.2.7-RELEASE #0: Wed Oct 21 16:22:35 CDT 1998
>>     devel@kevin1.touchmaster:/usr/src/sys/compile/DEVEL
>> CPU: Cyrix GXm (0.00-MHz 586-class CPU)
>>   Origin = "CyrixInstead"  Id = 0x540  DIR=0x3346  Stepping=3  Revision=3
>> real memory  = 63963136 (62464K bytes)
>> avail memory = 60252160 (58840K bytes)
>> 
>> 
>> Now, since Cyrix is supporting us with this product, are there any questions
>> I can ask them that may shed some light?
>> 
>> It appears that the problem is brought out by lots of IDE access. The IDE
>> interface is done internaly, in the CPU. Could timeouts/delays in the IDE
>> side be slowing the clock somehow?
>> 
>> Tell me what to ask, and I will. :)

  I have MediaGX box. I install 2.2.6R. I also have this problem.....
  But my problem is only calcru, and can't detect psm0(PS/2) port.
Sometimes can't detect Ethernet Card(occasionally automatically rebooted...).

  This problem (I think) already reported to GNATS Problem repository,
kern/6630[1] which is included experimental patch. Please apply this patch. 
  This Patch is ``check timer twice, and use larger one at getit:clock.c''.

  Another person who has also MediaGX box, reported me that
his MediaGX box is needed 4 times to detect correct one.

  I had planning to report this problem to GNATS Database and Mr Christopher
 T. Johnson.

[1] kern/6630: Fix for Cyrix I8254 bug
http://www.freebsd.org/cgi/query-pr.cgi?pr=6630

Thank you
MIHIRA Yoshiro

-----
4times patch
--- /sys/i386/isa/clock.c	Sun Apr 27 22:44:19 1997
+++ ./clock.c	Mon Nov  2 17:01:55 1998
@@ -345,7 +345,9 @@
 {
 	u_long ef;
 	int high, low;
-
+#ifdef CPU_CYRIX_NO_I8254_LATCH
+	int ret1, ret2, ret3, ret4;
+#endif
 	ef = read_eflags();
 	disable_intr();
 
@@ -354,9 +356,32 @@
 
 	low = inb(TIMER_CNTR0);
 	high = inb(TIMER_CNTR0);
+#ifdef CPU_CYRIX_NO_I8254_LATCH
+	ret1 = (high << 8) | low;
 
+	outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH);
+	low = inb(TIMER_CNTR0);
+	high= inb(TIMER_CNTR0);
+	ret2 = (high << 8) | low;
+
+	outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH);
+	low = inb(TIMER_CNTR0);
+	high= inb(TIMER_CNTR0);
+	ret3 = (high << 8) | low;
+
+	outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH);
+	low = inb(TIMER_CNTR0);
+	high= inb(TIMER_CNTR0);
+	ret4 = (high << 8) | low;
+#endif
 	write_eflags(ef);
+#ifdef CPU_CYRIX_NO_I8254_LATCH
+	ret1 = (ret1 > ret2 ? ret1 : ret2);
+	ret3 = (ret3 > ret4 ? ret3 : ret4);
+	return (ret1 > ret3 ? ret1 : ret3);
+#else
 	return ((high << 8) | low);
+#endif
 }
 
 /*


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811171122.UAA01911>