* redhat-4.0: /sbin/clock for the Jensen (again)
@ 1996-10-08 8:44 Martin Ostermann
0 siblings, 0 replies; 6+ messages in thread
From: Martin Ostermann @ 1996-10-08 8:44 UTC (permalink / raw)
Hmm, I'm afraid this is going to be the runnig gag of this list ...
The following patch is still missing in Colgate:
--- ../../util-linux-2.5/sys-utils/clock.c Tue Oct 8 09:09:54 1996
+++ clock.c Tue Oct 8 09:13:32 1996
@@ -142,7 +142,11 @@
#define VERSION "1.4.3axp"
+#ifdef __alpha__
+#define USE_DEV_PORT
+#else
#undef USE_DEV_PORT
+#endif
#ifdef USE_DEV_PORT
# include <asm/fcntl.h>
@@ -297,7 +301,7 @@
save_control = cmos_read (11); /* tell the clock it's being set */
cmos_write (11, (save_control | 0x80));
save_freq_select = cmos_read (10); /* stop and reset prescaler */
- cmos_write (10, (save_freq_select | clockport));
+ cmos_write (10, (save_freq_select | 0x70));
cmos_write (0, tm->tm_sec);
cmos_write (2, tm->tm_min);
BTW, is there any good reason not to use /dev/port on other machines?
Martin
--
Martin Ostermann | mailto:ost@comnets.rwth-aachen.de
Communication Networks | http://www.comnets.rwth-aachen.de/~ost
Aachen University of Technology | phoneto:++49/241/807917
Germany | faxto:++49/241/8890378
--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: redhat-4.0: /sbin/clock for the Jensen (again)
@ 1996-10-08 15:11 David Mosberger-Tang
0 siblings, 0 replies; 6+ messages in thread
From: David Mosberger-Tang @ 1996-10-08 15:11 UTC (permalink / raw)
>>>>> On 08 Oct 1996 10:44:14 +0200, Martin Ostermann <ost@comnets.rwth-aachen.de> said:
Martin> Hmm, I'm afraid this is going to be the runnig gag of this
Martin> list ... The following patch is still missing in Colgate:
I don't think that patch is correct. While I don't have the cmos
datasheet, somebody else (I believe it was Miquel) pointed out that
the 0x70 value that your patch changes is simply a bitmask that is
unrelated to the port address. Also, not all Alpha platforms need to
use the dev port. With the dev port, you loose atomicity of the
update, which in my opinion is a nice feature to have.
Are you saying the existing clock doesn't work at all for the Jensen?
I know Miquel was working on a modified clock utility that uses
/dev/rtc. I'm not sure what solution is better (/dev/port or
/dev/rtc) but maybe the Jensen folks could get together and present a
coherent solution?
--david
--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: redhat-4.0: /sbin/clock for the Jensen (again)
@ 1996-10-08 20:08 Martin Ostermann
0 siblings, 0 replies; 6+ messages in thread
From: Martin Ostermann @ 1996-10-08 20:08 UTC (permalink / raw)
David Mosberger-Tang <davidm@AZStarNet.COM> writes:
> >>>>> On 08 Oct 1996 10:44:14 +0200, Martin Ostermann <ost@comnets.rwth-aachen.de> said:
>
> Martin> Hmm, I'm afraid this is going to be the runnig gag of this
> Martin> list ... The following patch is still missing in Colgate:
>
> I don't think that patch is correct. While I don't have the cmos
> datasheet, somebody else (I believe it was Miquel) pointed out that
> the 0x70 value that your patch changes is simply a bitmask that is
> unrelated to the port address.
Yes, exactly! Please look at the patch again:
- cmos_write (10, (save_freq_select | clockport));
+ cmos_write (10, (save_freq_select | 0x70));
Its changing it back to 0x70! Actually I believed it was you who
erroneously changed it to clockport, after I pointed out a different
line; I never made that change, and only detected it when Miquel had
problems with the patch from azstartnet.
> Also, not all Alpha platforms need to
> use the dev port. With the dev port, you loose atomicity of the
> update, which in my opinion is a nice feature to have.
Ok, I see. When I patched clock the first time, USE_DEV_PORT was
standard on the Alpha platform. The comments suggested, that it was
needed on non EV4 machines.
> Are you saying the existing clock doesn't work at all for the Jensen?
Yes. I think I know what the problem is: (clock.c)
#ifdef USE_DEV_PORT
# include <asm/fcntl.h>
#else
# include <asm/io.h>
#endif
Because of <asm/io.h>, the kernel i/o functions get used instead of
the ones in glibc. Thus it only works on the i/o-architecture it was
compiled on (or similar ones). But even if I compile it on my Jensen,
it doesn't work. I need USE_DEV_PORT. I am going to take a look at it.
> I know Miquel was working on a modified clock utility that uses
> /dev/rtc. I'm not sure what solution is better (/dev/port or
> /dev/rtc) but maybe the Jensen folks could get together and present a
> coherent solution?
Miquel didn't mail his patches, so I don't know how it's
working. I recall, he also had problems with interrupts.
IMHO, using a kernel device would probably be the best solution, indeed.
I see if I can clock working with glibc's i/o functions. Should be no
problem.
Martin
--
Martin Ostermann | mailto:ost@comnets.rwth-aachen.de
Communication Networks | http://www.comnets.rwth-aachen.de/~ost
Aachen University of Technology | phoneto:++49/241/807917
Germany | faxto:++49/241/8890378
--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: redhat-4.0: /sbin/clock for the Jensen (again)
@ 1996-10-08 20:34 David Mosberger
0 siblings, 0 replies; 6+ messages in thread
From: David Mosberger @ 1996-10-08 20:34 UTC (permalink / raw)
Martin> David Mosberger-Tang <davidm@AZStarNet.COM> writes:
Martin> > >>>>> On 08 Oct 1996 10:44:14 +0200, Martin Ostermann <ost@comnets.rwth-aachen.de> said:
Martin> Hmm, I'm afraid this is going to be the runnig gag of this
Martin> list ... The following patch is still missing in Colgate:
David> I don't think that patch is correct. While I don't have the cmos
David> datasheet, somebody else (I believe it was Miquel) pointed out that
David> the 0x70 value that your patch changes is simply a bitmask that is
David> unrelated to the port address.
Martin> Yes, exactly! Please look at the patch again:
Martin> - cmos_write (10, (save_freq_select | clockport));
Martin> + cmos_write (10, (save_freq_select | 0x70));
Duh, I looked at your patch, went to my sources, saw that all is fine
and then concluded that your patch must be backwards. Sorry about
that. Hmmh, maybe my patch on azstarnet doesn't have this fix in.
I'll double check.
David> Are you saying the existing clock doesn't work at all for the Jensen?
Martin> Yes. I think I know what the problem is: (clock.c)
Martin> #ifdef USE_DEV_PORT
Martin> # include <asm/fcntl.h>
Martin> #else
Martin> # include <asm/io.h>
Martin> #endif
Martin> Because of <asm/io.h>, the kernel i/o functions get used instead of
Martin> the ones in glibc. Thus it only works on the i/o-architecture it was
Martin> compiled on (or similar ones). But even if I compile it on my Jensen,
Martin> it doesn't work. I need USE_DEV_PORT. I am going to take a look at it.
I don't think that's true. Even with <asm/io.h>, you should get the
library versions. But it would be cleaner to include <sys/io.h> for
glibc.
Martin> Miquel didn't mail his patches, so I don't know how it's
Martin> working. I recall, he also had problems with interrupts.
Martin> IMHO, using a kernel device would probably be the best solution,
Martin> indeed.
The axp-diffs have some patches to rtc.c that are supposed to fix this
problem. But I haven't heard from Miquel in a while, so I'm not sure
whether it's all working.
Martin> I see if I can clock working with glibc's i/o functions. Should be no
Martin> problem.
It should work, I agree. If not, maybe there is a bug in the glibc
functions in which case a fix is definitively needed.
--david
--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: redhat-4.0: /sbin/clock for the Jensen (again)
@ 1996-10-08 21:37 Martin Ostermann
0 siblings, 0 replies; 6+ messages in thread
From: Martin Ostermann @ 1996-10-08 21:37 UTC (permalink / raw)
David Mosberger <davidm@AZStarNet.com> writes:
> Martin> Because of <asm/io.h>, the kernel i/o functions get used instead of
> Martin> the ones in glibc. Thus it only works on the i/o-architecture it was
> Martin> compiled on (or similar ones). But even if I compile it on my Jensen,
> Martin> it doesn't work. I need USE_DEV_PORT. I am going to take a look at it.
>
> I don't think that's true. Even with <asm/io.h>, you should get the
> library versions. But it would be cleaner to include <sys/io.h> for
> glibc.
It was/is partially true: Only <asm/jensen.h> lacked the following
#ifdef __KERNEL__ :
--- jensen.h.org Tue Nov 7 08:18:36 1995
+++ jensen.h Tue Oct 8 22:51:59 1996
@@ -95,6 +95,7 @@
set_hae(addr);
}
+#ifdef __KERNEL__
/*
* IO functions
*
@@ -258,6 +259,8 @@
#define outb(x, port) \
(__builtin_constant_p((port))?__outb((x),(port)):_outb((x),(port)))
+
+#endif /* __KERNEL__ */
/*
* The Alpha Jensen hardware for some rather strange reason puts
But your right, at least some routines were taken from libc, because
otherwise it would work.
> The axp-diffs have some patches to rtc.c that are supposed to fix this
> problem. But I haven't heard from Miquel in a while, so I'm not sure
> whether it's all working.
>
> Martin> I see if I can clock working with glibc's i/o functions. Should be no
> Martin> problem.
>
> It should work, I agree. If not, maybe there is a bug in the glibc
> functions in which case a fix is definitively needed.
I looked at it: It's the Jensen's concept of "local" i/o
addresses. These are: (from <asm/jensen.h>)
#define __is_local(addr) ( \
/* keyboard */ (addr == 0x60 || addr == 0x64) || \
/* RTC */ (addr == 0x170 || addr == 0x171) || \
/* mb COM2 */ (addr >= 0x2f8 && addr <= 0x2ff) || \
/* mb LPT1 */ (addr >= 0x3bc && addr <= 0x3be) || \
/* mb COM2 */ (addr >= 0x3f8 && addr <= 0x3ff))
Glibc doesn't know about this, and I think it shouldn't, because this
would require runtime checking. Since anything but the RTC is kernel
controlled anyhow, I'd guess we ought to go for /dev/rtc, too.
But the short term solution is /dev/port, of cause.
Martin
--
Martin Ostermann | mailto:ost@comnets.rwth-aachen.de
Communication Networks | http://www.comnets.rwth-aachen.de/~ost
Aachen University of Technology | phoneto:++49/241/807917
Germany | faxto:++49/241/8890378
--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: redhat-4.0: /sbin/clock for the Jensen (again)
@ 1996-10-08 21:37 Martin Ostermann
0 siblings, 0 replies; 6+ messages in thread
From: Martin Ostermann @ 1996-10-08 21:37 UTC (permalink / raw)
David Mosberger <davidm@AZStarNet.com> writes:
> Martin> Because of <asm/io.h>, the kernel i/o functions get used instead of
> Martin> the ones in glibc. Thus it only works on the i/o-architecture it was
> Martin> compiled on (or similar ones). But even if I compile it on my Jensen,
> Martin> it doesn't work. I need USE_DEV_PORT. I am going to take a look at it.
>
> I don't think that's true. Even with <asm/io.h>, you should get the
> library versions. But it would be cleaner to include <sys/io.h> for
> glibc.
It was/is partially true: Only <asm/jensen.h> lacked the following
#ifdef __KERNEL__ :
--- jensen.h.org Tue Nov 7 08:18:36 1995
+++ jensen.h Tue Oct 8 22:51:59 1996
@@ -95,6 +95,7 @@
set_hae(addr);
}
+#ifdef __KERNEL__
/*
* IO functions
*
@@ -258,6 +259,8 @@
#define outb(x, port) \
(__builtin_constant_p((port))?__outb((x),(port)):_outb((x),(port)))
+
+#endif /* __KERNEL__ */
/*
* The Alpha Jensen hardware for some rather strange reason puts
But your right, at least some routines were taken from libc, because
otherwise it would work.
> The axp-diffs have some patches to rtc.c that are supposed to fix this
> problem. But I haven't heard from Miquel in a while, so I'm not sure
> whether it's all working.
>
> Martin> I see if I can clock working with glibc's i/o functions. Should be no
> Martin> problem.
>
> It should work, I agree. If not, maybe there is a bug in the glibc
> functions in which case a fix is definitively needed.
I looked at it: It's the Jensen's concept of "local" i/o
addresses. These are: (from <asm/jensen.h>)
#define __is_local(addr) ( \
/* keyboard */ (addr == 0x60 || addr == 0x64) || \
/* RTC */ (addr == 0x170 || addr == 0x171) || \
/* mb COM2 */ (addr >= 0x2f8 && addr <= 0x2ff) || \
/* mb LPT1 */ (addr >= 0x3bc && addr <= 0x3be) || \
/* mb COM2 */ (addr >= 0x3f8 && addr <= 0x3ff))
Glibc doesn't know about this, and I think it shouldn't, because this
would require runtime checking. Since anything but the RTC is kernel
controlled anyhow, I'd guess we ought to go for /dev/rtc, too.
But the short term solution is /dev/port, of cause.
Martin
--
Martin Ostermann | mailto:ost@comnets.rwth-aachen.de
Communication Networks | http://www.comnets.rwth-aachen.de/~ost
Aachen University of Technology | phoneto:++49/241/807917
Germany | faxto:++49/241/8890378
--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1996-10-08 21:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-10-08 20:08 redhat-4.0: /sbin/clock for the Jensen (again) Martin Ostermann
-- strict thread matches above, loose matches on Subject: below --
1996-10-08 21:37 Martin Ostermann
1996-10-08 21:37 Martin Ostermann
1996-10-08 20:34 David Mosberger
1996-10-08 15:11 David Mosberger-Tang
1996-10-08 8:44 Martin Ostermann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox