*CPUID 2.17 from Wildwest

*skinsel from diamond
*end, menu, @panel - more stable with different system colors
*@rb - new menu
*@panel - fixed drawing cpu usage in QEMU and maybe on some real comps

git-svn-id: svn://kolibrios.org@318 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
heavyiron 2007-02-04 01:47:46 +00:00
parent 4256086104
commit 577eed1321
15 changed files with 2770 additions and 346 deletions

View File

@ -2,17 +2,18 @@
; project name: CPUID * ; project name: CPUID *
; target platform: KolibriOS, x86 (IA-32), x86-64 achitectures * ; target platform: KolibriOS, x86 (IA-32), x86-64 achitectures *
; compiler: flat assembler 1.67.5 * ; compiler: flat assembler 1.67.5 *
; version: 2.05 * ; version: 2.17 *
; last update: 1st November 2006 1st 2nd 3rd 4th * ; last update: 3rd February 2007 1st 2nd 3rd 4th *
; maintained by: Sergey Kuzmin aka Wildwest * ; maintained by: Sergey Kuzmin aka Wildwest *
; e-mail: kuzmin_serg@list.ru * ; e-mail: kuzmin_serg@list.ru *
; site: http://coolthemes.narod.ru/files.html * ; site: http://coolthemes.narod.ru/files.html *
; license: Copyright 2004-2006 Sergey Kuzmin and coauthors * ; license: Copyright 2004-2007 Sergey Kuzmin and co-authors *
; Rules: * ; Rules: *
; 1)you can use pieces of code in your project, but should * ; 1)you can use pieces of code in your project, but should *
; mention original author; * ; mention the original author (include copyright notice); *
; 2)if you modify CPUID (improve, port, translate, etc) send * ; 2)if you modify CPUID (improve, port, translate, etc) send *
; your changes to maintainer or KolibriOS project leader * ; your changes to the maintainer or make about post changes*
; at forum http://meos.sysbin.com *
;-----------------------------------------------------------------------------* ;-----------------------------------------------------------------------------*
; English comments * ; English comments *
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
@ -34,16 +35,22 @@ macro udata
} }
include 'mos_uzel.inc' include 'mos_uzel.inc'
; useful macroses and some required stuff ; useful macroses and Brand ID decoding
include 'caches.inc'
;(L1 and L2 cashes decoding for Intel) ;(L1 and L2 cashes decoding for Intel)
include 'multipli.inc'
;(multiplier decoding)
include 'features.inc'
;(features decoding)
include 'gif2img.inc' include 'gif2img.inc'
; include macro to convert gif to img ; include macros to convert gif to img
;include 'debug.inc'
include 'rsatest.inc' include 'rsatest.inc'
include 'variable.inc' include 'variable.inc'
START: ; LET'S GO!!! START: ; LET'S GO!!!
;------------ ;------------
CYCLES: CYCLES:
@ -51,11 +58,11 @@ CYCLES:
mov eax, 18 mov eax, 18
mov ebx,5 mov ebx,5
int 0x40 int 0x40
mov [total1],eax ;in Hz example 1600490000 mov [total1],eax ;in Hz, example 1600490000
xor edx,edx xor edx,edx
mov ebx,1000000 mov ebx,1000000
div ebx div ebx
mov [total], eax ; in Mhz example 1600 mov [total], eax ; in Mhz, example 1600
xor edx, edx xor edx, edx
mov eax, [total1] mov eax, [total1]
mov ebx, 10000 mov ebx, 10000
@ -110,7 +117,7 @@ dec [che]
.eaxl: .eaxl:
test eax, $80000000 ; Test bit 31 test eax, $80000000 ; Test bit 31
jnz .ebxl ; <> 0 =>not valid values jnz .ebxl ; <> 0 =>invalid values
shr eax, 8 shr eax, 8
call decodecache call decodecache
shr eax, 8 shr eax, 8
@ -397,20 +404,20 @@ typedetect:
cmp [t], 00b cmp [t], 00b
jne t2d jne t2d
Text 275,190,0x00000000,t1, t1len-t1 Text 295,270,0x00000000,t1, t1len-t1
jmp PROCCORE jmp PROCCORE
t2d: t2d:
cmp [t], 01b cmp [t], 01b
jne t3d jne t3d
Text 275,190,0x00000000,t2, t2len-t2 Text 295,270,0x00000000,t2, t2len-t2
jmp PROCCORE jmp PROCCORE
t3d: t3d:
cmp [t], 11b cmp [t], 11b
jne notype jne notype
Text 275,190,0x00000000,t3, t3len-t3 Text 295,270,0x00000000,t3, t3len-t3
jmp PROCCORE jmp PROCCORE
notype: notype:
Text 275,190,0x00000000,t4, t4len-t4 Text 295,270,0x00000000,t4, t4len-t4
PROCCORE: ; Who are you? PROCCORE: ; Who are you?
; Intel - "GenuineIntel" + ; Intel - "GenuineIntel" +
@ -457,31 +464,105 @@ Text 20, 210,0x00000000,cache, cachelen-cache
Text 80,90,0x00000000,AMDn, AMDnlen-AMDn Text 80,90,0x00000000,AMDn, AMDnlen-AMDn
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Print the unpacked img to screen
mov esi, amd mov esi, amd
call load_gif call load_gif
mov eax,7 ; sysfunc7: putimage PutImage 130,127,201,49,img_area+8
mov ebx,img_area+8 ; pointer to image ; place size
mov ecx,201*65536+49 ; resolution (all gif's included are 64*81)
mov edx,130*65536+127 ; place to print image on screen (first number is
;pixels from left, second pixels from top)
int 0x40 ; execute function
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Relax, man. AMD made PRETTY SIMPLE cache detection routine ; Relax, man. AMD made PRETTY SIMPLE cache detection routine
;CACHE1: ;CACHE1:
mov eax, 80000005h mov eax, 80000005h
cpuid cpuid
mov eax, ecx
;shl eax, 24
;shr eax, 24
and eax,000000FFh ;
mov [lineld], eax
mov eax, ecx
;shl eax, 8
;shr eax, 24
and eax,00FF0000h
shr eax, 16
mov [wayld], eax
shr ecx, 24 shr ecx, 24
mov [L1d], ecx mov [L1d], ecx
mov eax, edx
;shl eax, 24
;shr eax, 24
and eax,000000FFh ;
mov [lineli], eax
mov eax, edx
;shl eax, 8
;shr eax, 24
and eax,00FF0000h
shr eax, 16
mov [wayli], eax
shr edx, 24 shr edx, 24
mov [L1i], edx mov [L1i], edx
;CACHE2: ;CACHE2:
mov eax, 80000006h mov eax, 80000006h
cpuid cpuid
mov eax, ecx
;and eax,000000FFh ;
shl eax, 24
shr eax, 24
mov dword[linel2], eax
mov eax, ecx
shl eax, 16
shr eax, 28
cmp eax, 0010b
je way2
cmp eax, 0100b
je way4
cmp eax, 0110b
je way8
cmp eax, 1000b
je way16
jmp to_next
way2:
mov dword[wayl2], 2
jmp to_next
way4:
mov dword[wayl2], 4
jmp to_next
way8:
mov dword[wayl2], 8
jmp to_next
way16:
mov dword[wayl2], 16
jmp to_next
to_next:
shr ecx, 16 shr ecx, 16
mov [L2],ecx mov [L2],ecx
cmp [f], $5 cmp [f], $5
jz .fiv jz .fiv
cmp [f], $6 cmp [f], $6
@ -651,13 +732,13 @@ fif: ; AMD-64 Family=15
; checking sse3 for new AMD's is needed ; checking sse3 for new AMD's is needed
cmp [m],$1 ; Dual-core Opteron cmp [m],$1 ; Dual-core Opteron
jz .AF1 jz .AF1
cmp [m],$3 ; Toledo 1024 0.09 // Manchester cmp [m],$3 ; Toledo 1024 0.09 // Manchester ||Windsor Dual Core not supported
jz .AF3 jz .AF3
cmp [m],$4 ;Athlon 64 Mobile Athlon 64 FX ClawHammer (1024) 0.13 cmp [m],$4 ;Athlon 64 Mobile Athlon 64 FX ClawHammer (1024) 0.13
jz .AF4 jz .AF4
cmp [m],$5 ; Opteron Athlon 64 FX 0.13 (1024) cmp [m],$5 ; Opteron Athlon 64 FX 0.13 (1024)
jz .AF5 jz .AF5
cmp [m],$7 ;Athlon 64 Athlon 64 FX Clawhammer(1024) 0.13 Sledgehammer(1024) 0.13 // SSE3+ SanDiego(1024) (¯- ¡  ¡ü-¿-¬¡) cmp [m],$7 ;Athlon 64 Athlon 64 FX Clawhammer(1024) 0.13 Sledgehammer(1024) 0.13 // SSE3+ SanDiego(1024)
jz .AF7 jz .AF7
cmp [m],$8 ; Athlon 64 Mobile Athlon 64 FX ClawHammer (1024) 0.13 cmp [m],$8 ; Athlon 64 Mobile Athlon 64 FX ClawHammer (1024) 0.13
jz .AF8 jz .AF8
@ -735,6 +816,7 @@ mov [micron], 9 ; winchester
jmp MMXtest jmp MMXtest
.AFFsse: .AFFsse:
mov [micron], 9
cmp [L2], 1024 cmp [L2], 1024
jz .AFs jz .AFs
cmp [L2], 512 cmp [L2], 512
@ -757,17 +839,10 @@ Text 105,90,0x00000000,AFCsp, AFCsplen-AFCsp
Intel: Intel:
Text 80,90,0x00000000,Inteln, Intelnlen-Inteln Text 80,90,0x00000000,Inteln, Intelnlen-Inteln
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Print the unpacked img to screen
mov esi, intel mov esi, intel
call load_gif call load_gif
mov eax,7 ; sysfunc7: putimage PutImage 130,127,201,49,img_area+8
mov ebx,img_area+8 ; pointer to image ; place size
mov ecx,201*65536+49 ; resolution (all gif's included are 64*81)
mov edx,130*65536+127 ; place to print image on screen (first number is
;pixels from left, second pixels from top)
int 0x40 ; execute function
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
det: det:
cmp [f], $5 cmp [f], $5
@ -944,7 +1019,7 @@ Text 115,90,0x00000000,P6F, P6Flen-P6F
jmp MMXtest jmp MMXtest
;06Ex - Pentium M Yonah 0.065 ;06Ex - Pentium M Yonah 0.065
;06Fx - Pentium D Conroe 0.065, Xeon Woodcrest, Celeron D AllenDale ;06Fx - Pentium D Conroe 0.065, Xeon Woodcrest, Celeron D AllenDale, Core 2 Kentsfield
.sev: ;Family=7 .sev: ;Family=7
.IS0: .IS0:
@ -1045,17 +1120,10 @@ Cyrix:
Text 20, 210,0x00000000,cache, cachelen-cache Text 20, 210,0x00000000,cache, cachelen-cache
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Print the unpacked img to screen
mov esi, cyrix mov esi, cyrix
call load_gif call load_gif
mov eax,7 ; sysfunc7: putimage PutImage 130,127,201,49,img_area+8
mov ebx,img_area+8 ; pointer to image ; place size
mov ecx,201*65536+49 ; resolution (all gif's included are 64*81)
mov edx,130*65536+127 ; place to print image on screen (first number is
;pixels from left, second pixels from top)
int 0x40 ; execute function
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
cmp [f], $5 cmp [f], $5
jz .fivv jz .fivv
@ -1116,12 +1184,86 @@ shr ecx, 24
mov [L1d], ecx mov [L1d], ecx
shr edx, 24 shr edx, 24
mov [L1i], edx mov [L1i], edx
; cache detection routine
;CACHE1:
mov eax, 80000005h
cpuid
mov eax, ecx
and eax,000000FFh ;
mov [lineld], eax
mov eax, ecx
and eax,00FF0000h
shr eax, 16
mov [wayld], eax
shr ecx, 24
mov [L1d], ecx
mov eax, edx
and eax,000000FFh ;
mov [lineli], eax
mov eax, edx
and eax,00FF0000h
shr eax, 16
mov [wayli], eax
shr edx, 24
mov [L1i], edx
;CACHE2: ;CACHE2:
mov eax, 80000006h mov eax, 80000006h
cpuid cpuid
shr ecx, 24
cmp [f], $6
jz vn
jmp vl2old ; if not then old identification
vn:
cmp [m],$9
jl vl2old
; else new
mov eax, ecx
shl eax, 24
shr eax, 24
mov dword[linel2], eax
mov eax, ecx
shl eax, 16
shr eax, 28
mov dword[wayl2], eax
shr ecx, 16 ; it is 16 bits now
mov [L2],ecx mov [L2],ecx
vl2old:
mov eax, ecx
shl eax, 24
shr eax, 24
mov dword[linel2], eax
mov eax, ecx
shl eax, 8
shr eax, 24
mov dword[wayl2], eax
shr ecx, 24 ; it was 8 bits earlier
mov [L2],ecx
cmp [f], $5 cmp [f], $5
jz fivC jz fivC
cmp [f], $6 cmp [f], $6
@ -1129,18 +1271,10 @@ mov [L2],ecx
fivC: ;Family=5 fivC: ;Family=5
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Print the unpacked img to screen
mov esi, idt mov esi, idt
call load_gif call load_gif
mov eax,7 ; sysfunc7: putimage PutImage 130,127,201,49,img_area+8
mov ebx,img_area+8 ; pointer to image ; place size
mov ecx,201*65536+49 ; resolution (all gif's included are 64*81)
mov edx,130*65536+127 ; place to print image on screen (first number is
;pixels from left, second pixels from top)
int 0x40 ; execute function
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Text 80,90,0x00000000,IDTn, IDTnlen-IDTn Text 80,90,0x00000000,IDTn, IDTnlen-IDTn
cmp [m],$4 cmp [m],$4
@ -1164,18 +1298,10 @@ Text 105,90,0x00000000,V59, V59len-V59
sixC: ;Family=6 sixC: ;Family=6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Print the unpacked img to screen
mov esi, via mov esi, via
call load_gif call load_gif
mov eax,7 ; sysfunc7: putimage PutImage 130,127,201,49,img_area+8
mov ebx,img_area+8 ; pointer to image ; place size
mov ecx,201*65536+49 ; resolution (all gif's included are 64*81)
mov edx,130*65536+127 ; place to print image on screen (first number is
;pixels from left, second pixels from top)
int 0x40 ; execute function
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Text 80,90,0x00000000,Centaurn, Centaurnlen-Centaurn Text 80,90,0x00000000,Centaurn, Centaurnlen-Centaurn
cmp [m],$6 cmp [m],$6
@ -1215,32 +1341,64 @@ Text 20, 210,0x00000000,cache, cachelen-cache
Text 80,90,0x00000000,Tranmsmetan, Tranmsmetanlen-Tranmsmetan Text 80,90,0x00000000,Tranmsmetan, Tranmsmetanlen-Tranmsmetan
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Print the unpacked img to screen
mov esi, transmeta mov esi, transmeta
call load_gif call load_gif
mov eax,7 ; sysfunc7: putimage PutImage 130,127,201,49,img_area+8
mov ebx,img_area+8 ; pointer to image ; place size
mov ecx,201*65536+49 ; resolution (all gif's included are 64*81)
mov edx,130*65536+127 ; plce to print image on screen (first number is
;pixels from left, second pixels from top)
int 0x40 ; execute function
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; cache detection routine ; cache detection routine - it is the same as for AMD (almost)
;CACHE1: ;CACHE1:
mov eax, 80000005h mov eax, 80000005h
cpuid cpuid
mov eax, ecx
and eax,000000FFh ;
mov [lineld], eax
mov eax, ecx
and eax,00FF0000h
shr eax, 16
mov [wayld], eax
shr ecx, 24 shr ecx, 24
mov [L1d], ecx mov [L1d], ecx
mov eax, edx
and eax,000000FFh ;
mov [lineli], eax
mov eax, edx
and eax,00FF0000h
shr eax, 16
mov [wayli], eax
shr edx, 24 shr edx, 24
mov [L1i], edx mov [L1i], edx
;CACHE2: ;CACHE2:
mov eax, 80000006h mov eax, 80000006h
cpuid cpuid
shr ecx, 16
mov eax, ecx
shl eax, 24
shr eax, 24
mov dword[linel2], eax
mov eax, ecx
shl eax, 16
shr eax, 28
mov dword[wayl2], eax
shr ecx, 16
mov [L2],ecx mov [L2],ecx
cmp [f], $5 cmp [f], $5
jz .fivt jz .fivt
cmp [f], $F cmp [f], $F
@ -1276,9 +1434,9 @@ HTTtest:
and ebx,00FF0000h ; numbers of logical processors and ebx,00FF0000h ; numbers of logical processors
shr ebx,16 ; shift it to the correct position shr ebx,16 ; shift it to the correct position
cmp ebx, 1 cmp ebx, 1
; mov [number_of_log_cpus], ebx
je .ELN ; HHT not enabled (Celeron) je .ELN ; HHT not enabled (Celeron)
mov dword [HTTn+9], $736579 mov dword [HTTn+9], $736579
mov dword [HTT+ 6], $736579 mov dword [HTT+ 6], $736579
jmp TEXTOUT jmp TEXTOUT
@ -1296,19 +1454,31 @@ Text 20,170,0x00000000,step, steplen-step
;--------L1 L2 ;--------L1 L2
Number 80,190,0,3,dword [L1d],0x000000; Number 80,190,0,3,dword [L1d],0x000000;
Number 80,210,0,3,dword [L1i],0x000000; Number 80,210,0,3,dword [L1i],0x000000;
Number 178,190,0,4,dword[L2],0x000000; Number 46,230,0,4,dword[L2],0x000000;
Number 172,210,0,5,dword[L3],0x000000; Number 40,250,0,5,dword[L3],0x000000;
;-----------Features ;-----------Features
Number 263,70,0,2,dword [micron],0x000000 ; micron Number 263,70,0,2,dword [micron],0x000000 ; micron
Text 280,250,0x00000000,HTT, HTTlen-HTT Text 280,310,0x00000000,HTT, HTTlen-HTT
Text 280,270,0x00000000,sse3, sse3len-sse3 Text 280,330,0x00000000,sse3, sse3len-sse3
Text 20,90,0x00000000,name, namelen-name Text 20,90,0x00000000,name, namelen-name
Text 20,250,0x00000000,MMXs, MMXslen-MMXs Text 20,310,0x00000000,MMXs, MMXslen-MMXs
Text 20,270,0x00000000,SSE, SSElen-SSE Text 20,330,0x00000000,SSE, SSElen-SSE
Text 100,270,0x00000000,SSE2, SSE2len-SSE2 Text 100,330,0x00000000,SSE2, SSE2len-SSE2
Number 145,190,0,2,dword [wayld],0x000000
Number 223,190,0,2,dword [lineld],0x000000
Number 145,210,0,2,dword [wayli],0x000000
Number 223,210,0,2,dword [lineli],0x000000
Number 145,230,0,2,dword [wayl2],0x000000
Number 223,230,0,2,dword [linel2],0x000000
Number 145,250,0,2,dword [wayl3],0x000000
Number 223,250,0,2,dword [linel3],0x000000
jmp TEST3DNOW jmp TEST3DNOW
;------------------- ;-------------------
@ -1387,9 +1557,9 @@ XITM:
text3d: text3d:
Text 180,250,0x00000000,now, nowlen-now Text 180,310,0x00000000,now, nowlen-now
Text 180,270,0x00000000,nowp, nowplen-nowp Text 180,330,0x00000000,nowp, nowplen-nowp
Text 100,250,0x00000000,mmxp, mmxplen-mmxp Text 100,310,0x00000000,mmxp, mmxplen-mmxp
jmp still jmp still
@ -1400,7 +1570,7 @@ NO_CPUID:
FREEZE: FREEZE:
nop nop
jmp FREEZE jmp FREEZE ; maybe we should close application or just made some Warning and jump to still:
;---------------- ;----------------
still: still:
mov eax,10 mov eax,10
@ -1517,11 +1687,7 @@ thread_start:
somewhere: somewhere:
;====================================================================== ;======================================================================
mov eax,51 ; CreateTread window_2,thread2_esp
mov ebx,1
mov ecx,window_2
mov edx,thread2_esp
int 0x40
jmp still jmp still
@ -1567,15 +1733,13 @@ still_2:
draw_window_2: draw_window_2:
mov eax,12 ; function 12:tell os about windowdraw mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1h ; 1, start of draw mov ebx,1h ; 1, start of draw
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,250 shl 16 + 410
mov ecx,250 shl 16 + 350
mov edx,0x03FFFFFF ;aabbcc color of work area RRGGBB,8->color gl
int 0x40 int 0x40
Text 8, 8,0x20ddeeff, standard, standardlen-standard
Window 250,250,419,390, 0x03FFFFFF, 0x805080d0, 0x005080d0
; place size
Text 8, 8,0x20000000, standard, standardlen-standard ;ddeeff
Text 20, 30,0x00000000, STDCA, STDCAlen-STDCA Text 20, 30,0x00000000, STDCA, STDCAlen-STDCA
Text 220, 30,0x00000000, EXTCA, EXTCAlen-EXTCA Text 220, 30,0x00000000, EXTCA, EXTCAlen-EXTCA
@ -1623,7 +1787,7 @@ Text 120,190,0x00000000,TM, TMlen-TM
Text 220,190,0x00000000,IA64, IA64len-IA64 Text 220,190,0x00000000,IA64, IA64len-IA64
Text 320,190,0x00000000,PBE, PBElen-PBE Text 320,190,0x00000000,PBE, PBElen-PBE
;--------------- ;---------------
DrawLine 5, 405, 205,205,0x8080FF ;10 DrawLine 5, 415, 205,205,0x8080FF ;10
mov eax,$80000000 mov eax,$80000000
cpuid cpuid
@ -1641,31 +1805,39 @@ Text 20,235,0x00000000,MON, MONlen-MON
Text 20,255,0x00000000,DS_CPL, DS_CPLlen-DS_CPL Text 20,255,0x00000000,DS_CPL, DS_CPLlen-DS_CPL
Text 20,275,0x00000000,EST, ESTlen-EST Text 20,275,0x00000000,EST, ESTlen-EST
Text 20,295,0x00000000,TM2, TM2len-TM2 Text 20,295,0x00000000,TM2, TM2len-TM2
Text 20,315,0x00000000,VMX, VMXlen-VMX
Text 20,335,0x00000000,SVM, SVMlen-SVM
Text 120,215,0x00000000,CNXT_ID, CNXT_IDlen-CNXT_ID Text 120,215,0x00000000,CNXT_ID, CNXT_IDlen-CNXT_ID
Text 120,235,0x00000000,CX16, CX16len-CX16 Text 120,235,0x00000000,CX16, CX16len-CX16
Text 120,255,0x00000000,ETPRD, ETPRDlen-ETPRD Text 120,255,0x00000000,ETPRD, ETPRDlen-ETPRD
Text 120,275,0x00000000,SYS, SYSlen-SYS Text 120,275,0x00000000,SYS, SYSlen-SYS
Text 120,295,0x00000000,LAF, LAFlen-LAF Text 120,295,0x00000000,LAF, LAFlen-LAF
Text 120,315,0x00000000,SSSE3, SSSE3len-SSSE3
Text 120,335,0x00000000,MCR8, MCR8len-MCR8
Text 220,215,0x00000000,MP, MPlen-MP Text 220,215,0x00000000,MP, MPlen-MP
Text 220,235,0x00000000,NX, NXlen-NX Text 220,235,0x00000000,NX, NXlen-NX
Text 220,255,0x00000000,MMXPi, MMXPilen-MMXPi Text 220,255,0x00000000,MMXPi, MMXPilen-MMXPi
Text 220,275,0x00000000,MMXn, MMXnlen-MMXn Text 220,275,0x00000000,MMXn, MMXnlen-MMXn
Text 220,295,0x00000000,FXSRn, FXSRnlen-FXSRn Text 220,295,0x00000000,FXSRn, FXSRnlen-FXSRn
Text 220,315,0x00000000,DCA,DCAlen-DCA
Text 320,215,0x00000000,FFXSR, FFXSRlen-FFXSR Text 320,215,0x00000000,FFXSR, FFXSRlen-FFXSR
Text 320,235,0x00000000,TSCP, TSCPlen-TSCP Text 320,235,0x00000000,TSCP, TSCPlen-TSCP
Text 320,255,0x00000000,LM, LMlen-LM Text 320,255,0x00000000,LM, LMlen-LM
Text 320,275,0x00000000,DNo, DNolen-DNo Text 320,275,0x00000000,DNo, DNolen-DNo
Text 320,295,0x00000000,DN, DNlen-DN Text 320,295,0x00000000,DN, DNlen-DN
Text 320,315,0x00000000,CMPL, CMPLlen-CMPL
too: too:
DrawLine 5, 405, 315,315,0x8080FF ;10 DrawLine 5, 415, 355,355,0x8080FF ;10
Text 20,330,0x00000000,speed, speedlen-speed Text 20,370,0x00000000,speed, speedlen-speed
Text 135,330,0x00000000,kbpersec, kbperseclen-kbpersec Text 135,370,0x00000000,kbpersec, kbperseclen-kbpersec
Number 100,330,0,5,dword [iter],0x000000; RSA test results Number 100,370,0,5,dword [iter],0x000000; RSA test results
mov eax,12 mov eax,12
mov ebx,2h mov ebx,2h
@ -1682,48 +1854,31 @@ draw_window:
mov ebx,1h mov ebx,1h
int 0x40 int 0x40
mov eax,0 ;  0 Window 150,150,349,385, 0x03FFFFFF, 0x805080d0, 0x005080d0
mov ebx,150*65536+351 ; [x ] *65536 + [x ] ; place size
mov ecx,150*65536+325 ; [y ] *65536 + [y ]
mov edx,0x03FFFFFF;aabbcc RRGGBB,8->color gl
mov esi,0x805080d0 ; RRGGBB,8->color gl
mov edi,0x005080d0 ; RRGGBB
int 0x40
mov eax,8 Button 20,350,92,23,2,0x03FFFFFF ; button "press for more"
mov ebx,20 shl 16 + 92;93
mov ecx,290 shl 16 + 23;24
mov edx,2
mov esi,0x03FFFFFF;aabbcc
int 0x40
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Print the unpacked img to screen
mov esi, knopka mov esi, knopka
mov edi, img_area2 mov edi, img_area2
call load_gif2 call load_gif2
mov eax,7 ; sysfunc7: putimage PutImage 20,350,93,24,img_area2+8 ; image "press for more"
mov ebx,img_area2+8 ; pointer to image ; place size
mov ecx,93*65536+24 ; resolution (all gif's included are 64*81)
mov edx,20*65536+290 ; plce to print image on screen (first number is
;pixels from left, second pixels from top)
int 0x40 ; execute function
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Text 8,8,0x20ddeeff,zag,zaglen-zag ; application header Text 8,8,0x20000000,zag,zaglen-zag ; application header
mov eax,12 mov eax,12
mov ebx,2h mov ebx,2h
int 0x40 int 0x40
Text 135,230,0x00000000,instruct, instructlen-instruct Text 135,290,0x00000000,instruct, instructlen-instruct
DrawLine 15, 335, 285,285,0x8080FF DrawLine 15, 335, 345,345,0x8080FF
DrawLine 335, 335, 235,285,0x8080FF DrawLine 335, 335, 295,345,0x8080FF
DrawLine 15, 15, 235,285,0x8080FF DrawLine 15, 15, 295,345,0x8080FF
DrawLine 15, 130, 235,235,0x8080FF DrawLine 15, 130, 295,295,0x8080FF
DrawLine 235, 335, 235,235,0x8080FF DrawLine 235, 335, 295,295,0x8080FF
cmp dword[smallvendor], 'cAMD' cmp dword[smallvendor], 'cAMD'
jne cont jne cont
@ -1732,13 +1887,7 @@ draw_window:
cmp [f], $6 cmp [f], $6
jl cont jl cont
mov eax,8 ; new button for rating Button 245,105,69,15,3,0x030000FF ; button for rating
mov ebx,245 shl 16 + 69
mov ecx,105 shl 16 + 15
mov edx,3
;mov esi,0x03FFFFFF
mov esi,0x030000FF
int 0x40
Text 250,110,0x00FFFFFF,FR, FRlen-FR Text 250,110,0x00FFFFFF,FR, FRlen-FR
@ -1762,22 +1911,27 @@ draw_window:
mov [ram_size_t], eax mov [ram_size_t], eax
Text 120,300,0x00000000,ram, ramlen-ram Text 120,360,0x00000000,ram, ramlen-ram
Number 205,300,0,4,dword [ram_size_a],0x000000 Number 205,360,0,4,dword [ram_size_a],0x000000
Number 275,300,0,4,dword [ram_size_t],0x000000 Number 275,360,0,4,dword [ram_size_t],0x000000
Text 305,300,0x00000000,mb, mblen-mb Text 305,360,0x00000000,mb, mblen-mb
;============================== ;==============================
Text 20,70,0x00000000,tsum, tsumlen-tsum ; Text 20,70,0x00000000,tsum, tsumlen-tsum ;
Text 20,110,0x00000000,cpuname, cpunamelen-cpuname; Text 20,110,0x00000000,cpuname, cpunamelen-cpuname;
Text 230,190,0x00000000,typen, typenlen-typen; Text 260,270,0x00000000,typen, typenlen-typen;
Text 180, 70,0x00000000,tech, techlen-tech; Text 180, 70,0x00000000,tech, techlen-tech;
Number 87,70,0,4,dword [total],0x000000; MHz Number 87,70,0,4,dword [total],0x000000; MHz
Number 115,70,0,2,dword [sot],0x000000; KHz Number 115,70,0,2,dword [sot],0x000000; KHz
Text 20,190,0x00000000,cache2, cache2len-cache2 Text 20,190,0x00000000,cache2, cache2len-cache2
Text 20,230,0x00000000,cache3, cache3len-cache3
Text 20,250,0x00000000,cache4, cache4len-cache4
Number 80,130,1*256,1,dword [f],0x000000 ; Number 80,130,1*256,1,dword [f],0x000000 ;
Number 80,150,1*256,1,dword [m],0x000000; Number 80,150,1*256,1,dword [m],0x000000;
Number 80,170,1*256,1,dword [s],0x000000; Number 80,170,1*256,1,dword [s],0x000000;
@ -1792,6 +1946,10 @@ Number 110,50,0,1,dword [multa],0x000000;
Text 180,50,0x00000000,freql, freqllen-freql Text 180,50,0x00000000,freql, freqllen-freql
Number 264,50,0,4,dword [freqbb],0x000000; Number 264,50,0,4,dword [freqbb],0x000000;
Number 294,50,0,2,dword [freqll],0x000000; Number 294,50,0,2,dword [freqll],0x000000;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Text 120,300,0x00000000,logcpus, logcpuslen-logcpus
;Number 255,300,0,2,dword [number_of_log_cpus],0x000000
Text 20,30,0x00000000,stm, stmlen-stm Text 20,30,0x00000000,stm, stmlen-stm
; Fix for deleting leading whitespaces ; Fix for deleting leading whitespaces
@ -1809,7 +1967,7 @@ Number 294,50,0,2,dword [freqll],0x000000;
Text 110, 30, 0x00000000, edi, esi Text 110, 30, 0x00000000, edi, esi
; Text 110,40,0x00000000,myname, mynamelen-myname ; Text 110,40,0x00000000,myname, mynamelen-myname
;- ;-
Text 230,210,0x00000000,brandid, brandidlen-brandid Text 20,270,0x00000000,brandid, brandidlen-brandid
ret ; ret ;
@ -1822,7 +1980,7 @@ load_gif2:
; DATA AREA ; DATA AREA
zag: zag:
db 'CPUID 2.05 by Sergey Kuzmin and the KolibriOS team' db 'CPUID 2.17 by Sergey Kuzmin and the KolibriOS team'
zaglen: zaglen:
tsum: tsum:
db 'Frequency: . MHz' db 'Frequency: . MHz'
@ -1857,6 +2015,32 @@ brand dd ?
ram_size_a dd ? ram_size_a dd ?
ram_size_t dd ? ram_size_t dd ?
stdc dd ?
extc dd ?
FRS dd ?
freqsel db ?
temp dd ?
freqbb dd ?
freqll dd ?
wayli dd ?
lineli dd ?
wayld dd ?
lineld dd ?
wayl2 dd ?
linel2 dd ?
wayl3 dd ?
linel3 dd ?
;number_of_log_cpus dd ?
che db ? ; numbers of calls for Intel caches detection
ram: ram:
db 'Available RAM: out of' db 'Available RAM: out of'
ramlen: ramlen:
@ -1869,6 +2053,10 @@ mb :
db 'MB' db 'MB'
mblen: mblen:
;logcpus :
;db 'Number of logical CPU:'
;logcpuslen:
speed : speed :
db 'PERFORMANCE:' db 'PERFORMANCE:'
speedlen: speedlen:
@ -1901,24 +2089,13 @@ brandid:
db 'Brand:' db 'Brand:'
brandidlen: brandidlen:
stdc dd ?
extc dd ?
FRS dd ?
freqsel db ?
temp dd ?
freqbb dd ?
freqll dd ?
che db ? ; numbers of calls for Intel caches detection
oblom: oblom:
db 'SORRY, CPUID IS NOT AVAILABLE' db 'SORRY, CPUID IS NOT AVAILABLE'
oblomlen: oblomlen:
other: other:
db 'SORRY, THIS VENDOR IS NOT SUPPORTED YET' db 'SORRY, THIS VENDOR IS NOT SUPPORTED YET'
otherlen: otherlen:
cpuname: cpuname:
db 'CPU VENDOR: ' db 'CPU VENDOR: '
cpunamelen: cpunamelen:
@ -1931,18 +2108,28 @@ modelen:
step: step:
db 'STEPPING:' db 'STEPPING:'
steplen: steplen:
cache2: cache2:
db 'L1(data): KB L2: KB' db 'L1(data): KB -way set -byte line size'
cache2len: cache2len:
cache: cache:
db 'L1(inst): KB L3: KB' db 'L1(inst): KB -way set -byte line size'
cachelen: cachelen:
cache3:
db 'L2: KB -way set -byte line size'
cache3len:
cache4:
db 'L3: KB -way set -byte line size'
cache4len:
cacheP4: cacheP4:
db 'L1(inst): Kuops L3: KB' db 'L1(inst): Kuops -way set -byte line size'
cacheP4len: cacheP4len:
tech: tech:
@ -1968,6 +2155,7 @@ freqllen:
name: name:
db 'CODENAME:' db 'CODENAME:'
namelen: namelen:
AMDn: AMDn:
db 'AMD' db 'AMD'
AMDnlen: AMDnlen:
@ -2083,10 +2271,10 @@ P6D:
db 'Pentium M (Dothan)' db 'Pentium M (Dothan)'
P6Dlen: P6Dlen:
P6E: P6E:
db 'Pentium M (Yonah)' db 'Pentium M (Yonah)/ Core'
P6Elen: P6Elen:
P6F: P6F:
db 'Pentium D (Conroe)' db 'Pentium D (Conroe)/ Core 2 (Kentsfield)'
P6Flen: P6Flen:
;--- ;---
PS0: PS0:
@ -2285,10 +2473,12 @@ stm:
db 'Internal name:' db 'Internal name:'
stmlen: stmlen:
athloncoef db 110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105 athloncoef db 110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 120
athloncoef2 db 120, 190, 120, 200, 130, 135, 140, 210, 150, 220, 160, 165, 170, 180, 230, 240 db 190, 120, 200, 130, 135, 140, 210, 150, 220, 160, 165, 170, 180, 230, 240
athlonmcoef: db 110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105
db 30, 190, 40, 200, 130, 135, 14, 210, 150, 220, 160, 165, 170, 230, 240
athloncoef3 db 45, 50, 40, 55, 25, 30, 60, 35 athloncoef3 db 45, 50, 40, 55, 25, 30, 60, 35
p4coef db 160, 170, 180, 190, 200, 210, 220, 230, 80, 90, 100, 110, 120, 130, 140, 150 ; Pentium 4 p4coef db 160, 170, 180, 190, 200, 210, 220, 230, 80, 90, 100, 110, 120, 130, 140, 150 ; Pentium 4 (Willamete)
coppercoeff db 50, 30, 40, 20, 55, 35, 45, 25, 35, 70, 80, 60, 20, 75, 15, 65, 90, 110, 120, 20, 95, 115, 85, 25, 35, 70, 80, 100, 20, 75, 15, 105 coppercoeff db 50, 30, 40, 20, 55, 35, 45, 25, 35, 70, 80, 60, 20, 75, 15, 65, 90, 110, 120, 20, 95, 115, 85, 25, 35, 70, 80, 100, 20, 75, 15, 105
tualatcoeff db 120, 35, 35, 40, 55, 35, 115, 35, 160, 70, 80, 60, 40, 75, 35, 65, 90, 110, 35, 35, 95, 35, 85, 35, 35, 35, 130, 100, 140, 35, 150, 105 tualatcoeff db 120, 35, 35, 40, 55, 35, 115, 35, 160, 70, 80, 60, 40, 75, 35, 65, 90, 110, 35, 35, 95, 35, 85, 35, 35, 35, 130, 100, 140, 35, 150, 105

View File

@ -2,10 +2,10 @@
; project name: CPUID ; project name: CPUID
; target platform: KolibriOS, x86 (IA-32), x86-64 achitectures ; target platform: KolibriOS, x86 (IA-32), x86-64 achitectures
; compability: probably some functions would work in MenuetOS 32 and MenuetOS 64, may be even in Miraculix; ; compability: probably some functions would work in MenuetOS 32 and MenuetOS 64, may be even in Miraculix;
; CPUID (versions before 2.00) works in MS Windows by means of emulators ; CPUID works in MS Windows by means of emulator from Diamond (http://diamondz.land.ru)
; compiler: flat assembler 1.67.5 ; compiler: flat assembler 1.67.5
; version: 2.05 ; version: 2.17
; last update: 1st November 2006 ; last update: 3rd February 2007
; maintained by: Sergey Kuzmin aka Wildwest ; maintained by: Sergey Kuzmin aka Wildwest
; e-mail: kuzmin_serg@list.ru ; e-mail: kuzmin_serg@list.ru
; site: http://coolthemes.narod.ru/files.html ; site: http://coolthemes.narod.ru/files.html
@ -28,10 +28,36 @@
; Highest input values for standard and extended calls ; Highest input values for standard and extended calls
; performed tests - Performance test (RSA encoding) ; performed tests - Performance test (RSA encoding)
;****************************************************************************** ;******************************************************************************
;"To do" plans:
; actual use of Brand ID for description of Intel's CPU, i.e. Celeron/Pentium separation;
; remove support of Cyrix and early Centaur (IDT) - they are too old, rare and non-standard;
; Sempron detection - probably they supports Brand-ID;
; update caches descriptors for intel Core 1/2
; quantity of logical CPU/cores - requires APIC ID analysis
; newest AMD/Intel codename detection
;******************************************************************************
;HISTORY: ;HISTORY:
;2.1: CPUID 01/11/2006 (not finished) ;3.0: CPUID 03/02/2007 (not finished)
;Authors: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru>
; Iliya Mikhailov aka Ghost <Ghost.nsk@gmail.com>
; /^S0rG^\ <s0rg@ngs.ru>
;Features:
; (+) fixed address of LAHF feature, added detection of CMPL, SVM, MOVCR8 technologies for AMD;
; (+) fixed L2 cache size detection for VIA (they changed format from 8 bits to 16 bits several years ago);
; (+) more macroses for Interface and Threads (from Menuett.inc written by /^S0rG^\, 2002), sources separated into several include files;
; (++) more info about caches for VIA and Transmeta;
; (+) added detection of DCA, SSSE3, VMX technologies for Intel;
; (+) updated multiplier detection for AMD and Intel (thanks a lot to Ghost);
;Known issues: Sempron marked as AthlonXP
; second window doesn't closed when you close main window
;-----------------------------------------------------------------------------
;2.1: CPUID 10/01/2007
;Author: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru> ;Author: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru>
;Features: ;Features:
; (++) more info about caches for AMD and Intel
; (+) redesign
; (+) fixes for names of some extended features
; (+) fixed missing technology for some AMD64 cpu's
; (+) detection of dual-core AMD Opteron, but I came to conclusion that detection of AMD Fxxh CPU's should be changed (don't know how yet) ; (+) detection of dual-core AMD Opteron, but I came to conclusion that detection of AMD Fxxh CPU's should be changed (don't know how yet)
; (+) new caches for Intel ; (+) new caches for Intel
; (+) fixed Celeron detection based on L2 cache size for newest Intel CPU (there are Celeron models with 512 Kb); ; (+) fixed Celeron detection based on L2 cache size for newest Intel CPU (there are Celeron models with 512 Kb);
@ -41,7 +67,7 @@
; second window doesn't closed when you close main window ; second window doesn't closed when you close main window
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
;2.0: CPUID 31/10/2006 ;2.0: CPUID 31/10/2006
;Author: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru> ;Authors: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru>
; Eugeniy Grechnikov aka Diamond <diamondz@land.ru> ; Eugeniy Grechnikov aka Diamond <diamondz@land.ru>
; Iliya Mikhailov aka Ghost <Ghost.nsk@gmail.com> ; Iliya Mikhailov aka Ghost <Ghost.nsk@gmail.com>
;Features: ;Features:
@ -74,8 +100,8 @@
;Known issues: Sempron is not supported (marked as AthlonXP) ;Known issues: Sempron is not supported (marked as AthlonXP)
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
;1.0: CPUID 26/09/2005 ;1.0: CPUID 26/09/2005
;Author: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru> ;Authors: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru>
;Additions: Marat Zakiyanov aka Mario79 <mario79@bk.ru> ; Marat Zakiyanov aka Mario79 <mario79@bk.ru>
; Andrey Halyavin aka halyavin <halyavin@land.ru> ; Andrey Halyavin aka halyavin <halyavin@land.ru>
;Features: ;Features:
; (+) fixed bug, when processor doesn't support extented features and program don't report 'no' in such case ; (+) fixed bug, when processor doesn't support extented features and program don't report 'no' in such case
@ -99,8 +125,8 @@
;Known issues: Sempron is not supported (marked as AthlonXP) ;Known issues: Sempron is not supported (marked as AthlonXP)
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
;0.9: CPUID 24/01/2005 ;0.9: CPUID 24/01/2005
;Author: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru> ;Authors: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru>
;Additions: Madis Kalme aka Madis731 <madis.kalme@mail.ee> ; Madis Kalme aka Madis731 <madis.kalme@mail.ee>
; Jeffrey Amelynck aka Profkid <the_adams_familie@hotmail.com> ; Jeffrey Amelynck aka Profkid <the_adams_familie@hotmail.com>
;Features: ;Features:
; (+) deleting leading whitespaces in Intel P4's internal name ; (+) deleting leading whitespaces in Intel P4's internal name
@ -118,68 +144,5 @@
;Known issues: Sempron is not supported (marked as AthlonXP) ;Known issues: Sempron is not supported (marked as AthlonXP)
; caches for IDT is not detected ; caches for IDT is not detected
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
;0.8: CPUID 10/12/2004 ;early history was removed; download any old version of CPUID and read it, if you want
;Author: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru>
;Features: (+) CPUID now display frequency in Mhz with accuracy 0.01 MHz
; (+) more codenames - Intel Itanium :-)
; (+) display Internal Name
; (+) caches for Intel Pentium
; (+) Technology
; (+) detect L1 Trace Instruction cache and some new caches for Intel
; (+) detect Celerons based on Pentium III/4 kernels
; (+) interface+(redesign) and Logo for Vendors
; (+) fix for HTT detection on Celeron(it wasn't bug, just Intel's marketing)
; (+) test for MMX+ and 3DNow!+
;Bugs: no !!!
;Known issues: Sempron not supported (marked as AthlonXP)
; Xeon is not fully supported (marked as Pentium except some models)
;-----------------------------------------------------------------------------
;0.7: CPUID 28/11/2004
;Author: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru>
;Features: updated calculation of PR-rating for AMD AthlonXP,
; more codenames (AMD series: Applebred, Thorton),
; added L1 and L2 cache size detection,
; fix for 3DNow! detection on non-AMD CPU's
;Bugs: HTT detection on Celeron 4 (really Celeron 4 have HTT,
; but Intel disabled it in microcode)
;-----------------------------------------------------------------------------
;0.6: CPUID 28/10/2004
;Author: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru>
;Features: added calculation of PR-rating for AMD AthlonXP(on request of
; RU-team), more codenames (VIA, Cyrix, IDT (Centaur) series),
; interface+ (redesign), added output of CPU frequency in MHz,
; fix for CPU clock detection (needs changes in kernel.asm),
; fixed bugs which were founded during public testing,
; decreased required memory 0x100000->0x340
;Bugs: problem with 3DNow! detection on non-AMD CPU's (VIA C3 and others)
;-----------------------------------------------------------------------------
;0.5: CPUID 16/10/2004
;Author: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru>
;Features: added test for Hyper-Threading Technology support,
; more codenames (Intel and AMD series)
; fasm 1.50 compability, interface+ (window type 2->3 and redesign)
; fix for window redrawing bug
;Bugs: error in CPU clock detection (cause: error in sysfunc 18 subfunc 5)
;-----------------------------------------------------------------------------
;0.4: CPUID 27/09/2004
;Author: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru>
;Features: added processor codename's detection engine and little database of
; codenames (P1 and K7)
;Bugs: window redrawing bug, error in CPU clock detection
;-----------------------------------------------------------------------------
;0.3: CPUID 26/09/2004
;Author: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru>
;Features: display CPU frequency; CPU Vendor;
; CPU signature(family, model,stepping),
; test for MMX,SSE,SSE2,SSE3,3DNow!
;Bugs: window redrawing bug, error in CPU clock detection
;-----------------------------------------------------------------------------
;0.2: TIMES from old OFFICIAL distribution 11/10/2001
;Author: unknown hero (VT?)
;Features: display CPU frequency, CPU Vendor,
; test for MMX, Process Management
;-----------------------------------------------------------------------------
;0.1: CPUSPEED from OFFICIAL distribution 21/05/2001
;Author: unknown hero (VT?)
;Features: display CPU frequency
;***************************************************************************** ;*****************************************************************************

View File

@ -5,7 +5,7 @@ ENGLISH
Hi! My name is Sergey Kuzmin aka Wildwest. Hi! My name is Sergey Kuzmin aka Wildwest.
This is one of the mostly famous program for KolibriOS/MenuetOS. This is one of the mostly famous program for KolibriOS/MenuetOS.
I called it CPUID. CPUID talks with you CPU and show log. I called it CPUID. CPUID talks with you CPU and show log.
Current version is 2.05 and you can use it on your own risk without any warranty. Current version is 2.17 and you can use it on your own risk without any warranty.
E-mail me (kuzmin_serg@list.ru) if you have some problems or suggestions. E-mail me (kuzmin_serg@list.ru) if you have some problems or suggestions.
All righs on this program are mine, except parts of code written by other developers. All righs on this program are mine, except parts of code written by other developers.
@ -13,23 +13,23 @@ Further versions will be soon on my site: http://coolthemes.narod.ru/files.html
People from international KolibriOS/MenuetOS team help me and I wish to mention his effort here: People from international KolibriOS/MenuetOS team help me and I wish to mention his effort here:
Ville Turjanmaa (Finland), which wrote MenuetOS and programs TIMES&CPUSPEED Ville Turjanmaa (Finland), which wrote MenuetOS;
Ivan Poddubny and /^S0rG^\ (Russia) for useful macroces Ivan Poddubny and /^S0rG^\ (Russia) for useful macroses;
Madis Kalme (Estonia), which wrote fix for strange Intel's Internal names Madis Kalme (Estonia), which wrote fix for strange Intel's Internal names;
Jeffrey Amelynck (Belgium), who send me logos and code for its displaying Jeffrey Amelynck (Belgium), who send me logos and code for its displaying
(code was based on macros, written by Evgeniy Pavlyushin (Russia), which was (code was based on macros, written by Evgeniy Pavlyushin (Russia), which was
just a shell for GIF decoding routine made by Andrey Ivushkin (Ukraine)) just a shell for GIF decoding routine made by Andrey Ivushkin (Ukraine));
Marat Zakiyanov (Russia) for its kind propose of help in creating additional window Marat Zakiyanov (Russia) for its kind propose of help in creating additional window ;
Andrey Halyavin (Russia) for his patience during debugging performance test Andrey Halyavin (Russia) for his patience during debugging performance test ;
Eugeniy Grechnikov (Russia) for great code clean-up and optimization Eugeniy Grechnikov (Russia) for great code clean-up and optimization;
Iliya Mikhailov (Russia) for piece of code from his great GMON Iliya Mikhailov (Russia) for piece of code from his great GMON.
Also I want to thank folks which help me by testing and suggestions - Also I want to thank folks which help me by testing and suggestions -
Sonny, Smiddy and all the RU-Team. Sonny, Smiddy and all the RU-Team.
@ -44,7 +44,7 @@ RUSSIAN
Ïðèâåò! Ìåíÿ çîâóò Ñåðãåé Êóçüìèí aka Wildwest. Ïðèâåò! Ìåíÿ çîâóò Ñåðãåé Êóçüìèí aka Wildwest.
Ýòî îäíà èç ñàìûõ èçâåñòíûõ ïðîãðàìì äëÿ KolibriOS/MenuetOS. Ýòî îäíà èç ñàìûõ èçâåñòíûõ ïðîãðàìì äëÿ KolibriOS/MenuetOS.
Îíà íàçûâàåòñÿ CPUID è ïîêàçûâàåò ðåçóëüòàòû èäåíòèôèêàöèè ïðîöåññîðà. Îíà íàçûâàåòñÿ CPUID è ïîêàçûâàåò ðåçóëüòàòû èäåíòèôèêàöèè ïðîöåññîðà.
Ýòî âåðñèÿ 2.05 è ÂÛ ìîæåòå å¸ èñïîëüçîâàòü íà ñâîé ñîáñòâåííûé ðèñê áåçî âñÿêèõ ãàðàíòèé. Ýòî âåðñèÿ 2.17 è ÂÛ ìîæåòå å¸ èñïîëüçîâàòü íà ñâîé ñîáñòâåííûé ðèñê áåçî âñÿêèõ ãàðàíòèé.
Åñëè áóäóò êàêèå-òî ïðîáëåìû èëè ïðåäëîæåíèÿ, òî íàïèøèòå ìíå (kuzmin_serg@list.ru). Åñëè áóäóò êàêèå-òî ïðîáëåìû èëè ïðåäëîæåíèÿ, òî íàïèøèòå ìíå (kuzmin_serg@list.ru).
Âñå ïðàâà íà ïðîãðàììó ïðèíàäëåæàò ìíå, êðîìå ïðàâ íà ÷àñòè, íàïèñàííûõ îñòàëüíûìè ðàçðàáîò÷èêàìè. Âñå ïðàâà íà ïðîãðàììó ïðèíàäëåæàò ìíå, êðîìå ïðàâ íà ÷àñòè, íàïèñàííûõ îñòàëüíûìè ðàçðàáîò÷èêàìè.
@ -52,23 +52,23 @@ RUSSIAN
Ëþäè èç ìåæäóíàðîäíîé êîìàíäû MenuetOS ïîìîãàëè ìíå è ÿ õîòåë áû óïîìÿíóòü èõ çäåñü: Ëþäè èç ìåæäóíàðîäíîé êîìàíäû MenuetOS ïîìîãàëè ìíå è ÿ õîòåë áû óïîìÿíóòü èõ çäåñü:
Ville Turjanmaa (Ôèíëÿíäèÿ), íàïèñàâøåãî MenuetOS, à òàêæå ïðîãðàììû TIMES è CPUSPEED Ville Turjanmaa (Ôèíëÿíäèÿ), íàïèñàâøåãî MenuetOS;
Èâàí Ïîääóáíîãî and /^S0rG^\ (Ðîññèÿ), íàïèñàâøèõ ïîëåçíûå ìàêðîñû Èâàí Ïîääóáíîãî and /^S0rG^\ (Ðîññèÿ), íàïèñàâøèõ ïîëåçíûå ìàêðîñû;
Madis Kalme (Ýñòîíèÿ), íàïèñàâøåãî îáðàáîò÷èê äëÿ ñòðàííûõ âíóòðåííèõ èìåí ïðîöåññîðîâ Èíòåë Madis Kalme (Ýñòîíèÿ), íàïèñàâøåãî îáðàáîò÷èê äëÿ ñòðàííûõ âíóòðåííèõ èìåí ïðîöåññîðîâ Èíòåë;
Jeffrey Amelynck (Áåëüãèÿ), ïðèñëàâøåãî ìíå ëîãîòèïû è êîä äëÿ èõ ïîêàçà Jeffrey Amelynck (Áåëüãèÿ), ïðèñëàâøåãî ìíå ëîãîòèïû è êîä äëÿ èõ ïîêàçà
(êîä îñíîâàí íà ìàêðîñå îò Åâãåíèÿ Ïàâëþøèíà (Ðîññèÿ), êîòîðûé áûë ïðîñòî îáåðòêîé (êîä îñíîâàí íà ìàêðîñå îò Åâãåíèÿ Ïàâëþøèíà (Ðîññèÿ), êîòîðûé áûë ïðîñòî îáåðòêîé
äëÿ àëãîðèòìà äåêîäèðîâàíèÿ GIF, ðåàëèçîâàííîãî Àíäðååì Èâóøêèíûì (Óêðàèíà)) äëÿ àëãîðèòìà äåêîäèðîâàíèÿ GIF, ðåàëèçîâàííîãî Àíäðååì Èâóøêèíûì (Óêðàèíà));
Ìàðàòà Çàêèÿíîâà (Ðîññèÿ) çà åãî ëþáåçíîå ïðåäëîæåíèå ïîìî÷ü ñ ñîçäàíèåì äîïîëíèòåëüíîãî îêíà Ìàðàòà Çàêèÿíîâà (Ðîññèÿ) çà åãî ëþáåçíîå ïðåäëîæåíèå ïîìî÷ü ñ ñîçäàíèåì äîïîëíèòåëüíîãî îêíà;
Àíäðåÿ Õàëÿâèíà (Ðîññèÿ) çà åãî òåðïåíèå â ïðîöåññå îòëàäêè òåñòà ïðîèçîâèòåëüíîñòè Àíäðåÿ Õàëÿâèíà (Ðîññèÿ) çà åãî òåðïåíèå â ïðîöåññå îòëàäêè òåñòà ïðîèçîâèòåëüíîñòè ;
Åâãåíèÿ Ãðå÷íèêîâà (Ðîññèÿ) çà ÷èñòêó êîäà è îïòèìèçàöèþ Åâãåíèÿ Ãðå÷íèêîâà (Ðîññèÿ) çà ÷èñòêó êîäà è îïòèìèçàöèþ;
Èëüþ Ìèõàéëîâà (Ðîññèÿ) çà êóñîê êîäà èç åãî çàìå÷àòåëüíîé ïðîãðàììû GMON Èëüþ Ìèõàéëîâà (Ðîññèÿ) çà êóñîê êîäà èç åãî çàìå÷àòåëüíîé ïðîãðàììû GMON.
Òàêæå ÿ õî÷ó ïîáëàãîäàðèòü ëþäåé, ïîìîãàâøèõ ìíå òåñòèðîâàíèåì è ïðåäëîæåíèÿìè - Òàêæå ÿ õî÷ó ïîáëàãîäàðèòü ëþäåé, ïîìîãàâøèõ ìíå òåñòèðîâàíèåì è ïðåäëîæåíèÿìè -
Sonny, Smiddy è âñþ "ñîâåòñêóþ êîìàíäó" KolibriOS/MenuetOS . Sonny, Smiddy è âñþ "ñîâåòñêóþ êîìàíäó" KolibriOS/MenuetOS .

View File

@ -0,0 +1,716 @@
; Decoding cache L1,L2,L3 for Intel
decodecache:
comp0:
cmp al, 00h
je L000
;-------L2
comp1:
cmp al, 41h
je kk1
comp2:
cmp al, 42h
je kk2
comp3:
cmp al, 43h
je kk3
comp4:
cmp al, 44h
je kk4
comp5:
cmp al, 45h
je kk5
;------------L1 inst
comp6:
cmp al, 06h
je kk6
comp7:
cmp al, 08h
je kk7
comp8:
cmp al, 15h
je kk8
comp9:
cmp al, 77h
je kk9
comp10:
cmp al, 30h
je kk10
;---------------L1 data
comp11:
cmp al, 0Ah
je kk11
je Ld8
comp12:
cmp al, 66h
je kk12
je Ld8
comp13:
cmp al, 0Ch
je kk13
je Ld16
comp14:
cmp al, 10h
je kk14
je Ld16
comp15:
cmp al, 67h
je kk15
je Ld16
comp16:
cmp al, 2Ch
je kk16
je Ld32
comp17:
cmp al, 68h
je kk17
je Ld32
;-------L2
comp18:
cmp al, 39h
je kk18
je L128
comp19:
cmp al, 3Bh
je kk19
je L128
comp20:
cmp al, 79h
je kk20
je L128
comp21:
cmp al, 81h
je kk21
je L128
comp22:
cmp al, 3Ch
je kk22
je L256
comp23:
cmp al, 7Ah
je kk23
je L256
comp24:
cmp al, 7Eh
je kk24
je L256
comp25:
cmp al, 82h
je kk25
je L256
comp26:
cmp al, 7Bh
je kk26
je L512
comp27:
cmp al, 83h
je kk27
je L512
comp28:
cmp al, 86h
je kk28
je L512
comp29:
cmp al, 7Ch
je kk29
je L1024
comp30:
cmp al, 84h
je kk30
je L1024
comp31:
cmp al, 87h
je kk31
je L1024
comp32:
cmp al, 85h
je kk32
je L2048
;-----L1 Trace instr
comp33:
cmp al, 70h
je kk33
je Li12
comp34:
cmp al, 71h
je kk34
je Li16
comp35:
cmp al, 72h
je kk35
je Li32
;----New codes
comp36:
cmp al, 60h
je kk36
je Ld16
comp37:
cmp al, 78h
je kk37
je L1024
comp38:
cmp al, 7Dh
je kk38
je L2048
;---- L3
comp39:
cmp al, 22h
je kk39
je L305
comp40:
cmp al, 23h
je kk40
je L31
comp41:
cmp al, 25h
je kk41
je L32
comp42:
cmp al, 29h
je kk42
je L34
comp43:
cmp al, 88h
je kk43
je L32
comp44:
cmp al, 89h
je kk44
je L34
comp45:
cmp al, 8Ah
je kk45
je L38
comp46:
cmp al, 8Dh
je kk46
je L34
;============= v. 2.04
comp47:
cmp al, 73h
je kk47
je Li64
comp48:
cmp al, 1Ah
je kk48
je L96
comp49:
cmp al, 3Ah
je kk49
je L192
comp50:
cmp al, 3Dh
je kk50
je L384
comp51:
cmp al, 3Eh
je kk51
je L512
comp52:
cmp al, 7Fh
je kk52
je L512
comp53:
cmp al, 46h
je kk53
je L34
comp54:
cmp al, 47h
je kk54
je L38
comp55:
cmp al, 49h
je kk55
je L34
comp56:
cmp al, 4Ah
je kk56
je L36
comp57:
cmp al, 4Bh
je kk57
je L38
comp58:
cmp al, 4Ch
je kk58
je L312
comp59:
cmp al, 4Dh
je kk59
je L316
jne L000
;------------------
kk1:
mov [wayl2], 4
mov [linel2], 32
jmp L128
kk2:
mov [wayl2], 4
mov [linel2], 32
jmp L256
kk3:
mov [wayl2], 4
mov [linel2], 32
jmp L512
kk4:
mov [wayl2], 4
mov [linel2], 32
jmp L1024
kk5:
mov [wayl2], 4
mov [linel2], 32
jmp L2048
;;;;;;;;;;;;;;;;;
kk6:
mov [wayli], 4
mov [lineli], 32
jmp Li8
kk7:
mov [wayli], 4
mov [lineli], 32
jmp Li16
kk8:
mov [wayli], 4
mov [lineli], 32
jmp Li16
kk9:
mov [wayli], 4
mov [lineli], 64
jmp Li16
kk10:
mov [wayli], 8
mov [lineli], 64
jmp Li32
;;;;;;;;;;;;;;;;;;;
;---------------L1 data
kk11:
mov [wayld], 2
mov [lineld], 32
jmp Ld8
kk12:
mov [wayld], 4
mov [lineld], 64
jmp Ld8
kk13:
mov [wayld], 4
mov [lineld], 32
jmp Ld16
kk14:
mov [wayld], 4
mov [lineld], 32
jmp Ld16
kk15:
mov [wayld], 4
mov [lineld], 64
jmp Ld16
kk16:
mov [wayld], 8
mov [lineld], 64
jmp Ld32
kk17:
mov [wayld], 4
mov [lineld], 64
jmp Ld32
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
kk18:
mov [wayl2], 4
mov [linel2], 64
jmp L128
kk19:
mov [wayl2], 2
mov [linel2], 64
jmp L128
kk20:
mov [wayl2], 8
mov [linel2], 64
jmp L128
kk21:
mov [wayl2], 8
mov [linel2], 32
jmp L128
kk22:
mov [wayl2], 4
mov [linel2], 64
jmp L256
kk23:
mov [wayl2], 8
mov [linel2], 64
jmp L256
kk24:
mov [wayl2], 8
mov [linel2], 128
jmp L256
kk25:
mov [wayl2], 4
mov [linel2], 32
jmp L256
kk26:
mov [wayl2], 8
mov [linel2], 64
jmp L512
kk27:
mov [wayl2], 8
mov [linel2], 32
jmp L512
kk28:
mov [wayl2], 4
mov [linel2], 64
jmp L512
kk29:
mov [wayl2], 8
mov [linel2], 64
jmp L1024
kk30:
mov [wayl2], 8
mov [linel2], 32
jmp L1024
kk31:
mov [wayl2], 8
mov [linel2], 64
jmp L1024
kk32:
mov [wayl2], 8
mov [linel2], 32
jmp L2048
;;;;;;;;;;;;;;;;;;;;;;;;;
kk33:
mov [wayli], 8
;mov [lineli], 32
jmp Li12
kk34:
mov [wayli], 8
;mov [lineli], 32
jmp Li16
kk35:
mov [wayli], 8
;mov [lineli], 32
jmp Li32
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
kk36:
mov [wayld], 8
mov [lineld], 64
jmp Ld16
kk37:
mov [wayl2], 4
mov [linel2], 64
jmp L1024
kk38:
mov [wayl2], 8
mov [linel2], 64
jmp L2048
;;;;;;;;;;;;;;;;;;;;;;;;;
kk39:
mov [wayl3], 4
mov [linel3], 64
jmp L305
kk40:
mov [wayl3], 8
mov [linel3], 64
jmp L31
kk41:
mov [wayl3], 8
mov [linel3], 64
jmp L32
kk42:
mov [wayl3], 8
mov [linel3], 64
jmp L34
kk43:
mov [wayl3], 4
mov [linel3], 64
jmp L32
kk44:
mov [wayl3], 4
mov [linel3], 64
jmp L34
kk45:
mov [wayl3], 4
mov [linel3], 64
jmp L38
kk46:
mov [wayl3], 12
mov [linel3], 128
jmp L33
;;;;;;;;;;;;;;;;;;;;;;
kk47:
mov [wayli], 8
;mov [lineli], 32
jmp Li64
kk48:
mov [wayl2], 6
mov [linel2], 64
jmp L96
kk49:
mov [wayl2], 6
mov [linel2], 64
jmp L192
kk50:
mov [wayl2], 6
mov [linel2], 64
jmp L384
kk51:
mov [wayl2], 4
mov [linel2], 64
jmp L512
kk52:
mov [wayl2], 2
mov [linel2], 64
jmp L512
kk53:
mov [wayl3], 4
mov [linel3], 64
jmp L34
kk54:
mov [wayl3], 8
mov [linel3], 64
jmp L38
kk55:
mov [wayl3], 16
mov [linel3], 64
jmp L34
kk56:
mov [wayl3], 12
mov [linel3], 64
jmp L36
kk57:
mov [wayl3], 16
mov [linel3], 64
jmp L38
kk58:
mov [wayl3], 12
mov [linel3], 64
jmp L312
kk59:
mov [wayl3], 16
mov [linel3], 64
jmp L316
;------------------
Li8:
mov [L1i], 8
jmp L000
Li12:
mov [L1i], 12
jmp L000
Li16:
mov [L1i], 16
jmp L000
Li32:
mov [L1i], 32
jmp L000
Li64:
mov [L1i], 64
jmp L000
Ld8:
mov [L1d], 8
jmp L000
Ld16:
mov [L1d], 16
jmp L000
Ld32:
mov [L1d], 32
jmp L000
L96:
mov [L2], 96
jmp L000
L128:
mov [L2], 128
jmp L000
L192:
mov [L2], 192
jmp L000
L256:
mov [L2], 256
jmp L000
L384:
mov [L2], 384
jmp L000
L512:
mov [L2], 512
jmp L000
L1024:
mov [L2], 1024
jmp L000
L2048:
mov [L2], 2048
jmp L000
L305:
mov [L3], 512
jmp L000
L31:
mov [L3], 1024
jmp L000
L32:
mov [L3], 2048
jmp L000
L33:
mov [L3], 3072
jmp L000
L34:
mov [L3], 4096
jmp L000
L36:
mov [L3], 6144
jmp L000
L38:
mov [L3], 8192
jmp L000
L312:
mov [L3], 12288
jmp L000
L316:
mov [L3], 16384
jmp L000
L000:
ret

View File

@ -0,0 +1,744 @@
;Addresses for bits
FPU_FLAG equ 0001h ;Floating-point unit on-Chip
VME_FLAG equ 0002h ;Virtual Mode Extension
DE_FLAG equ 0004h ;Debugging Extension
PSE_FLAG equ 0008h ;Page Size Extension
TSC_FLAG equ 0010h ;Time-Stamp Counter
MSR_FLAG equ 0020h ;Model Specific Registers
PAE_FLAG equ 0040h ;Physical Address Extension
MCE_FLAG equ 0080h ;Machine Check Exception
CX8_FLAG equ 0100h ;CMPXCHG8 Instruction Supported
APIC_FLAG equ 0200h ;On-chip APIC Hardware Supported
;10_FLAG equ 0400h ;Reserved
SEP_FLAG equ 0800h ;Fast System Call
MTRR_FLAG equ 1000h ;Memory Type Range Registers
PGE_FLAG equ 2000h ;Page Global Enable
MCA_FLAG equ 4000h ;Machine Check Architecture
CMOV_FLAG equ 8000h ;Conditional Move Instruction Supported
PAT_FLAG equ 10000h ;Page Attribute Table
PSE36_FLAG equ 20000h ;36-bit Page Size Extension
PSNUM_FLAG equ 40000h ;Processor serial number present and enabled
CLFLUSH_FLAG equ 80000h ;CLFLUSH Instruction supported
;20_FLAG equ 100000h ;Reserved
DTS_FLAG equ 200000h ;Debug Store
ACPI_FLAG equ 400000h ;Thermal Monitor and Software Controlled Clock Facilities supported
MMX_FLAG equ 800000h ;Intel Architecture MMX technology supported
FXSR_FLAG equ 1000000h ;Fast floating point save and restore
SSE_FLAG equ 2000000h ;Streaming SIMD Extensions supported
SSE2_FLAG equ 4000000h ;Streaming SIMD Extensions 2
SS_FLAG equ 8000000h ;Self-Snoop
;HTT_FLAG equ 10000000h ;Hyper-Threading Technology
TM_FLAG equ 20000000h ;Thermal Monitor supported
IA64_FLAG equ 40000000h ; IA-64
PBE_FLAG equ 80000000h ;Pending Break Enable
; ecx cpuid(1)
SSE3_FLAG equ 0001h ;SSE3 0
MON_FLAG equ 0008h ;MON -3
DS_CPL_FLAG equ 0010h ;DS-CPL -4
VMX_FLAG equ 0020h ;VMX -5
EST_FLAG equ 0080h ; EST-7
TM2_FLAG equ 0100h ; TM2-8
SSSE3_FLAG equ 0200h ;SSSE3 -9
CNXT_ID_FLAG equ 0400h ;CID -10
CX16_FLAG equ 2000h ;CX16 - 13
ETPRD_FLAG equ 4000h ;xTPR - 14
DCA_FLAG equ 40000h ;DCA - 18
; edx cpuid(8000_0001h)
SYS_FLAG equ 0800h ;11
MP_FLAG equ 80000h ;19
NX_FLAG equ 100000h ;20
MMXPi_FLAG equ 400000h ;22
MMXn_FLAG equ 800000h ;23
FXSRn_FLAG equ 1000000h ;24 it is ÌÌÕ+ for Cyrix
FFXSR_FLAG equ 2000000h ;25
TSCP_FLAG equ 8000000h ;27
LM_FLAG equ 20000000h ;29 EM64T
DNo_FLAG equ 40000000h ;30
DN_FLAG equ 80000000h ;31
; ecx cpuid(8000_0001h)
LAHF_FLAG equ 0001h ; LAHF 0
CMPL_FLAG equ 0002h ; core multi-processing legacy mode 1
SVM_FLAG equ 0004h ; secure virtual machine 2
MOVCR8_FLAG equ 0010h ;AltMovCr8 4
;decoding standard features
decode_standard_features:
xor eax,eax
inc eax
cpuid
Test0:
test edx, FPU_FLAG
jnz Test0e
mov dword [FPU+6], $6F6E
jmp Test1
Test0e:
mov dword [FPU+6], $736579
;;;;;;
Test1:
test edx, VME_FLAG
jnz Test1e
mov dword [VME+ 7], $6F6E
jmp Test2
Test1e:
mov dword [VME+ 7], $736579
;;;;;;
Test2:
test edx, DE_FLAG
jnz Test2e
mov dword [DE+ 7], $6F6E
jmp Test3
Test2e:
mov dword [DE+ 7], $736579
;;;;;;
Test3:
test edx, PSE_FLAG
jnz Test3e
mov dword [PSE+ 8], $6F6E
jmp Test4
Test3e:
mov dword [PSE+ 8], $736579
;;;;
Test4:
test edx, TSC_FLAG
jnz Test4e
mov dword [TSC+ 6], $6F6E
jmp Test5
Test4e:
mov dword [TSC+ 6], $736579
;;;;
Test5:
test edx, MSR_FLAG
jnz Test5e
mov dword [MSR+ 7], $6F6E
jmp Test6
Test5e:
mov dword [MSR+ 7], $736579
;;;;
Test6:
test edx, PAE_FLAG
jnz Test6e
mov dword [PAE+ 7], $6F6E
jmp Test7
Test6e:
mov dword [PAE+ 7], $736579
;;;;
Test7:
test edx, MCE_FLAG
jnz Test7e
mov dword [MCE+ 8], $6F6E
jmp Test8
Test7e:
mov dword [MCE+ 8], $736579
;;;;
Test8:
test edx, CX8_FLAG
jnz Test8e
mov dword [CX8+ 6], $6F6E
jmp Test9
Test8e:
mov dword [CX8+ 6], $736579
;;;;
Test9:
test edx, APIC_FLAG
jnz Test9e
mov dword [APIC+ 7], $6F6E
jmp Test11
Test9e:
mov dword [APIC+ 7], $736579
;;;;;
Test11:
test edx, SEP_FLAG
jnz Test11e
mov dword [SEP+ 8], $6F6E
jmp Test12
Test11e:
mov dword [SEP+ 8], $736579
;;;;
Test12:
test edx, MTRR_FLAG
jnz Test12e
mov dword [MTRR+ 6], $6F6E
jmp Test13
Test12e:
mov dword [MTRR+ 6], $736579
;;;;
Test13:
test edx, PGE_FLAG
jnz Test13e
mov dword [PGE+ 7], $6F6E
jmp Test14
Test13e:
mov dword [PGE+ 7], $736579
;;;;;
Test14:
test edx, MCA_FLAG
jnz Test14e
mov dword [MCA+ 7], $6F6E
jmp Test15
Test14e:
mov dword [MCA+ 7], $736579
;;;;
Test15:
test edx, CMOV_FLAG
jnz Test15e
mov dword [CMOV+ 8], $6F6E
jmp Test16
Test15e:
mov dword [CMOV+ 8], $736579
;;;;
Test16:
test edx, PAT_FLAG
jnz Test16e
mov dword [PAT+ 6], $6F6E
jmp Test17
Test16e:
mov dword [PAT+ 6], $736579
;;;;
Test17:
test edx, PSE36_FLAG
jnz Test17e
mov dword [PSE36+ 7], $6F6E
jmp Test18
Test17e:
mov dword [PSE36+ 7], $736579
;;;;
Test18:
test edx, PSNUM_FLAG
jnz Test18e
mov dword [PSNUM+ 7], $6F6E
jmp Test19
Test18e:
mov dword [PSNUM+ 7], $736579
;;;;
Test19:
test edx, CLFLUSH_FLAG
jnz Test19e
mov dword [CLFLUSHn + 8], $6F6E
jmp Test21
Test19e:
mov dword [CLFLUSHn + 8], $736579
;;;;
Test21:
test edx, DTS_FLAG
jnz Test21e
mov dword [DTS+ 7], $6F6E
jmp Test22
Test21e:
mov dword [DTS+ 7], $736579
;;;;
Test22:
test edx, ACPI_FLAG
jnz Test22e
mov dword [ACPI+ 7], $6F6E
jmp Test23
Test22e:
mov dword [ACPI+ 7], $736579
;;;;;
Test23:
test edx, MMX_FLAG
jnz Test23e
mov dword [MMX+ 8], $6F6E
mov dword [MMXs+ 7], $6F6E
jmp Test24
Test23e:
mov dword [MMX+ 8], $736579
mov dword [MMXs+ 7], $736579
;;;;;
Test24:
test edx, FXSR_FLAG
jnz Test24e
mov dword [FXSR+ 6], $6F6E
jmp Test25
Test24e:
mov dword [FXSR+ 6], $736579
;;;;;
Test25:
test edx, SSE_FLAG
jnz Test25e
mov dword [SSE+ 7], $6F6E
jmp Test26
Test25e:
mov dword [SSE+ 7], $736579
;;;;
Test26:
test edx, SSE2_FLAG
jnz Test26e
mov dword [SSE2+ 7], $6F6E
jmp Test27
Test26e:
mov dword [SSE2+ 7], $736579
;;;;
Test27:
test edx, SS_FLAG
jnz Test27e
mov dword [SSn+ 8], $6F6E
jmp Test29;28
Test27e:
mov dword [SSn+ 8], $736579
;;;;
;Test28:
;test edx, HTT_FLAG
;jnz Test28e
;
;mov dword [HTT+ 8], $6F6E
;jmp Test29
;
;Test28e:
;mov dword [HTT+ 8], $736579
;;;;
Test29:
test edx, TM_FLAG
jnz Test29e
mov dword [TM+ 7], $6F6E
jmp Test30
Test29e:
mov dword [TM+ 7], $736579
;;;;
Test30:
test edx, IA64_FLAG
jnz Test30e
mov dword [IA64+ 7], $6F6E
jmp Test31
Test30e:
mov dword [IA64+ 7], $736579
;;;;
Test31:
test edx, PBE_FLAG
jnz Test31e
mov dword [PBE+ 8], $6F6E
jmp Standart_out
Test31e:
mov dword [PBE+ 8], $736579
Standart_out:
ret
;//////////////////////////////////////////////
decode_sse3: ; is SS3 supported
xor eax,eax
inc eax
cpuid
test ecx, $1 ; Test bit 1
jnz .EX; SSE3 technology is supported
jz .EXN
.EX:
mov dword [sse3+ 6], $736579
mov [sse3sup], 1
jmp exitter
.EXN:
mov dword [sse3+ 6], $6F6E
mov [sse3sup],0
exitter:
ret
;//////////////////////////////////////////////
decode_extended_features:
xor eax,eax
inc eax
cpuid
Tes1:
test ecx, SSE3_FLAG
jnz Tes1e
mov dword [SS3+ 8], $6F6E
jmp Tes2
Tes1e:
mov dword [SS3+ 8], $736579
Tes2:
test ecx, MON_FLAG
jnz Tes2e
mov dword [MON+ 8], $6F6E
jmp Tes3
Tes2e:
mov dword [MON+ 8], $736579
Tes3:
test ecx, DS_CPL_FLAG
jnz Tes3e
mov dword [DS_CPL+ 8], $6F6E
jmp Tes4
Tes3e:
mov dword [DS_CPL+ 8], $736579
Tes4:
test ecx, EST_FLAG
jnz Tes4e
mov dword [EST+ 8], $6F6E
jmp Tes5
Tes4e:
mov dword [EST+ 8], $736579
Tes5:
test ecx, TM2_FLAG
jnz Tes5e
mov dword [TM2+ 8], $6F6E
jmp Tes6
Tes5e:
mov dword [TM2+ 8], $736579
Tes6:
test ecx, CNXT_ID_FLAG
jnz Tes6e
mov dword [CNXT_ID+ 12], $6F6E
jmp Tes7
Tes6e:
mov dword [CNXT_ID+ 12], $736579
Tes7:
test ecx, CX16_FLAG
jnz Tes7e
mov dword [CX16+ 12], $6F6E
jmp Tes8
Tes7e:
mov dword [CX16+ 12], $736579
Tes8:
test ecx, ETPRD_FLAG
jnz Tes8e
mov dword [ETPRD+ 12], $6F6E
jmp Tes9
Tes8e:
mov dword [ETPRD+ 12], $736579
Tes9:
test ecx, VMX_FLAG
jnz Tes9e
mov dword [VMX+ 8], $6F6E
jmp Tes10
Tes9e:
mov dword [VMX+ 8], $736579
Tes10:
test ecx, SSSE3_FLAG
jnz Tes10e
mov dword [SSSE3+ 12], $6F6E
jmp Tes11
Tes10e:
mov dword [SSSE3+ 12], $736579
Tes11:
test ecx, DCA_FLAG
jnz Tes11e
mov dword [DCA+ 8], $6F6E
jmp Tes12
Tes11e:
mov dword [DCA+ 8], $736579
Tes12:
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
decode_extended:
xor eax, eax
mov eax,$80000000
cpuid
test eax, 80000000h
jnz gooodd
jmp baaad
baaad:
jmp Tez13
gooodd:
xor eax, eax
mov eax, $80000001 ;// Setup extended function 8000_0001h
cpuid
Tez1:
test edx, MP_FLAG
jnz Tez1e
mov dword [MP+8], $6F6E
jmp Tez2
Tez1e:
mov dword [MP+ 8], $736579
Tez2:
test edx, NX_FLAG
jnz Tez2e
mov dword [NX+ 8], $6F6E
jmp Tez4
;jmp Tez3 we do detection in another place, because of Cyrix specific MMX+ detection
Tez2e:
mov dword [NX+ 8], $736579
;Tez3:
;test edx, MMXPi_FLAG
;jnz Tez3e
;mov dword [MMXPi+ 8], $6F6E
;jmp Tez4
;Tez3e:
;mov dword [MMXPi+ 8], $736579
Tez4:
test edx, MMXn_FLAG
jnz Tez4e
mov dword [MMXn+ 8], $6F6E
jmp Tez5
Tez4e:
mov dword [MMXn+ 8], $736579
Tez5:
test edx, FXSRn_FLAG
jnz Tez5e
mov dword [FXSRn+ 8], $6F6E
jmp Tez6
Tez5e:
mov dword [FXSRn+ 8], $736579
Tez6:
test edx, FFXSR_FLAG
jnz Tez6e
mov dword [FFXSR+ 12], $6F6E
jmp Tez7
Tez6e:
mov dword [FFXSR+ 12], $736579
Tez7:
test edx, TSCP_FLAG
jnz Tez7e
mov dword [TSCP+ 12], $6F6E
jmp Tez8
Tez7e:
mov dword [TSCP+ 12], $736579
Tez8:
test edx, LM_FLAG
jnz Tez8e
mov dword [LM+ 12], $6F6E
jmp Tez9
Tez8e:
mov dword [LM+ 12], $736579
Tez9:
test edx, DNo_FLAG
jnz Tez9e
mov dword [DNo+ 12], $6F6E
jmp Tez10
Tez9e:
mov dword [DNo+ 12], $736579
Tez10:
test edx, DN_FLAG
jnz Tez10e
mov dword [DN+ 12], $6F6E
jmp Tez11
Tez10e:
mov dword [DN+ 12], $736579
;Intel
Tez11:
test edx, SYS_FLAG
jnz Tez11e
mov dword [SYS+ 12], $6F6E
jmp Tez12
Tez11e:
mov dword [SYS+ 12], $736579
Tez12:
test ecx, LAHF_FLAG
jnz Tez12e
mov dword [LAF+ 12], $6F6E
jmp Tez13
Tez12e:
mov dword [LAF+ 12], $736579
Tez13:
test ecx, CMPL_FLAG
jnz Tez13e
mov dword [CMPL+ 12], $6F6E
jmp Tez14
Tez13e:
mov dword [CMPL+ 12], $736579
Tez14:
test ecx, SVM_FLAG
jnz Tez14e
mov dword [SVM+ 8], $6F6E
jmp Tez15
Tez14e:
mov dword [SVM+ 8], $736579
Tez15:
test ecx, MOVCR8_FLAG
jnz Tez15e
mov dword [MCR8+ 12], $6F6E
jmp Tez16
Tez15e:
mov dword [MCR8+ 12], $736579
Tez16:
ret

View File

@ -0,0 +1,433 @@
; optimize the code for size
macro add arg1,arg2
{
if arg1 in <eax,ebx,ecx,edx,esi,edi,ebp,esp>
if arg2 eqtype 0
if arg2 = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if arg2 eqtype 0
if arg2 = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if arg1 in <eax,ebx,ecx,edx,esi,edi,ebp,esp>
if arg2 eqtype 0
if arg2 = 0
xor arg1,arg1
else if arg2 = 1
xor arg1,arg1
inc arg1
else if arg2 = -1
or arg1,-1
else if arg2 > -128 & arg2 < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
; Interface
macro Window xStart,yStart,xSize,ySize,bColor,gColor,fColor
{
mov ebx,xStart
shl ebx,16
add ebx,xSize
mov ecx,yStart
shl ecx,16
add ecx,ySize
mov edx,bColor
mov esi,gColor
mov edi,fColor
xor eax,eax
int 0x40
}
;WriteTextToWindow
macro Text xStart,yStart,rgbColor,pText,nTextLen
{
mov ebx,xStart
shl ebx,16
add ebx,yStart
mov ecx,rgbColor
mov edx,pText
mov esi,nTextLen
mov eax,4
int 0x40
}
;DisplayNumber
macro Number xStart,yStart,nPrintType,noOfDigits,Data,rgbColor
{
mov edx,xStart
shl edx,16
add edx,yStart
mov ebx,noOfDigits
shl ebx,16
or ebx,nPrintType
mov ecx,Data
mov esi,rgbColor
mov eax,47
int 0x40
}
macro DrawLine xStart,xEnd,yStart,yEnd,rgbColor
{
mov ebx,xStart
shl ebx,16
add ebx,xEnd
mov ecx,yStart
shl ecx,16
add ecx, yEnd
mov edx,rgbColor
mov eax,38
int 0x40
}
macro PutImage xPos,yPos,xImage,yImage,pImage
{
mov ecx,xImage
shl ecx,16
add ecx, yImage
mov edx,xPos
shl edx,16
add edx,yPos
mov ebx,pImage
mov eax,7
int 0x40
}
macro Button xStart,yStart,xSize,ySize,nID,rgbColor
{
mov ebx,xStart
shl ebx,16
add ebx,xSize
mov ecx,yStart
shl ecx,16
add ecx,ySize
mov edx,nID
mov esi,rgbColor
mov eax,8
int 0x40
}
macro CreateTread EntryPoint,StackPos
{
xor ebx,ebx
inc ebx
mov ecx,EntryPoint
mov edx,StackPos
mov eax,51
int 0x40
}
;//////////////////////////////////////////////
;Decoding Brand ID for Intel
decodebrand:
cmp dword[smallvendor], 'cAMD'
jz amd_br
cmp dword[smallvendor], 'ntel'
jz intel_br
jmp Bi00 ; if not AMD or Intel
amd_br: ;;;;;;;;;;;;;;;;;;;;; amd brand
xor eax,eax
inc eax
cpuid
cnnn0:
cmp bl, 00h
ja rr
je cnnn1
rr:
mov byte [brand], bl ;
Text 275,210,0x00000000,abrand00, abrand00len-abrand00
jmp B000
;jmp comppp
cnnn1:
mov eax, 0x80000001 ; CPUID ext. function 0x80000001
cpuid
cmp ebx, 0
je Bi00
mov word [brand], bx ;
comppp:
cmp [brand], 400h
jl res1
cmp [brand], 500h
jl res2
jae res3
res1:
Text 275,210,0x00000000,abrand0, abrand0len-abrand0
jmp B000
res2:
Text 275,210,0x00000000,abrand1, abrand1len-abrand1
jmp B000
res3:
Text 275,210,0x00000000,abrand2, abrand2len-abrand2
jmp B000
;;;;;;;;;;;;;;;;;;;;; intel brand
intel_br:
xor eax,eax
inc eax
cpuid
cmp0:
cmp bl, 00h
je Bi00
cmp1:
cmp bl, 01h
je Bi01
cmp2:
cmp bl, 02h
je Bi02
cmp3:
cmp bl, 03h
je Bi03
cmp4:
cmp bl, 04h
je Bi04
cmp6:
cmp bl, 06h
je Bi06
cmp7:
cmp bl, 07h
je Bi07
cmp8:
cmp bl, 08h
je Bi08
cmp9:
cmp bl, 09h
je Bi09
cmpA:
cmp bl, 0Ah
je Bi0A
cmpB:
cmp bl, 0Bh
je Bi0B
cmpC:
cmp bl, 0Ch
je Bi0C
cmpE:
cmp bl, 0Eh
je Bi0E
cmpF:
cmp bl, 0Fh
je Bi0F
cmp11:
cmp bl, 11h
je Bi11
cmp12:
cmp bl, 12h
je Bi12
cmp13:
cmp bl, 13h
je Bi13
cmp14:
cmp bl, 14h
je Bi14
cmp15:
cmp bl, 15h
je Bi15
cmp16:
cmp bl, 16h
je Bi16
cmp17:
cmp bl, 17h
je Bi17
jne Bi00
;------------------
Bi00:
mov byte [brand], bl ;00h
Text 65,270,0x00000000,brand0, brand0len-brand0
;Number 275,200,1*256,2,dword [brand],0x000000 was in v. 1.11
jmp B000
Bi01:
mov [brand], 01h
Text 65,270,0x00000000,brand01, brand01len-brand01
jmp B000
Bi02:
mov [brand], 02h
Text 65,270,0x00000000,brand02, brand02len-brand02
jmp B000
Bi03:
mov [brand], 03h
cmp [m], 8
je E3
Text 65,270,0x00000000,brand03, brand03len-brand03
jmp B000
E3:
Text 65,270,0x00000000,brand03d, brand03dlen-brand03d
jmp B000
Bi04:
mov [brand], 04h
Text 65,270,0x00000000,brand04, brand04len-brand04
jmp B000
Bi06:
mov [brand], 06h
Text 65,270,0x00000000,brand06, brand06len-brand06
jmp B000
Bi07:
mov [brand], 07h
Text 65,270,0x00000000,brand07, brand07len-brand07
jmp B000
Bi08:
mov [brand], 08h
Text 65,270,0x00000000,brand08, brand08len-brand08
jmp B000
Bi09:
mov [brand], 09h
Text 65,270,0x00000000,brand09, brand09len-brand09
jmp B000
Bi0A:
mov [brand], 0Ah
Text 65,270,0x00000000,brand0A, brand0Alen-brand0A
jmp B000
Bi0B:
mov [brand], 0Bh
cmp [m], 13
jl Eb
Text 65,270,0x00000000,brand0B, brand0Blen-brand0B
jmp B000
Eb:
Text 65,270,0x00000000,brand0Bd, brand0Bdlen-brand0Bd
jmp B000
Bi0C:
mov [brand], 0Ch
Text 65,270,0x00000000,brand0C, brand0Clen-brand0C
jmp B000
Bi0E:
mov [brand], 0Eh
cmp [m], 13
jl Ed
Text 65,270,0x00000000,brand0E, brand0Elen-brand0E
jmp B000
Ed:
Text 65,270,0x00000000,brand0Ed, brand0Edlen-brand0Ed
jmp B000
Bi0F:
mov [brand], 0Fh
Text 65,270,0x00000000,brand0F, brand0Flen-brand0F
jmp B000
Bi11:
mov [brand], 11h
Text 65,270,0x00000000,brand11, brand11len-brand11
jmp B000
Bi12:
mov [brand], 12h
Text 65,270,0x00000000,brand12, brand12len-brand12
jmp B000
Bi13:
mov [brand], 13h
Text 65,270,0x00000000,brand13, brand13len-brand13
jmp B000
Bi14:
mov [brand], 14h
Text 65,270,0x00000000,brand14, brand14len-brand14
jmp B000
Bi15:
mov [brand], 15h
Text 65,270,0x00000000,brand15, brand15len-brand15
jmp B000
Bi16:
mov [brand], 16h
Text 65,270,0x00000000,brand16, brand16len-brand16
jmp B000
Bi17:
mov [brand], 17h
Text 65,270,0x00000000,brand17, brand17len-brand17
jmp B000
B000:
ret

View File

@ -0,0 +1,274 @@
newrating:
cmp [FRS], 266
jz f266
cmp [FRS], 333
jz f333
cmp [FRS], 400
jz f400
f266:
;ôîðìóëû âû÷èñëåíèÿ XP-ðåéòèíãà Athlon-îâ (Tbred, Barton):
;FSB266/256kB: ñäåëàíî
;XP+ (Freq<2000MHz) = 1000 + (Freq-1000)*1,5 = Freq*1.5-500
;XP+ (Freq>=2000MHz) = 900 + (Freq-1000)*1,5 = Freq*1.5-600
cmp [total], 2000
jl pal
; Ðåéòèíã äëÿ Ïàëîìèíî 2000+
mov eax,[total]
imul eax, 3
shr eax,1
sub eax, 600
mov [rating], eax
jmp vyxod
pal:
; Ðåéòèíã äëÿ Ïàëîìèíî 2000-
mov eax,[total]
imul eax, 3
shr eax,1
sub eax, 500
mov [rating], eax
jmp vyxod
f333:
cmp [L2], 256
jl .Th ; Thorton
;FSB333/512kB: ñäåëàíî
;XP+ (Freq<2100MHz) = Freq*1.2 + 300
;XP+ (Freq>=2100MHz) = Freq*1.2 + 400
cmp [total], 2100
jl .r2100
mov eax,[total]
xor edx, edx
imul eax, 600000
mov ebx, 500000
div ebx
mov [rating], eax
add [rating], 400
; Rating for Barton F<2000 MHz
jmp vyxod
.r2100:
mov eax,[total]
xor edx, edx
imul eax, 600000
mov ebx, 500000
div ebx
mov [rating], eax
add [rating], 300
; Rating for Barton F>2000 MHz
jmp vyxod
;FSB333/256kB: ñäåëàíî
;XP+ = Freq*1.2 + 100
.Th:
mov eax,[total]
xor edx, edx
imul eax, 600000
mov ebx, 500000
div ebx
mov [rating], eax
add [rating], 100
;Rating for Thorton
jmp vyxod
f400:
;FSB400/512kB:
;XP+ = Freq*1.5 - 100
mov eax,[total]
imul eax, 3
shr eax,1
sub eax, 100
mov [rating], eax
vyxod:
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
multipl:
;--- âû÷èñëåíèå êîýôôèöèåíòà óìíîæåíèÿ -
; ïîðòèò ðåãèñòðû
; out : CL = êîýôô.óìíîæåíèÿ * 10, èëè 0
xor ecx, ecx
cmp dword[smallvendor], 'cAMD' ; Check for Advanced Micro Devices CPU
jne noAMD
cmp byte [f], 5
jne noAMDK6
mov eax, 68 ; AMD-K6 (p.30)
mov ebx, 3
mov edx, 0x0C0000087
int 0x40 ; eax - low dword
and eax, 111b
mov cl, [athloncoef3 + eax]
cmp eax, 6
jne @f
cmp byte[m], 8
jae @f
mov cl, 20
@@: ret
noAMDK6:cmp byte [f], 6
jne noAMDK7
cmp byte [m], 5
jna @f
mov eax, 0x80000007
cpuid
and edx, 6 ; voltage ID control & frequency ID control
cmp edx, 6
je AMDK7M
@@: mov eax, 68 ; Athlon/AthlonXP
mov ebx, 3
mov edx, 0x0C0010015
int 0x40
mov ebx, eax
shr ebx, 24
and ebx, 0x0F
shr eax, 20
jnc @f
add bl, 16
@@: mov cl, [athloncoef + ebx]
ret
AMDK7M: mov eax, 68 ; AthonXP-M
mov ebx, 3
mov edx, 0xC0010042
int 0x40
and eax, 0x1F
mov cl, [athlonmcoef + eax]
ret
noAMDK7:cmp byte [f], 0xF
jne noAMDK8
mov eax, 0x80000007
cpuid
and edx, 6 ; voltage ID control & frequency ID control
cmp edx, 6
je AMDK8M
mov eax, 68 ; Athon64
mov ebx, 3
mov edx, 0xC0010015
int 0x40
shr eax, 24
and al, 0x3F
shr al, 1
add al, 4
mov dl, 10
mul dl
mov cl, al
ret
AMDK8M: mov eax, 68 ; Athon64-M
mov ebx, 3
mov edx, 0xC0010042
int 0x40
and al, 0x3F
shr al, 1
add al, 4
mov dl, 10
mul dl
mov cl, al
ret
;/////////////////////////////////////////////////////////
noAMD: cmp dword [smallvendor], 'ntel' ; Check for International Electronics CPU
jne noIntel
cmp byte[f], 0x0F
jne noIntelP4
cmp byte [t], 6
jne @f
mov eax, 68 ; Pentium M
mov ebx, 3
mov edx, 0x2A
int 0x40
shr eax, 22
and eax, 0x1F
mov dl, 10
mul dl
mov cl, al
ret
@@: cmp byte [m], 2
jae @f
mov eax, 68 ; Pentium 4 / Xeon (model < 2) Willamete
mov ebx, 3
mov edx, 0x2A
int 0x40
shr eax, 8
and eax, 0x0F
mov cl, [p4coef + eax]
ret
@@: mov eax, 68 ; Pentium 4 / Xeon (model >= 2) NorthWood
mov ebx, 3
mov edx, 0x2C
int 0x40
shr eax, 24
and eax, 0x1F
mov dl, 10
mul dl
mov cl, al
ret
noIntelP4:
cmp byte[f], 6
jne noIntelP6
mov eax, 68 ; Pentium Pro / Pentium II / Pentium III
mov ebx, 3
mov edx, 0x2A
int 0x40
shr eax, 22
test al, 0x20
jz @f
or al, 0x10
@@: and eax, 0x1f
cmp byte[m], 0x06 ; ? 7
ja @f
and al, 0x0f
@@:
mov cl, [coppercoeff + eax]
cmp byte[m], 0x0B
jb @f
mov cl, [tualatcoeff + eax]
cmp byte[m], 0x0B
je @f
mov dl, 10 ; model 0x0C - 0x0F - Dothan / Yonah / Conroe / Merom
mul dl
mov cl, al
@@: ret
noIntel:
noIntelP6:
noAMDK8:
ret

View File

@ -250,7 +250,7 @@ CX16:
CX16len: CX16len:
ETPRD: ETPRD:
db 'ETPRD: ' db 'xTPR/ETPRD: ' ; xTPR
ETPRDlen: ETPRDlen:
;Extended2 ;Extended2
@ -264,7 +264,7 @@ MP:
MPlen: MPlen:
NX: NX:
db 'NX(XD): ' db 'NX/XD: '
NXlen: NXlen:
MMXPi: MMXPi:
@ -288,7 +288,7 @@ TSCP:
TSCPlen: TSCPlen:
LM: LM:
db 'LM(AA64): ' db 'EM64T/LM: ' ; AA64
LMlen: LMlen:
DNo: DNo:
@ -302,6 +302,31 @@ DNlen:
LAF: LAF:
db 'LAHF: ' db 'LAHF: '
LAFlen: LAFlen:
VMX:
db 'VMX: '
VMXlen:
SSSE3:
db 'SSSE3: '
SSSE3len:
DCA:
db 'DCA: '
DCAlen:
MCR8:
db 'MCR8: '
MCR8len:
SVM:
db 'SVM: '
SVMlen:
CMPL:
db 'CMPL: '
CMPLlen:
;================================ ;================================
abrand00: abrand00:
db '8-bit Brand (no details)' db '8-bit Brand (no details)'

View File

@ -76,7 +76,7 @@ do_draw:
mov esi,label1_len ; text length mov esi,label1_len ; text length
int 0x40 int 0x40
mov ecx,[sc.work_button_text] ; 8b window nro - RR GG BB color mov ecx,0xeeeeee ; 8b window nro - RR GG BB color
or ecx,0x10000000 or ecx,0x10000000
mov ebx,25*65536+30 mov ebx,25*65536+30
mov edx,label2 ; pointer to text beginning mov edx,label2 ; pointer to text beginning
@ -88,7 +88,6 @@ do_draw:
mov esi,label3_len ; text length mov esi,label3_len ; text length
int 0x40 int 0x40
mov ecx,0xffffff
mov ebx,45*65536+41 mov ebx,45*65536+41
mov edx,label4 ; pointer to text beginning mov edx,label4 ; pointer to text beginning
mov esi,label4_len ; text length mov esi,label4_len ; text length

View File

@ -469,10 +469,14 @@ draw_window:
add ecx, BTN_HEIGHT-1 add ecx, BTN_HEIGHT-1
; edx = button identifier ; edx = button identifier
mov esi, [sc.work] mov esi, [sc.work]
cmp esi, 0xdfdfdf
jb nocorrect
sub esi, 0x1b1b1b
nocorrect:
inc dl inc dl
cmp [edi + cur_sel], dl cmp [edi + cur_sel], dl
jne .nohighlight jne .nohighlight
add esi, 0x101010 add esi, 0x1a1a1a
.nohighlight: .nohighlight:
or edx, 0x20000000 or edx, 0x20000000
int 0x40 int 0x40

View File

@ -989,6 +989,7 @@ draw_window:
int 0x40 int 0x40
mov eax, [system_colours+4*6] mov eax, [system_colours+4*6]
sub eax, 0x101010
mov [wcolor], eax mov [wcolor], eax
mov eax,14 ; get screen max x & max y mov eax,14 ; get screen max x & max y
@ -1813,12 +1814,12 @@ dalshe:
draw_cpu_usage: draw_cpu_usage:
pusha pushad
mov [ysi],30 mov [ysi],30
cmp [graph_text],1 cmp [graph_text],1
jne @f jne @f
mov [ysi],10 mov [ysi],12
@@: @@:
@ -1838,6 +1839,10 @@ draw_cpu_usage:
pop ebx pop ebx
inc ebx inc ebx
div ebx div ebx
cmp eax,[ysi]
jng no_bug
mov eax,[ysi]
no_bug:
push eax push eax
mov eax,13 mov eax,13
@ -1848,48 +1853,22 @@ draw_cpu_usage:
push ebx push ebx
mov eax,13 mov eax,13
mov ecx,5*65536 mov ecx,5*65536
add cx,word [ysi] add ecx,[ysi]
inc cx mov edx,0xff0000 ;[sc.work_button]
push ebx
inc ecx
sub ebx,1 shl 16
add ebx,2
xor edx,edx
int 0x40
dec ecx
pop ebx
mov edx,0xff0000 ;[wcolor]
; sub edx,0x303030
int 0x40 int 0x40
pop ebx pop ebx
pop eax pop eax
; push ebx
inc eax
mov ecx,5*65536 mov ecx,5*65536
mov cx,ax mov cx,ax
; pop ebx
push ecx
push ebx
sub ecx,1 shl 16
add ecx,1
sub ebx,1 shl 16
add ebx,2
mov eax,13 mov eax,13
xor edx,edx mov edx,0x44aa44 ;[sc.work_button]
int 0x40
pop ebx
pop ecx
mov edx,0x44aa44 ;[wcolor]
; add edx,0x00101010
int 0x40 int 0x40
popa popad
ret ret
; DATA ; DATA
stripe: stripe:

View File

@ -200,7 +200,7 @@ nofuncbtns: ;
_BTNS_ = 8 ; ª®«¨ç¥á⢮ ª­®¯®ª ("¯ã­ªâ®¢ ¬¥­î") _BTNS_ = 7 ; ª®«¨ç¥á⢮ ª­®¯®ª ("¯ã­ªâ®¢ ¬¥­î")
if lang eq ru if lang eq ru
font = 0x00000000 font = 0x00000000
@ -345,46 +345,31 @@ DATA
strtbl startapps ,\ strtbl startapps ,\
<"/RD/1/PIC4",0> ,\ <"/RD/1/PIC4",0> ,\
<"/RD/1/SKINSEL",0> ,\
<"/RD/1/DESKTOP",0> ,\ <"/RD/1/DESKTOP",0> ,\
<"/RD/1/MV",0> ,\
<"/RD/1/JPEGVIEW",0> ,\
<"/RD/1/CPU",0> ,\
<"/RD/1/SPANEL",0> ,\
<"/RD/1/ICON",0> ,\ <"/RD/1/ICON",0> ,\
<"/RD/1/VRR",0> <"/RD/1/SETUP",0> ,\
<"/RD/1/VRR",0> ,\
; header: ; § £®«®¢®ª <"/RD/1/CPU",0>
; db 'M E N U'
; header_len = $ - header
; text: ; ⥪áâ ­  ª­®¯ª å
; db 'Background '; 12
; db 'Colors '
; db 'MeView '
; db 'Processes '
; db 'Panel setup '
; db 'Icon manager'
sz header, "KolibriOS" sz header, "KolibriOS"
lsz text,\ lsz text,\
en, 'Background ',\ en, 'Background ',\
en, 'Colors ',\ en, 'Change skin ',\
en, 'MeView ',\ en, 'Desktop ',\
en, 'JpegView ',\
en, 'Processes ',\
en, 'Panel setup ',\
en, 'Icon manager',\ en, 'Icon manager',\
en, 'Device setup',\
en, 'VRR ',\ en, 'VRR ',\
en, 'Processes ',\
\ \
ru, 'ƒ¥­¥à â®à ®¡®¥¢ ',\ ru, 'ƒ¥­¥à â®à ®¡®¥¢ ',\
ru, '‘¨á⥬­ë¥ æ¢¥â  ',\ ru, '‘¬¥­  ᪨­  ',\
ru, '<27>à®á¬®âà BMP ',\ ru, '<27> áâனª  ®ª®­ ',\
ru, '<27>à®á¬®âà JPEG ',\
ru, '<27>à®æ¥ááë ',\
ru, '<27> áâனª  ¯ ­¥«¨ ',\
ru, '“¯à ¢«¥­¨¥ ¨ª®­ª ¬¨ ',\ ru, '“¯à ¢«¥­¨¥ ¨ª®­ª ¬¨ ',\
ru, '<27> áâனª  ¬®­¨â®à  ' ru, '<27> áâனª  ãáâனá⢠',\
ru, '<27> áâனª  ¬®­¨â®à  ',\
ru, '<27>à®æ¥ááë '
start_info: start_info:
.mode dd 7 .mode dd 7

View File

@ -0,0 +1,2 @@
@fasm skinsel.asm skinsel
@pause

View File

@ -0,0 +1,101 @@
use32
db 'MENUET01'
dd 1
dd start
dd i_end
dd mem, mem
dd 0, 0
start:
push 70
pop eax
mov ebx, fileinfo
int 0x40
cmp ebx, max_file_size
jz exit
cmp ebx, -1
jnz @f
exit:
or eax, -1
int 0x40
@@:
mov esi, filebuf
xor ecx, ecx
scan1l1:
or edi, -1
scan1:
inc edi
lodsb
test al, al
jz scan1done
cmp al, 13
jz newline
cmp al, 10
jnz scan1
newline:
test edi, edi
jz scan1l1
inc ecx
jmp scan1l1
scan1done:
test edi, edi
jz @f
inc ecx
@@:
jecxz exit
push 3
pop eax
int 0x40
ror eax, 16
mov edx, 1024
@@:
sub eax, 0x43ab45b5
ror eax, 1
xor eax, 0x32c4324f
ror eax, 1
dec edx
jnz @b
div ecx
; use edx as random index
mov esi, filebuf
scan2l1:
push esi
or edi, -1
scan2:
inc edi
lodsb
test al, al
jz newline2
cmp al, 13
jz newline2
cmp al, 10
jnz scan2
newline2:
pop eax
test edi, edi
jz scan2l1
dec edx
jns scan2l1
mov byte [esi-1], 0
; set eax (-> ASCIIZ string) as skin
mov [eax-4], esi
lea ecx, [eax-20]
push 48
pop eax
mov bl, 8
int 0x40
jmp exit
fileinfo:
dd 0
dq 0
dd max_file_size
dd filebuf
db '/rd/1/skinsel.dat',0
i_end:
max_file_size = 0x1000 - 0x40 - $
filebuf:
rb max_file_size
; stack
rb 0x40
mem:

View File

@ -0,0 +1,9 @@
/rd/1/default.skn
/rd/1/aqua.skn
/rd/1/cold.skn
/rd/1/metal.skn
/rd/1/grey.skn
/rd/1/opus_a.skn
/rd/1/opus_b.skn
/rd/1/opus_d.skn
/rd/1/opus_g.skn