* `/sbin/clock' for the Jensen
@ 1996-05-23 10:16 Martin Ostermann
0 siblings, 0 replies; 3+ messages in thread
From: Martin Ostermann @ 1996-05-23 10:16 UTC (permalink / raw)
Hi,
last night I patched `clock' to add an option for Jensen systems. If
the `-J' option is supplied, it will now use port 0x170 instead of
0x70 as the base for the real-time-clock. Seems to work fine. The
patch is based on util-linux-2.5-10.src.rpm. This does _not_ address
the 20 years off problem of the old firmware, though.
A binary version is available from
http://www.comnets.rwth-aachen.de/~ost/alpha/alpha.html
Have fun, Martin
diff -rbu util-linux-2.5/sys-utils/clock.8 util-linux-2.5axp-3/sys-utils/clock.8
--- util-linux-2.5/sys-utils/clock.8 Wed May 22 23:16:44 1996
+++ util-linux-2.5axp-3/sys-utils/clock.8 Wed May 22 23:08:21 1996
@@ -24,6 +24,9 @@
.B \-A
Indicates that the clock is in the ARC Console's time
.TP
+.B \-J
+Indicates that the system is a Jensen/Axp machine
+.TP
.B \-r
Read CMOS clock and print the result to stdout.
.TP
diff -rbu util-linux-2.5/sys-utils/clock.c util-linux-2.5axp-3/sys-utils/clock.c
--- util-linux-2.5/sys-utils/clock.c Wed May 22 23:16:45 1996
+++ util-linux-2.5axp-3/sys-utils/clock.c Wed May 22 23:01:29 1996
@@ -133,9 +133,13 @@
* V1.4.2axp: jestabro@amt.tay1.dec.com (Jay Estabrook)
* Wed Jan 10 1996, modified to use /dev/port, not inb/outb.
* Reason: LIBC support for inb/outb is hardwired to Alpha EV4 CPU.
+ *
+ * V1.4.3axp: ost@coments.rwth-aachen.de (Martin Ostermann)
+ * Wed May 22 1996, modified to support J option for the Jensen
+ * Reason: on a Jensen the RTC is at 0x170 instead of 0x70
*/
-#define VERSION "1.4.2axp"
+#define VERSION "1.4.3axp"
#define USE_DEV_PORT
@@ -165,6 +169,7 @@
int universal = 0;
int debug = 0;
int arcit = 0;
+int jensen = 0;
const char *pgm_name;
#ifdef USE_DEV_PORT
@@ -182,6 +187,7 @@
" a: get system time and adjust CMOS clock\n"
" u: CMOS clock is in universal time\n"
" A: CMOS clock is in Alpha ARC console time\n"
+ " J: we are running on an Alpha Jensen\n"
" v: print version (" VERSION ") and exit\n", pgm_name
);
exit (1);
@@ -221,14 +227,14 @@
#ifdef USE_DEV_PORT
v = reg | 0x80;
- lseek(dev_port_fd, 0x70, 0);
+ lseek(dev_port_fd, 0x70 + jensen, 0);
write(dev_port_fd, &v, 1);
- lseek(dev_port_fd, 0x71, 0);
+ lseek(dev_port_fd, 0x71 + jensen, 0);
read(dev_port_fd, &v, 1);
return v;
#else
- outb (reg | 0x80, 0x70);
- return inb (0x71);
+ outb (reg | 0x80, 0x70 + jensen);
+ return inb (0x71 + jensen);
#endif
}
@@ -238,14 +244,14 @@
#ifdef USE_DEV_PORT
v = reg | 0x80;
- lseek(dev_port_fd, 0x70, 0);
+ lseek(dev_port_fd, 0x70 + jensen, 0);
write(dev_port_fd, &v, 1);
v = val & 0xff;
- lseek(dev_port_fd, 0x71, 0);
+ lseek(dev_port_fd, 0x71 + jensen, 0);
write(dev_port_fd, &v, 1);
#else
- outb (reg | 0x80, 0x70);
- outb (val, 0x71);
+ outb (reg | 0x80, 0x70 + jensen);
+ outb (val, 0x71 + jensen);
#endif
return 0;
}
@@ -303,7 +309,7 @@
int adjustment = 0;
pgm_name = argv[0];
- while ((arg = getopt (argc, argv, "rwsuaADv")) != -1)
+ while ((arg = getopt (argc, argv, "rwsuaAJDv")) != -1)
{
switch (arg)
{
@@ -324,6 +330,9 @@
break;
case 'A':
arcit = 1;
+ break;
+ case 'J':
+ jensen = 0x100;
break;
case 'D':
debug = 1;
--
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: `/sbin/clock' for the Jensen
@ 1996-05-23 15:21 David Mosberger-Tang
0 siblings, 0 replies; 3+ messages in thread
From: David Mosberger-Tang @ 1996-05-23 15:21 UTC (permalink / raw)
OK, I integrated your changes. There will be other changes to
util-linux so it is able to accomodate glibc, so I thought it would be
best if I have an uptodate source tree. Could you verify that this
patch still works on the Jensen?
--david
--
--- clock.8~ Wed Jan 17 21:43:09 1996
+++ clock.8 Thu May 23 08:13:27 1996
@@ -22,7 +22,10 @@
Indicates that the CMOS clock is set to Universal Time.
.TP
.B \-A
-Indicates that the clock is in the ARC Console's time
+Indicates that the clock is in the ARC Console's time.
+.TP
+.B \-J
+Indicates that the system is a Jensen (DEC Alpha) machine.
.TP
.B \-r
Read CMOS clock and print the result to stdout.
--- clock.c~ Wed Jan 17 21:42:55 1996
+++ clock.c Thu May 23 08:17:11 1996
@@ -133,9 +133,13 @@
* V1.4.2axp: jestabro@amt.tay1.dec.com (Jay Estabrook)
* Wed Jan 10 1996, modified to use /dev/port, not inb/outb.
* Reason: LIBC support for inb/outb is hardwired to Alpha EV4 CPU.
+ *
+ * V1.4.3axp: ost@coments.rwth-aachen.de (Martin Ostermann)
+ * Wed May 22 1996, modified to support J option for the Jensen
+ * Reason: on a Jensen the RTC is at 0x170 instead of 0x70
*/
-#define VERSION "1.4.2axp"
+#define VERSION "1.4.3axp"
#define USE_DEV_PORT
@@ -165,6 +169,7 @@
int universal = 0;
int debug = 0;
int arcit = 0;
+int clockport = 0x70;
const char *pgm_name;
#ifdef USE_DEV_PORT
@@ -182,6 +187,7 @@
" a: get system time and adjust CMOS clock\n"
" u: CMOS clock is in universal time\n"
" A: CMOS clock is in Alpha ARC console time\n"
+ " J: we are running on an Alpha Jensen\n"
" v: print version (" VERSION ") and exit\n", pgm_name
);
exit (1);
@@ -221,14 +227,14 @@
#ifdef USE_DEV_PORT
v = reg | 0x80;
- lseek(dev_port_fd, 0x70, 0);
+ lseek(dev_port_fd, clockport, 0);
write(dev_port_fd, &v, 1);
- lseek(dev_port_fd, 0x71, 0);
+ lseek(dev_port_fd, clockport + 1, 0);
read(dev_port_fd, &v, 1);
return v;
#else
- outb (reg | 0x80, 0x70);
- return inb (0x71);
+ outb (reg | 0x80, clockport);
+ return inb (clockport + 1);
#endif
}
@@ -238,14 +244,14 @@
#ifdef USE_DEV_PORT
v = reg | 0x80;
- lseek(dev_port_fd, 0x70, 0);
+ lseek(dev_port_fd, clockport, 0);
write(dev_port_fd, &v, 1);
v = val & 0xff;
- lseek(dev_port_fd, 0x71, 0);
+ lseek(dev_port_fd, clockport + 1, 0);
write(dev_port_fd, &v, 1);
#else
- outb (reg | 0x80, 0x70);
- outb (val, 0x71);
+ outb (reg | 0x80, clockport);
+ outb (val, clockport + 1);
#endif
return 0;
}
@@ -303,7 +309,7 @@
int adjustment = 0;
pgm_name = argv[0];
- while ((arg = getopt (argc, argv, "rwsuaADv")) != -1)
+ while ((arg = getopt (argc, argv, "rwsuaAJDv")) != -1)
{
switch (arg)
{
@@ -324,6 +330,9 @@
break;
case 'A':
arcit = 1;
+ break;
+ case 'J':
+ clockport = 0x170;
break;
case 'D':
debug = 1;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: `/sbin/clock' for the Jensen
@ 1996-05-23 18:34 Martin Ostermann
0 siblings, 0 replies; 3+ messages in thread
From: Martin Ostermann @ 1996-05-23 18:34 UTC (permalink / raw)
> OK, I integrated your changes. There will be other changes to
> util-linux so it is able to accomodate glibc, so I thought it would be
> best if I have an uptodate source tree. Could you verify that this
> patch still works on the Jensen?
Yes, it works. I apreciate you did it the nice way ;-) (i.e. with
`clockport'). However, looking over the source, I found another reference
to port 0x70, within the function cmos_init(). It's just in the #else tree
of "#ifdef USE_DEV_PORT", but ought to be changed anyhow, in case somebody
needs this.
Bye, 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1996-05-23 18:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-05-23 10:16 `/sbin/clock' for the Jensen Martin Ostermann
-- strict thread matches above, loose matches on Subject: below --
1996-05-23 15:21 David Mosberger-Tang
1996-05-23 18:34 Martin Ostermann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox