Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   core2duotemp.c to core2duotemp.pas (https://www.delphipraxis.net/97137-core2duotemp-c-core2duotemp-pas.html)

hathor 9. Nov 2007 11:39

Re: core2duotemp.c to core2duotemp.pas
 
ExpressOrgChart by Developer Express Inc

What's this???

I accept source code only!

Razor 9. Nov 2007 11:43

Re: core2duotemp.c to core2duotemp.pas
 
this is perfectly ok just test it and report what does it report when reading msrs.Becouse i get 0

Razor 9. Nov 2007 13:08

Re: core2duotemp.c to core2duotemp.pas
 
Can someone test?

Phoenix 9. Nov 2007 13:27

Re: core2duotemp.c to core2duotemp.pas
 
Razor: I'm personally going to ask our Admin, Daniel, to temporarily ban your account for at least 48 hours if you are pushing only a single more time! Treat this as a very, very last warning.

You have been told multiple times that pushing is not allowed. So do not push again.

Razor 9. Nov 2007 13:29

Re: core2duotemp.c to core2duotemp.pas
 
Reply to my PM!And take action!

Hador 9. Nov 2007 14:09

Re: core2duotemp.c to core2duotemp.pas
 
EDIT: Ich habe doch glatt eine Seite übersehen und auf 'n uralten Post geantwortet, sry :wall:

Razor 9. Nov 2007 14:13

Re: core2duotemp.c to core2duotemp.pas
 
Yea and? :)

Razor 7. Mai 2008 21:47

Re: core2duotemp.c to core2duotemp.pas
 
Well any new news on this?Seems nobody cares about this topic or is it just me

hathor 29. Mai 2008 20:13

Re: core2duotemp.c to core2duotemp.pas
 
Zitat:

Zitat von Razor
Well any new news on this?Seems nobody cares about this topic or is it just me

Look@here:
http://www.delphipraxis.net/internal...=893921#893921

Razor 29. Mai 2008 20:17

Re: core2duotemp.c to core2duotemp.pas
 
Ahh hathor tooo late!You are late...

I've made it 2 months ago.. aswell my driver and the K8(Athlon 64,Athlon X2) and K10(Phenom X4 and X3 and Opteron) readings all internal sensor.Shows same as coretemp..I did it my own no forum asking nothing..so yes :lol:

Delphi-Quellcode:
  function intelcore(cpuaffinity:dword):string;
var
msrvalue:tmsr;
eax,x,edx:dword;
s:string;
o:integer;

begin

RDMSRex($19C,msrvalue,cpuaffinity);
If msrvalue.LowPart and $8000 > 0 then
begin

x := eax;
x:=x shr 16 and $0000ff     ;
s:=Format('%8.8x', [x]);
o:=TJunction-HexToInt(S);
result:=inttostr(o)+' °C';
end;
end;
//Rdmsr($EE,msrvalue);
//IF msrvalue.HiPart and $40000000 = 0 then TJunction := 100 Else TJunction := 85;

hathor 29. Mai 2008 21:30

Re: core2duotemp.c to core2duotemp.pas
 
Zitat:

Zitat von Razor
...I've made it 2 months ago.. aswell my driver and the K8(Athlon 64,Athlon X2) and K10(Phenom X4 and X3 and Opteron) readings all internal sensor.Shows same as coretemp..I did it my own no forum asking nothing..so yes :lol:

:gruebel:
...and what about TJunction := 105, if NOT TJunction := 100 and NOT TJunction := 85 ??? :gruebel:

Razor 29. Mai 2008 21:32

Re: core2duotemp.c to core2duotemp.pas
 
Zitat:

Zitat von hathor
Zitat:

Zitat von Razor
...I've made it 2 months ago.. aswell my driver and the K8(Athlon 64,Athlon X2) and K10(Phenom X4 and X3 and Opteron) readings all internal sensor.Shows same as coretemp..I did it my own no forum asking nothing..so yes :lol:

:gruebel:
...and what about TJunction := 105, if NOT TJunction := 100 and NOT TJunction := 85 ??? :gruebel:

What!:D You cant read the code...

Use this.

Delphi-Quellcode:
var
tjunction:integer;<<must be global var

Rdmsr($EE,msrvalue);
IF msrvalue.HiPart and $40000000 = 0 then TJunction := 100 Else TJunction := 85;

hathor 29. Mai 2008 22:20

Re: core2duotemp.c to core2duotemp.pas
 
Zitat:

Zitat von Razor
Zitat:

Zitat von hathor
Zitat:

Zitat von Razor
...I've made it 2 months ago.. aswell my driver and the K8(Athlon 64,Athlon X2) and K10(Phenom X4 and X3 and Opteron) readings all internal sensor.Shows same as coretemp..I did it my own no forum asking nothing..so yes :lol:

:gruebel:
...and what about TJunction := 105, if NOT TJunction := 100 and NOT TJunction := 85 ??? :gruebel:

What!:D You cant read the code...

Use this.

Delphi-Quellcode:
var
tjunction:integer;<<must be global var

Rdmsr($EE,msrvalue);
IF msrvalue.HiPart and $40000000 = 0 then TJunction := 100 Else TJunction := 85;

I'm sorry - but YOU can't read Your own code - where is a value of 105???

Muetze1 30. Mai 2008 01:41

Re: core2duotemp.c to core2duotemp.pas
 
Zitat:

Zitat von Razor
I've made it 2 months ago.. aswell my driver and the K8(Athlon 64,Athlon X2) and K10(Phenom X4 and X3 and Opteron) readings all internal sensor.Shows same as coretemp..I did it my own no forum asking nothing..so yes :lol:

Yes, no forum asking - just ICQ...

devidespe 30. Mai 2008 10:45

Re: core2duotemp.c to core2duotemp.pas
 
Zitat:

Zitat von hathor
I'm sorry - but YOU can't read Your own code - where is a value of 105???

@Razor: The technical way of reading MSR's with a driver is one thing, the correct detection of TjMax is another one. In the meantime I'm having no doubt, that you've managed the first thing well.

But the correct detection of TjMax is a huge discussion within the web, and we have here 2 ways of doing this. The first one is the creation of a CPUID table, where you can set the TjMax value for various processor types and steppings. The other way is the usage of MSR EEh, where you have to different between 85, 100 and 105 °C. Some programs use 95 °C as well. Please see the following links to read the discussions and extend your knowledge:

RealTemp Discussion
SpeedFan discussion
Everest discussion

Razor 30. Mai 2008 14:22

Re: core2duotemp.c to core2duotemp.pas
 
How to detect all of these Deltas can some one please tell me? :o

My read temperature is the same as core temp's so there isnt no bad code in my code.
Yes Muetze you gave me tips but you didnt code it;).

devidespe 30. Mai 2008 14:54

Re: core2duotemp.c to core2duotemp.pas
 
Why don't you simply upload your application for all of us ?

Its hard to give a solid feedback if you haven't any practical application, just source parts.

Razor 30. Mai 2008 14:55

Re: core2duotemp.c to core2duotemp.pas
 
Yes however how can i SetThreadAffinityMask with JVCL thread timer?
Devidespe can you help me with this?Does this mean i have to use 4 threads?
After this i upload the app

I tryed this

SetThreadAffinityMask(jvthreadtimer1.Thread.Handle ,$0001);
SetThreadAffinityMask(jvthreadtimer1.Thread.Handle ,$0001);

Muetze1 30. Mai 2008 15:16

Re: core2duotemp.c to core2duotemp.pas
 
Zitat:

Zitat von Razor
Yes Muetze you gave me tips but you didnt code it;).

Yes, I did this all before and I even send the correct code, but it was scrambled by ICQ emoicons.

Zitat:

Zitat von Razor
I tryed this
Code:
SetThreadAffinityMask(jvthreadtimer1.Thread.Handle,$0001);
SetThreadAffinityMask(jvthreadtimer1.Thread.Handle,$0001);

RTFM. This is just so ease to change, you just have to read the MSDN. And the best thing: we dealed with this together with icq, it seems to me, that you have not read or understand the whole session.

But anyway, this is not the way to solve the actual problem discussed here.

Razor 30. Mai 2008 15:25

Re: core2duotemp.c to core2duotemp.pas
 
1 shl ProcNumber(CPUIndex) } like this?

Zitat:

RTFM. This is just so ease to change, you just have to read the MSDN. And the best thing: we dealed with this together with icq, it seems to me, that you have not read or understand the whole session.
Its not easy for me and i have read it 3 times.Nothing about the dwaffinity mask parameter.
It doesnt change even if i put in $0001,$0002,$0004,$0008 it just wont change.

