Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Jensen autodedect for /sbin/clock
@ 1996-06-16 11:09 Martin Ostermann
  0 siblings, 0 replies; only message in thread
From: Martin Ostermann @ 1996-06-16 11:09 UTC (permalink / 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-06-16 11:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-06-16 11:09 Jensen autodedect for /sbin/clock Martin Ostermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox