From: Martin Ostermann <ost@comnets.rwth-aachen.de>
Subject: `/sbin/clock' for the Jensen
Date: Thu, 23 May 1996 12:16:52 +0200 [thread overview]
Message-ID: <199605231016.MAA05656@smeagol.comnets.rwth-aachen.de> (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
next reply other threads:[~1996-05-23 10:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-05-23 10:16 Martin Ostermann [this message]
-- strict thread matches above, loose matches on Subject: below --
1996-05-23 15:21 `/sbin/clock' for the Jensen David Mosberger-Tang
1996-05-23 18:34 Martin Ostermann
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox