2002-03-12 01:42:50

by Shawn Starr

[permalink] [raw]
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.



2002-03-12 03:15:15

by Keith Owens

[permalink] [raw]
Subject: Re: uname reports 'unknown'

On 11 Mar 2002 20:43:37 -0500,
Shawn Starr <[email protected]> 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.

2002-03-12 05:17:02

by Joe

[permalink] [raw]
Subject: Re: uname reports 'unknown'

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


2002-03-12 11:59:54

by Davidovac Zoran

[permalink] [raw]
Subject: Re: uname reports 'unknown'

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 <[email protected]>
> To: Linux <[email protected]>
> 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 [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

2002-03-12 22:58:49

by Shawn Starr

[permalink] [raw]
Subject: Re: uname reports 'unknown'

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 <[email protected]> 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.
>
>


2002-03-12 23:23:20

by Keith Owens

[permalink] [raw]
Subject: Re: uname reports 'unknown'

On 12 Mar 2002 17:59:53 -0500,
Shawn Starr <[email protected]> wrote:
>Perhaps it should display P54C which is my P200 processor type?

Talk to sh-utils, uname -p is not kernel defined.

2002-03-12 23:38:31

by jjs

[permalink] [raw]
Subject: Re: uname reports 'unknown'

Keith Owens wrote:

>On 12 Mar 2002 17:59:53 -0500,
>Shawn Starr <[email protected]> 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



2002-03-13 00:46:29

by Carlos E. Gorges

[permalink] [raw]
Subject: Re: uname reports 'unknown'

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 <[email protected]> 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
([email protected])
Tech inform?tica LTDA
Brazil
_________________________

2002-03-13 19:27:29

by David Ford

[permalink] [raw]
Subject: Re: uname reports 'unknown'

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



2002-03-13 21:11:34

by jjs

[permalink] [raw]
Subject: Re: uname reports 'unknown'

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
>
>
>
>