Date: Tue, 9 Mar 2004 15:46:13 -0800 (PST) From: Doom Neine <shockwavebsd@yahoo.com> To: Bin Ren <br260@cam.ac.uk> Cc: freebsd-current@freebsd.org Subject: Re: garbage string as cpu identifier Message-ID: <20040309234613.94128.qmail@web13125.mail.yahoo.com> In-Reply-To: <E1B0qX3-0000br-1g.--93224ea63ae8d43c43902c38e64863b3a23db22f@maroon.csi.cam.ac.uk>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
sorry but it failed with the following:
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- identcpu.c Fri Mar 5 03:28:32 2004
|+++ identcpu.c.new Tue Mar 9 23:11:53 2004
-------------------------
Patching file identcpu.c using Plan A...
Hunk #1 failed at 572.
1 out of 1 hunks failed--saving rejects to
identcpu.c.rej
done
i haven't looked through this identcpu.c.rej yet but
i'm attaching it to this email
thanks
--- Bin Ren <br260@cam.ac.uk> wrote:
> Try:
>
> save the patch as patch-identcpu
>
> cp patch-identcpu /usr/src/sys/i386/i386
> cd /usr/src/sys/i386/i386
> patch < patch-identcpu
>
> then compile your kernel and reboot. I
> expect to see your CPU ID as:
> "garbage chars from cpuid"
>
> Please try and see whether this is the case.
>
> -- Bin
>
>
> --- identcpu.c Fri Mar 5 03:28:32 2004
> +++ identcpu.c.new Tue Mar 9 23:11:53 2004
> @@ -572,8 +572,17 @@
> brand = cpu_brand;
> while (*brand == ' ')
> ++brand;
> - if (*brand != '\0')
> - strcpy(cpu_model, brand);
> + if (*brand != '\0') {
> + char *c;
> + for (c = brand; c < cpu_brand+48 &&
> *c; c++)
> + if (*c < '!' || *c > '~')
> + break;
> +
> + if (c < cpu_brand+48 && *c)
> + strcpy(cpu_model, "garbage
> chars from cpuid");
> + else
> + strcpy(cpu_model, brand);
> + }
>
> #endif
>
>
__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com
[-- Attachment #2 --]
***************
*** 572,579 ****
brand = cpu_brand;
while (*brand == ' ')
++brand;
- if (*brand != '\0')
- strcpy(cpu_model, brand);
#endif
--- 572,588 ----
brand = cpu_brand;
while (*brand == ' ')
++brand;
+ if (*brand != '\0') {
+ char *c;
+ for (c = brand; c < cpu_brand+48 && *c; c++)
+ if (*c < '!' || *c > '~')
+ break;
+
+ if (c < cpu_brand+48 && *c)
+ strcpy(cpu_model, "garbage chars from cpuid");
+ else
+ strcpy(cpu_model, brand);
+ }
#endif
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040309234613.94128.qmail>