devidespe 30. Mai 2008 15:31

Re: core2duotemp.c to core2duotemp.pas
 
Actually like this:

Delphi-Quellcode:
FUNCTION SetProcessorNr(Nr : Byte) : Boolean; {0 until 31}
VAR Process : THandle;
BEGIN
  Process:=GetCurrentProcess;
  Result:=SetProcessAffinityMask(Process, (1 SHL Nr));
END;
This function must run within a FOR-TO-DO loop to set the processors. The number of processors (which is part of the FOR-TO-DO loop) can be detected by using the GetSystemInfo function (here), where the SYSTEM_INFO structure (here again) contains the value dwNumberOfProcessors as DWord.

Hope that helps.

Razor 30. Mai 2008 15:48

Re: core2duotemp.c to core2duotemp.pas
 
Well this wont work


Delphi-Quellcode:
procedure TMainFrm.JvThreadTimer1Timer(Sender: TObject);
var
msr:tmsr;
omcdrv:tmsrio;
x:dword;
s:string;
o:integer;
begin
SetThreadAffinityMask(jvthreadtimer1.Thread.Handle,$0008);//for the 4th core
omcdrv.ReadMSR($19C,msr);

x := msr.LowPart;
x:=x shr 16 and $0000ff     ;
s:=Format('%8.8x', [x]);
o:=100-HexToInt(S);
rzlabel8.caption:=inttostr(o)+' °C';
end;

Razor 30. Mai 2008 16:03

Re: core2duotemp.c to core2duotemp.pas
 
Ok ok i wrote a function however it dosent do its job very well...

Delphi-Quellcode:
Function IntelCore(ThreadAffinity:Cardinal;Mask:dword):string;
var
msr:tmsr;
omcdrv:tmsrio;
x:dword;
s:string;
o:integer;
begin
SetThreadAffinityMask(ThreadAffinity,mask);
omcdrv.ReadMSR($19C,msr);

x := msr.LowPart;
x:=x shr 16 and $0000ff     ;
s:=Format('%8.8x', [x]);
o:=100-HexToInt(S);
result:=inttostr(o)+' °C';
end;

Am i confused couse i cant figure the mask for the thread....please! :wall:

Muetze1 30. Mai 2008 21:49

Re: core2duotemp.c to core2duotemp.pas
 
Zitat:

Zitat von Razor
Delphi-Quellcode:
...
s:=Format('%8.8x', [x]);
o:=100-HexToInt(S);
...

Oh my god. So I see, you have not learned anything. All I see in this small part, that you have not understand something from our ICQ contact. It is really sad to this...

Zitat:

Zitat von Razor
Am i confused couse i cant figure the mask for the thread....please! :wall:

You use a external ring-0 driver, so this setting in your application/process/thread will not change anything. Your driver offers the option to pass the affinity mask within the calls. You have to use this parameter. Any call to SetProcessAffinityMask() or to SetThreadAffinityMask() will only be honoured by code in your application/thread. As I know, you do nothing inside your app, so it is useless.

Learn the things you do and stop copying!

devidespe 31. Mai 2008 10:13

Re: core2duotemp.c to core2duotemp.pas
 
Zitat:

Zitat von Muetze1
You use a external ring-0 driver, so this setting in your application/process/thread will not change anything. Your driver offers the option to pass the affinity mask within the calls. You have to use this parameter. Any call to SetProcessAffinityMask() or to SetThreadAffinityMask() will only be honoured by code in your application/thread. As I know, you do nothing inside your app, so it is useless.

Thats right, but for that you have to use the RdmsrEx function instead of Rdmsr. Only the RdmsrEx function contains the AffinityMask as DWord Pointer.

I hope he can solve this problem... At least there is a C and C++ sample, which demonstrates how to use this affinity setting.

Razor 31. Mai 2008 10:51

Re: core2duotemp.c to core2duotemp.pas
 
Liste der Anhänge anzeigen (Anzahl: 1)
Guys i already did that with the RdMsrEx it works fine it was ment for other driver but ok.


Now another problemo Cpu detection and cpuid...i guess thats hard as hell. :gruebel:


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:13 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz