* uname reports 'unknown'
@ 2002-03-12 1:43 Shawn Starr
2002-03-12 3:14 ` Keith Owens
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Shawn Starr @ 2002-03-12 1:43 UTC (permalink / raw)
To: Linux
Linux coredump 2.4.19-pre2-ac4-xfs-shawn10 #2 Mon Mar 11 03:36:35 EST
2002 i586 unknown
what should 'unknown' really be? I've never seen it different on Intel
systems.
Shawn.
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: uname reports 'unknown' 2002-03-12 1:43 uname reports 'unknown' Shawn Starr @ 2002-03-12 3:14 ` Keith Owens 2002-03-12 22:59 ` Shawn Starr 2002-03-12 5:16 ` J Sloan 2002-03-12 11:59 ` Davidovac Zoran 2 siblings, 1 reply; 10+ messages in thread From: Keith Owens @ 2002-03-12 3:14 UTC (permalink / raw) To: Shawn Starr; +Cc: Linux On 11 Mar 2002 20:43:37 -0500, Shawn Starr <spstarr@sh0n.net> wrote: >Linux coredump 2.4.19-pre2-ac4-xfs-shawn10 #2 Mon Mar 11 03:36:35 EST >2002 i586 unknown > > >what should 'unknown' really be? I've never seen it different on Intel >systems. 'unknown' is the output from uname -p, host processor type. That field is not supported in the Linux kernel. uname.c in sh-utils has this #if defined (HAVE_SYSINFO) && defined (SI_ARCHITECTURE) if (sysinfo (SI_ARCHITECTURE, processor, sizeof (processor)) == -1) error (1, errno, _("cannot get processor type")); #else strcpy (processor, "unknown"); #endif HAVE_SYSINFO is always false in sh-utils and SI_ARCHITECTURE is not defined in glibc so you always get unknown. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: uname reports 'unknown' 2002-03-12 3:14 ` Keith Owens @ 2002-03-12 22:59 ` Shawn Starr 2002-03-12 23:22 ` Keith Owens 0 siblings, 1 reply; 10+ messages in thread From: Shawn Starr @ 2002-03-12 22:59 UTC (permalink / raw) To: Keith Owens; +Cc: Linux Perhaps it should display P54C which is my P200 processor type? On Mon, 2002-03-11 at 22:14, Keith Owens wrote: > On 11 Mar 2002 20:43:37 -0500, > Shawn Starr <spstarr@sh0n.net> wrote: > >Linux coredump 2.4.19-pre2-ac4-xfs-shawn10 #2 Mon Mar 11 03:36:35 EST > >2002 i586 unknown > > > > > >what should 'unknown' really be? I've never seen it different on Intel > >systems. > > 'unknown' is the output from uname -p, host processor type. That field > is not supported in the Linux kernel. uname.c in sh-utils has this > > #if defined (HAVE_SYSINFO) && defined (SI_ARCHITECTURE) > if (sysinfo (SI_ARCHITECTURE, processor, sizeof (processor)) == -1) > error (1, errno, _("cannot get processor type")); > #else > strcpy (processor, "unknown"); > #endif > > HAVE_SYSINFO is always false in sh-utils and SI_ARCHITECTURE is not > defined in glibc so you always get unknown. > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: uname reports 'unknown' 2002-03-12 22:59 ` Shawn Starr @ 2002-03-12 23:22 ` Keith Owens 2002-03-12 23:37 ` J Sloan 0 siblings, 1 reply; 10+ messages in thread From: Keith Owens @ 2002-03-12 23:22 UTC (permalink / raw) To: Shawn Starr; +Cc: Linux On 12 Mar 2002 17:59:53 -0500, Shawn Starr <spstarr@sh0n.net> wrote: >Perhaps it should display P54C which is my P200 processor type? Talk to sh-utils, uname -p is not kernel defined. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: uname reports 'unknown' 2002-03-12 23:22 ` Keith Owens @ 2002-03-12 23:37 ` J Sloan 2002-03-13 0:46 ` Carlos E Gorges 0 siblings, 1 reply; 10+ messages in thread From: J Sloan @ 2002-03-12 23:37 UTC (permalink / raw) To: Keith Owens; +Cc: Shawn Starr, Linux Keith Owens wrote: >On 12 Mar 2002 17:59:53 -0500, >Shawn Starr <spstarr@sh0n.net> wrote: > >>Perhaps it should display P54C which is my P200 processor type? >> > >Talk to sh-utils, uname -p is not kernel defined. > Yes the kernel part is fine, has been fine. sh-utils comes with a broken uname, but the patch is trivial - wonder when the vendors will pick it up, it works fine here - Linux uranium 2.4.19-pre2aa1 #1 Thu Mar 7 12:33:56 PST 2002 i686 GenuineIntel Joe ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: uname reports 'unknown' 2002-03-12 23:37 ` J Sloan @ 2002-03-13 0:46 ` Carlos E Gorges 0 siblings, 0 replies; 10+ messages in thread From: Carlos E Gorges @ 2002-03-13 0:46 UTC (permalink / raw) To: Linux On Tue 12 Mar 2002 20:37, J Sloan wrote: Try w/ this patch. --- sh-utils-2.0.11/src/uname.c Sat May 6 11:17:53 2000 +++ sh-utils-2.0.11-carlos/src/uname.c Tue Mar 12 21:42:02 2002 @@ -48,6 +48,7 @@ #define AUTHORS "David MacKenzie" static void print_element PARAMS ((unsigned int mask, char *element)); +void __sysinfo_processor_type(char*); /* Values that are bitwise or'd into `toprint'. */ /* Operating system name. */ @@ -118,7 +119,7 @@ { struct utsname name; int c; - char processor[256]; + char processor[BUFSIZ]; program_name = argv[0]; setlocale (LC_ALL, ""); @@ -183,12 +184,7 @@ if (uname (&name) == -1) error (1, errno, _("cannot get system name")); -#if defined (HAVE_SYSINFO) && defined (SI_ARCHITECTURE) - if (sysinfo (SI_ARCHITECTURE, processor, sizeof (processor)) == -1) - error (1, errno, _("cannot get processor type")); -#else - strcpy (processor, "unknown"); -#endif + __sysinfo_processor_type(processor); print_element (PRINT_SYSNAME, name.sysname); print_element (PRINT_NODENAME, name.nodename); @@ -213,3 +209,25 @@ printf ("%s%c", element, toprint ? ' ' : '\n'); } } + + +/* Carlos E. Gorges +return vendor_id from proc cpuinfo +*/ + +void +__sysinfo_processor_type (char* proc_info) { + FILE *ffd; + char temp_string[BUFSIZ],final_string[BUFSIZ]="unknown"; + + if ((ffd=fopen("/proc/cpuinfo", "r") )!=NULL) { + while ( fscanf(ffd, "%s :", temp_string) != EOF) + if (!(strcmp(temp_string, "vendor_id"))) { + fscanf(ffd, "%s", final_string); + break; + } + fclose(ffd); + } + strncpy(proc_info,final_string,BUFSIZ); +} + --- > Keith Owens wrote: > >On 12 Mar 2002 17:59:53 -0500, > > > >Shawn Starr <spstarr@sh0n.net> wrote: > >>Perhaps it should display P54C which is my P200 processor type? > > > >Talk to sh-utils, uname -p is not kernel defined. > > Yes the kernel part is fine, has been fine. > > sh-utils comes with a broken uname, but the > patch is trivial - wonder when the vendors > will pick it up, it works fine here - > > Linux uranium 2.4.19-pre2aa1 #1 Thu Mar 7 12:33:56 PST 2002 i686 > GenuineIntel > > Joe -- _________________________ Carlos E Gorges (carlos@techlinux.com.br) Tech informática LTDA Brazil _________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: uname reports 'unknown' 2002-03-12 1:43 uname reports 'unknown' Shawn Starr 2002-03-12 3:14 ` Keith Owens @ 2002-03-12 5:16 ` J Sloan 2002-03-13 19:26 ` David Ford 2002-03-12 11:59 ` Davidovac Zoran 2 siblings, 1 reply; 10+ messages in thread From: J Sloan @ 2002-03-12 5:16 UTC (permalink / raw) To: Shawn Starr; +Cc: Linux Shawn Starr wrote: >Linux coredump 2.4.19-pre2-ac4-xfs-shawn10 #2 Mon Mar 11 03:36:35 EST >2002 i586 unknown > > >what should 'unknown' really be? I've never seen it different on Intel >systems. > Many vendors ship a broken sh-utils. They don't have to: Linux neo.mirai.cx 2.4.19-pre2aa1 #1 Fri Mar 8 19:55:24 PST 2002 i686 GenuineIntel Linux emerald.mirai.cx 2.4.19pre1aa1 #1 Sat Mar 2 20:55:06 PST 2002 i586 AuthenticAMD Cheers, Joe ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: uname reports 'unknown' 2002-03-12 5:16 ` J Sloan @ 2002-03-13 19:26 ` David Ford 2002-03-13 21:10 ` J Sloan 0 siblings, 1 reply; 10+ messages in thread From: David Ford @ 2002-03-13 19:26 UTC (permalink / raw) To: J Sloan; +Cc: Shawn Starr, Linux Seems to me that it is the fault of the original package of 'sh-utils'. -d J Sloan wrote: > Shawn Starr wrote: > >> Linux coredump 2.4.19-pre2-ac4-xfs-shawn10 #2 Mon Mar 11 03:36:35 EST >> 2002 i586 unknown >> >> >> what should 'unknown' really be? I've never seen it different on Intel >> systems. >> > > Many vendors ship a broken sh-utils. > > They don't have to: > > Linux neo.mirai.cx 2.4.19-pre2aa1 #1 Fri Mar 8 19:55:24 PST 2002 i686 > GenuineIntel > > Linux emerald.mirai.cx 2.4.19pre1aa1 #1 Sat Mar 2 20:55:06 PST 2002 > i586 AuthenticAMD > > Cheers, > > Joe ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: uname reports 'unknown' 2002-03-13 19:26 ` David Ford @ 2002-03-13 21:10 ` J Sloan 0 siblings, 0 replies; 10+ messages in thread From: J Sloan @ 2002-03-13 21:10 UTC (permalink / raw) To: David Ford; +Cc: linux So it would seem, since the fix is easy... Maybe it's a portability concern... Joe David Ford wrote: > Seems to me that it is the fault of the original package of 'sh-utils'. > > -d > > J Sloan wrote: > >> Shawn Starr wrote: >> >>> Linux coredump 2.4.19-pre2-ac4-xfs-shawn10 #2 Mon Mar 11 03:36:35 EST >>> 2002 i586 unknown >>> >>> >>> what should 'unknown' really be? I've never seen it different on Intel >>> systems. >>> >> >> Many vendors ship a broken sh-utils. >> >> They don't have to: >> >> Linux neo.mirai.cx 2.4.19-pre2aa1 #1 Fri Mar 8 19:55:24 PST 2002 i686 >> GenuineIntel >> >> Linux emerald.mirai.cx 2.4.19pre1aa1 #1 Sat Mar 2 20:55:06 PST 2002 >> i586 AuthenticAMD >> >> Cheers, >> >> Joe > > > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: uname reports 'unknown' 2002-03-12 1:43 uname reports 'unknown' Shawn Starr 2002-03-12 3:14 ` Keith Owens 2002-03-12 5:16 ` J Sloan @ 2002-03-12 11:59 ` Davidovac Zoran 2 siblings, 0 replies; 10+ messages in thread From: Davidovac Zoran @ 2002-03-12 11:59 UTC (permalink / raw) To: Shawn Starr; +Cc: Linux same here, perhaps it is time to rewrite uname, to use /proc/cpuinfo ? root@www:~# uname -a Linux www 2.2.20 #1 Wed Feb 6 11:23:03 CET 2002 i686 unknown root@www:~# more /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 5 model name : Pentium II (Deschutes) stepping : 2 cpu MHz : 350.798 cache size : 512 KB fdiv_bug : no hlt_bug : no sep_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr bogomips On 11 Mar 2002, Shawn Starr wrote: > Date: 11 Mar 2002 20:43:37 -0500 > From: Shawn Starr <spstarr@sh0n.net> > To: Linux <linux-kernel@vger.kernel.org> > Subject: uname reports 'unknown' > > Linux coredump 2.4.19-pre2-ac4-xfs-shawn10 #2 Mon Mar 11 03:36:35 EST > 2002 i586 unknown > > > what should 'unknown' really be? I've never seen it different on Intel > systems. > > Shawn. > > > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2002-03-13 21:11 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2002-03-12 1:43 uname reports 'unknown' Shawn Starr 2002-03-12 3:14 ` Keith Owens 2002-03-12 22:59 ` Shawn Starr 2002-03-12 23:22 ` Keith Owens 2002-03-12 23:37 ` J Sloan 2002-03-13 0:46 ` Carlos E Gorges 2002-03-12 5:16 ` J Sloan 2002-03-13 19:26 ` David Ford 2002-03-13 21:10 ` J Sloan 2002-03-12 11:59 ` Davidovac Zoran
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox