From: Martin Ostermann <ost@comnets.rwth-aachen.de>
Subject: Jensen autodedect for /sbin/clock
Date: Sun, 16 Jun 1996 13:09:58 +0200 [thread overview]
Message-ID: <948815ad3140d74db07b56233354ca30.axp-list@archive.invalid> (raw)
Erik Troan suggest to use /proc/cpuinfo to identify a Jensen
automatically. Insert the following code before the call to cmos_init
to accomplish this:
if (clockport != 0x170) { /* use jensen!=0x100 if you use my
original patch */
FILE *cpuinfo;
char field[80];
if(cpuinfo = fopen("/proc/cpuinfo","r")){
while(!feof(cpuinfo)){
if(1==fscanf(cpuinfo,"system type : %s",field)){
if (0==strcmp(field,"Jensen"))
clockport = 0x170;
/* use jensen=0x100; if you use my original patch */
fclose(cpuinfo);
break;
}
fgets(field,80,cpuinfo);
}
fclose(cpuinfo);
}
}
--
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
reply other threads:[~1996-06-16 11:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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