Processor-Type and -Level
Roderick Colenbrander
thunderbird2k at gmx.net
Mon Dec 1 14:02:46 CST 2003
Hi,
The problem seems to be a bug in the cpu code. You had almost found it
yourself. If you had scrolled a few more lines down you would have seen that
we are already using /proc/cpuinfo. I think that bug is in the following
piece of code. When the cpu is a p2/p3/p4/p-m/ppro we set wProcessorLevel to
5 while it needs to be 6:
....
case 4: cachedsi.dwProcessorType = PROCESSOR_INTEL_486;
cachedsi.wProcessorLevel= 4;
break;
case 5:
case 6: /* PPro/2/3 has same info as P1 */
cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
cachedsi.wProcessorLevel= 5;
break;
....
So I think you just need to change the switch statement to fix the problem.
Roderick
On Monday 01 December 2003 20:22, Olaf Leidinger wrote:
> Hello!
>
> Once I tried to install the win32 version of gimp-1.3.xx-i686 using wine
> and the installer refused to install because gimp was only compiled for
> newer processors. The author told me, that he uses the GetSystemInfo
> function to get the data he needs.
>
> Running a modified MS-example on wine I get this result:
>
> Hardware information:
> OEM ID: 0
> Number of processors: 1
> Page size: 4096
> Processor type: 586
> Processor Level: 5
> Processor Revision: 0
> Minimum application address: 10000
> Maximum application address: 7fffffff
> Active processor mask: 1
>
> And the same on Win2k I get this output:
>
> Hardware information:
> OEM ID: 0
> Number of processors: 1
> Page size: 4096
> Processor type: 586
> Processor Level: 6
> Processor Revision: 2560
> Minimum application address: 10000
> Maximum application address: 7ffeffff
> Active processor mask: 1
>
> Note - I am using an athlon-xp.
>
> /********** some source ***********/
> #include <windows.h>
> #include <stdio.h>
>
> int main()
> {
> SYSTEM_INFO siSysInfo;
>
> // Copy the hardware information to the SYSTEM_INFO structure.
>
> GetSystemInfo(&siSysInfo);
>
> // Display the contents of the SYSTEM_INFO structure.
>
> printf("Hardware information: \n");
> printf(" OEM ID: %u\n", siSysInfo.dwOemId);
> printf(" Number of processors: %u\n",
> siSysInfo.dwNumberOfProcessors);
> printf(" Page size: %u\n", siSysInfo.dwPageSize);
> printf(" Processor type: %u\n", siSysInfo.dwProcessorType);
> printf(" Processor Level: %u\n", siSysInfo.wProcessorLevel);
> printf(" Processor Revision: %u\n", siSysInfo.wProcessorRevision);
> printf(" Minimum application address: %lx\n",
> siSysInfo.lpMinimumApplicationAddress);
> printf(" Maximum application address: %lx\n",
> siSysInfo.lpMaximumApplicationAddress);
> printf(" Active processor mask: %u\n",
> siSysInfo.dwActiveProcessorMask);
>
> return 1;
> }
>
> /********** end of some source ***********/
>
> To bring a long story to an end:
> I had a look at cpu.c from dll/kernel directory and I found this part:
> [line 251]
> /* FIXME: the two entries below should be computed somehow... */
> cachedsi.lpMinimumApplicationAddress = (void *)0x00010000;
> cachedsi.lpMaximumApplicationAddress = (void *)0x7FFFFFFF;
> cachedsi.dwActiveProcessorMask = 1;
> cachedsi.dwNumberOfProcessors = 1;
> cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
> cachedsi.dwAllocationGranularity = 0x10000;
> cachedsi.wProcessorLevel = 5; /* 586 */
> cachedsi.wProcessorRevision = 0;
>
> So the corresponding values are compiled in.
>
> Either we change wProcessorLevel to 6 or get it from the running system.
> I'd prefer the later ;-)
>
> When I have some free time I could -perhaps- try to fix it but I've
> never changed something in the wine source. Does anybody have any
> proposals of how to change it in an acceptable manner?
>
> I know that all the information I need can be read from /proc/cpuinfo -
> but perhaps there is an easier way then reading it from there as I don't
> know if it is still there in 2.6.
>
> Ciao,
>
> Olaf Leidinger
More information about the wine-devel
mailing list