diff --git a/kernel/trunk/boot/bootcode.inc b/kernel/trunk/boot/bootcode.inc index b30f7d09af..b59ed3a454 100644 --- a/kernel/trunk/boot/bootcode.inc +++ b/kernel/trunk/boot/bootcode.inc @@ -59,17 +59,17 @@ os_data_l: ; --------------- APM --------------------- apm_code_32: - dw 0x10 ; limit 64kb + dw 0x0f ; limit 64kb db 0, 0, 0 dw 11010000b *256 +10011010b db 0x00 apm_code_16: - dw 0x10 + dw 0x0f db 0, 0, 0 dw 10010000b *256 +10011010b db 0x00 apm_data_16: - dw 0x10 + dw 0x0f db 0, 0, 0 dw 10010000b *256 +10010010b db 0x00 diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index c9b8e26340..76e3fcefcd 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -912,12 +912,21 @@ reserve_irqs_ports: ; RESERVE PORTS - mov edi,1 ; 0x00-0xff + mov edi,1 ; 0x00-0xdf mov [0x2d0000],edi shl edi,4 mov [0x2d0000+edi+0],dword 1 mov [0x2d0000+edi+4],dword 0x0 + mov [0x2d0000+edi+8],dword 0xdf + + inc dword [0x2d0000] ; 0xe5-0xff + mov edi,[0x2d0000] + shl edi,4 + mov [0x2d0000+edi+0],dword 1 + mov [0x2d0000+edi+4],dword 0xe5 mov [0x2d0000+edi+8],dword 0xff + + ; cmp [0xf604],byte 2 ; com1 mouse -> 0x3f0-0x3ff ; jne ripl1 ; inc dword [0x2d0000] diff --git a/programs/system/cpuid/trunk/CPUID.ASM b/programs/system/cpuid/trunk/CPUID.ASM new file mode 100644 index 0000000000..07266fd3a9 --- /dev/null +++ b/programs/system/cpuid/trunk/CPUID.ASM @@ -0,0 +1,2319 @@ +;****************************************************************************** +; project name: CPUID * +; target platform: KolibriOS, x86 (IA-32), x86-64 achitectures * +; compiler: flat assembler 1.67.5 * +; version: 2.05 * +; last update: 1st November 2006 1st 2nd 3rd 4th * +; maintained by: Sergey Kuzmin aka Wildwest * +; e-mail: kuzmin_serg@list.ru * +; site: http://coolthemes.narod.ru/files.html * +; license: Copyright 2004-2006 Sergey Kuzmin and coauthors * +; Rules: * +; 1)you can use pieces of code in your project, but should * +; mention original author; * +; 2)if you modify CPUID (improve, port, translate, etc) send * +; your changes to maintainer or KolibriOS project leader * +;-----------------------------------------------------------------------------* +; English comments * +;------------------------------------------------------------------------------ +use32 + org 0x0 + db 'MENUET01' + dd 0x01 + dd START + dd I_END + dd U_END+4096*8 + dd U_END+4096*8 + ; dd 0x100000+4096 + ; dd 0x100000+4096 + dd 0x0 + dd 0x0 + +macro udata +{ +} + +include 'mos_uzel.inc' +; useful macroses and some required stuff +;(L1 and L2 cashes decoding for Intel) + +include 'gif2img.inc' +; include macro to convert gif to img + +;include 'debug.inc' +include 'rsatest.inc' +include 'variable.inc' + +START: ; LET'S GO!!! +;------------ +CYCLES: +; CPU speed + mov eax, 18 + mov ebx,5 + int 0x40 + mov [total1],eax ;in Hz example 1600490000 + xor edx,edx + mov ebx,1000000 + div ebx + mov [total], eax ; in Mhz example 1600 + xor edx, edx + mov eax, [total1] + mov ebx, 10000 + div ebx + mov [ost], eax ; example 160049 + mov eax, [total] + imul eax, 100 + mov [sot], eax ; example 160000 + mov eax, [ost] + sub eax, [sot] + mov [sot], eax ; example 49 +;------------ +cpu: ;is CPUID supported? + pushfd ;push original EFLAGS + pop eax ;get original EFLAGS + mov ebx, eax ;save original EFLAGS + xor eax, 00200000h ;flip 21th bit in EFLAGS + push eax ;save new EFLAGS value on stack + popfd ;replace current EFLAGS value + pushfd ;get new EFLAGS + pop eax ;store new EFLAGS in EAX + cmp eax, ebx ;compare values of 21th bit + jz NO_CPUID ;CPUID isn't supported +;------------ +CPUNAME: ; VENDOR + mov eax,0 ; eax=0 + cpuid + + mov [stdc], eax ; number of calls + mov [cpuname+ 12],ebx + mov [cpuname+ 16],edx + mov [cpuname+ 20],ecx + mov [smallvendor],ecx + +; for various vendors we should later use different methods + +;Decoding cache L1 and L2 for Intel + + cmp [smallvendor], 'ntel' + jne cpu1 ;is not Intel + je .detec +.detec: + +;Starting L1, L2, L3 caches detection (Intel made it VERY HARD) + +mov eax, 2 +cpuid + +mov [che], al ; number of calls +multik: +dec [che] + +.eaxl: +test eax, $80000000 ; Test bit 31 +jnz .ebxl ; <> 0 =>not valid values +shr eax, 8 +call decodecache +shr eax, 8 +call decodecache +shr eax, 8 +call decodecache +.ebxl: +test ebx, $80000000 +jnz .ecxl +mov eax, ebx +call decodecache +shr eax, 8 +call decodecache +shr eax, 8 +call decodecache +shr eax, 8 +call decodecache +.ecxl: +test ecx, $80000000 +jnz .edxl +mov eax, ecx +call decodecache +shr eax, 8 +call decodecache +shr eax, 8 +call decodecache +shr eax, 8 +call decodecache +.edxl: +test edx, $80000000 +jnz cpu1 +mov eax, edx +call decodecache +shr eax, 8 +call decodecache +shr eax, 8 +call decodecache +shr eax, 8 +call decodecache + +cmp [che], 0 ; we made all calls +je cpu1 + +multi: ; not yet + +mov eax, 2 ; so we made call again +cpuid + +jmp multik + +; FAMILY MODEL STEPPING +cpu1: + xor eax, eax + inc eax ; eax=1 + cpuid + +mov ecx, eax +and ecx,00000F00h ; get CPU family +shr ecx,8 ; shift it to the correct position +mov dword[f],ecx + +mov ecx, eax +and ecx,000000F0h ; get CPU model +shr ecx,4 +mov dword[m],ecx + +mov ecx, eax +and ecx,0000000Fh ; get CPU stepping +mov dword[s],ecx + +;- +mov ecx, eax ; get Type +shl ecx, 18 +shr ecx,30 +;and ecx, 0000000Fh ; only two lower bits can be nonzero +mov dword[t], ecx +;======================================================= + +cmp dword[smallvendor], 'cAMD' +jz maybe_athlon +cmp dword[smallvendor], 'ntel' +jz detect_it +jmp no_full ; if not AMD or Intel + +detect_it: +cmp [f], 0Fh +jne no_full + +full: + +mov ecx, eax ; get Extended model +shr ecx,16 ;shift it to the correct position +and ecx, 0000000Fh +shl ecx, 4 +add ecx, [m] +mov dword[em],ecx ; effective model + +mov ecx, eax ; get Extended family +shr ecx, 20 ;shift it to the correct position +and ecx, 000000FFh +add ecx, [f] +mov dword[ef],ecx ; effective family + + +jmp fut + +no_full: + +mov ecx, [m] +mov [em], ecx + +mov ecx, [f] +mov [ef], ecx + +jmp fut + +maybe_athlon: +mov eax, 0x80000001 ; CPUID ext. function 0x80000001 +cpuid +mov ecx, eax +and ecx,00000F00h ; get CPU family +shr ecx,8 ; shift it to the correct position +mov dword[ef],ecx + +mov ecx, eax +and ecx,000000F0h ; get CPU model +shr ecx,4 +mov dword[em],ecx + +fut: + +call decode_sse3 +;- + call decode_extended + + mov eax,$80000000 + cpuid + + mov [extc], eax ; max number of calls + + test eax, $80000000 ;// Test bit 31 + jz .noname + + cmp eax,$80000003 + ja .mynameis + jmp .noname + +.mynameis: + mov eax,$80000002 + cpuid + mov [myname],eax + mov [myname+4],ebx + mov [myname+8],ecx + mov [myname+12],edx + mov eax,$80000003 + cpuid + mov [myname+16],eax + mov [myname+20],ebx + mov [myname+24],ecx + mov [myname+28],edx + mov eax,$80000004 + cpuid + mov [myname+32],eax + mov [myname+36],ebx + mov [myname+40],ecx + mov [myname+44],edx + jmp red + +.noname: +mov dword [myname], $612F6E + +red: + +xor ecx, ecx +xor eax, eax +xor edx, edx +xor ebx, ebx + +;mov byte [multiplier], 115; ; for testing + +call multipl ; get multiplier +mov byte [multiplier], cl + +xor eax, eax +xor ebx, ebx +xor ecx, ecx +xor edx, edx + +cmp dword[multiplier], 0 +jz contin + +calc: + +mov eax,dword [ost] ; example 166474 +imul eax, 10 ; example 1664740 +mov ebx, dword [multiplier] ; get system clock (if multiplier detected) +div ebx +mov dword [freqbb], eax ; 16647 + +xor eax, eax +xor ebx, ebx +xor ecx, ecx +xor edx, edx + +mov eax,dword [ost] ;example 166474 +mov ebx,10 +div ebx ; example 16647 + +mov dword [temp], eax + +xor eax, eax +xor ebx, ebx +xor ecx, ecx +xor edx, edx + +mov eax, dword [temp] + +mov ebx, dword [multiplier] +div ebx ; example 166 + +imul eax, 100 +mov dword[freqll], eax ; example 16600 + +xor eax, eax +xor ebx, ebx +xor ecx, ecx +xor edx, edx + +mov eax, dword[freqbb]; example 16647 +sub eax, dword[freqll]; example 16600 +mov dword[freqll], eax ;example 47 + + +xor eax, eax +xor ebx, ebx +xor ecx, ecx +xor edx, edx + + +mov eax,dword [freqbb]; example 16647 +mov ebx, 100 +div ebx +mov dword [freqbb], eax ; example 166 + +xor eax, eax +xor ebx, ebx +xor ecx, ecx +xor edx, edx + + mov eax,dword[multiplier] ; example 115 + mov ebx,10 + div ebx + mov dword[multb], eax ; example 11 + + imul eax, 10 + mov dword[multa], eax ; example 110 + +xor eax, eax +xor ebx, ebx +xor ecx, ecx +xor edx, edx + + mov eax, dword[multiplier] + sub eax, dword[multa] + mov dword[multa], eax ; example 5 + +xor eax, eax +xor ebx, ebx +xor ecx, ecx +xor edx, edx + +jmp output + +contin: + +mov dword [freqbb], 0 +mov dword [freqll], 0 + +output: + + call draw_window ; Draw window + +typedetect: + +cmp [t], 00b +jne t2d +Text 275,190,0x00000000,t1, t1len-t1 +jmp PROCCORE +t2d: +cmp [t], 01b +jne t3d +Text 275,190,0x00000000,t2, t2len-t2 +jmp PROCCORE +t3d: +cmp [t], 11b +jne notype +Text 275,190,0x00000000,t3, t3len-t3 +jmp PROCCORE +notype: +Text 275,190,0x00000000,t4, t4len-t4 + +PROCCORE: ; Who are you? +; Intel - "GenuineIntel" + +; AMD - "AuthenticAMD" + +; Cyrix - "CyrixInstead" + +; UMC - "UMC UMC UMC " +; NexGen - "NexGenDriven" +; Centaur - "CentaurHauls" + +; Rise Technology - "RiseRiseRise" +; SiS - "SiS SiS SiS " +; Transmeta - "GenuineTMx86" + +; National Semiconductor - "Geode by NSC" + + cmp dword[smallvendor], 'ntel' + jz Intel + cmp dword[smallvendor], 'cAMD' + jz AMD + cmp dword[smallvendor], 'tead' + jz Cyrix + cmp dword[smallvendor], 'auls' + jz Centaur + cmp dword[smallvendor], 'Mx86' + jz Transmeta + +; cmp ecx, 'UMC ' +; jz .UMC +; cmp ecx, 'iven' +; jz .NexGen +; cmp ecx, 'Rise' +; jz .Rise +; cmp ecx, 'SiS ' +; jz .SiS +; cmp ecx, ' NSC' +; jz .NSC + jmp Other ; I don't know what to do with you... +Other: +Text 80,90,0x00000000,other, otherlen-other + jmp MMXtest +;------------------------- + +AMD: + +Text 20, 210,0x00000000,cache, cachelen-cache + +Text 80,90,0x00000000,AMDn, AMDnlen-AMDn + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Print the unpacked img to screen + mov esi, amd + call load_gif + mov eax,7 ; sysfunc7: putimage + mov ebx,img_area+8 ; pointer to image + 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 +;CACHE1: +mov eax, 80000005h + cpuid +shr ecx, 24 +mov [L1d], ecx +shr edx, 24 +mov [L1i], edx +;CACHE2: +mov eax, 80000006h + cpuid +shr ecx, 16 +mov [L2],ecx + cmp [f], $5 + jz .fiv + cmp [f], $6 + jz .si + cmp [f], $F + jz fif +.fiv: ; Family=5 + cmp [m],$0 + jz .A50 + cmp [m],$1 + jz .A51 + cmp [m],$2 + jz .A52 + cmp [m],$3 + jz .A53 + cmp [m],$6 + jz .A56 + cmp [m],$7 + jz .A57 + cmp [m],$8 + jz .A58 + cmp [m],$9 + jz .A59 + cmp [m],$D + jz .A5D +.A50: + mov [micron], 50 ; 0.35? +Text 105,90,0x00000000,A50, A50len-A50 + jmp MMXtest +.A51: + mov [micron], 35 +Text 105,90,0x00000000,A51, A51len-A51 + jmp MMXtest +.A52: + mov [micron], 35 +Text 105,90,0x00000000,A52, A52len-A52 + jmp MMXtest +.A53: + mov [micron], 35 +Text 105,90,0x00000000,A53, A53len-A53 + jmp MMXtest +.A56: + mov [micron], 30 +Text 105,90,0x00000000,A56, A56len-A56 + jmp MMXtest +.A57: + mov [micron], 25 +Text 105,90,0x00000000,A57, A57len-A57 + jmp MMXtest +.A58: + mov [micron], 25 +Text 105,90,0x00000000,A58, A58len-A58 + jmp MMXtest +.A59: + mov [micron], 25 +Text 105,90,0x00000000,A59, A59len-A59 + jmp MMXtest +.A5D: + mov [micron], 18 +Text 105,90,0x00000000,A5D, A5Dlen-A5D + jmp MMXtest +.si: ; Family=6 + + cmp [m],$1 + jz A1 + cmp [m],$2 + jz A2 + cmp [m],$3 + jz A3 + cmp [m],$4 + jz A4 + cmp [m],$6 + jz A6 + cmp [m],$7 + jz A7 + cmp [m],$8 + jz A8 + cmp [m],$A + jz AA +A1: + mov [micron], 25 +Text 105,90,0x00000000,At1, At1len-At1 + jmp MMXtest +A2: + mov [micron], 18 +Text 105,90,0x00000000,At2, At2len-At2 + jmp MMXtest +A3: + mov [micron], 18 + Text 105,90,0x00000000,At3, At3len-At3 + jmp MMXtest +A4: + mov [micron], 18 +Text 105,90,0x00000000,At4, At4len-At4 + jmp MMXtest +A6: + + mov [micron], 18 + Text 105,90,0x00000000,At6, At6len-At6 + + mov [FRS], 266 ;!!!!!! + +Number 320,110,0,3,dword [FRS],0x000000; MHz + + call newrating; !!!! + +Text 250,90,0x00000000,pr, prlen-pr + + Number 315,90,0,4,dword [rating],0x000000 + jmp MMXtest +A7: + mov [micron], 13 +Text 105,90,0x00000000,At7, At7len-At7 + jmp MMXtest + +A8: + + mov [micron], 13 +mov [FRS], 266 ;!!!!!! + + Number 320,110,0,3,dword [FRS],0x000000; MHz + + + cmp [L2], 256 + jl .App ; Applebred +Text 105,90,0x00000000,At8, At8len-At8 + + +call newrating;!!!! + +Text 250,90,0x00000000,pr, prlen-pr +Number 315,90,0,4,dword [rating],0x000000 +jmp MMXtest + + .App: +Text 105,90,0x00000000,At8a, At8alen-At8a +jmp MMXtest + +AA: + + mov [micron], 13 + +mov [FRS], 333; !!!! +Text 250,90,0x00000000,pr, prlen-pr + + Number 320,110,0,3,dword [FRS],0x000000; MHz + + cmp [L2], 256 + jl .Tho ; Thorton + +call newrating;!!!!! +Text 105,90,0x00000000,Ata, Atalen-Ata + + Number 315,90,0,4,dword [rating],0x000000 + +jmp MMXtest + .Tho: +call newrating;!!!!! +Text 105,90,0x00000000,Atat, Atatlen-Atat + Number 315,90,0,4,dword [rating],0x000000 + jmp MMXtest +fif: ; AMD-64 Family=15 + +;here is a need to rewrite detection of AMD F-th family according to "Revision Guide for +;AMD AthlonTM 64 and AMD OpteronTM Processors" 25759.pdf + +; checking sse3 for new AMD's is needed + cmp [m],$1 ; Dual-core Opteron + jz .AF1 + cmp [m],$3 ; Toledo 1024 0.09 // Manchester + jz .AF3 + cmp [m],$4 ;Athlon 64 Mobile Athlon 64 FX ClawHammer (1024) 0.13 + jz .AF4 + cmp [m],$5 ; Opteron Athlon 64 FX 0.13 (1024) + jz .AF5 + cmp [m],$7 ;Athlon 64 Athlon 64 FX Clawhammer(1024) 0.13 Sledgehammer(1024) 0.13 // SSE3+ SanDiego(1024) (Ї- Ў  Ўь-ї-¬Ў) + jz .AF7 + cmp [m],$8 ; Athlon 64 Mobile Athlon 64 FX ClawHammer (1024) 0.13 + jz .AF8 + cmp [m],$B ; Athlon 64 + jz .AFB + cmp [m],$C ;Athlon 64 Newcastle(512) 0.13 Sempron> Paris (256) 0.13 |SSE3+ Sempron > Palermo FC0 0.09 // (Venice) + jz .AFC + cmp [m],$E ; Athlon 64 // + jz .AFE + cmp [m],$F ; Athlon 64 Winchester(512) |SSE3+ SanDiego(1024) Venice (512) Palermo (256) 0.09 + jz .AFF + jmp next_generation +.AF1: + mov [micron], 09 ;? +Text 105,90,0x00000000,AF1, AF1len-AF1 + jmp MMXtest +.AF3: + mov [micron], 09 +Text 105,90,0x00000000,AF3, AF3len-AF3 + jmp MMXtest +.AF4: + mov [micron], 13 +Text 105,90,0x00000000,AF4, AF4len-AF4 + jmp MMXtest +.AF5: + mov [micron], 13 +Text 105,90,0x00000000,AF5, AF5len-AF5 + jmp MMXtest +.AF7: + mov [micron], 13 +Text 105,90,0x00000000,AF5, AF5len-AF5 + jmp MMXtest +.AF8: + mov [micron], 13 +Text 105,90,0x00000000,AF4, AF5len-AF4 + jmp MMXtest +.AFB: + mov [micron], 13 +Text 105,90,0x00000000,AF4, AF4len-AF4 + jmp MMXtest + +.AFC: +cmp [L2], 512 +je .AFCn + +cmp [sse3sup], 1 +je .AFCnpal + +.AFCnpar: ; paris + mov [micron], 13 + Text 105,90,0x00000000,AFCs, AFCslen-AFCs + jmp MMXtest + +.AFCnpal: ; palermo + mov [micron], 9 + Text 105,90,0x00000000,AFCsp, AFCsplen-AFCsp + jmp MMXtest + + +.AFCn: ;newcastle + mov [micron], 13 + Text 105,90,0x00000000,AFC, AFClen-AFC + jmp MMXtest + + .AFE: ; error in cpu + jmp .AFC + +.AFF: + +cmp [sse3sup], 1 +je .AFFsse + +.win: +mov [micron], 9 ; winchester +jmp MMXtest + +.AFFsse: +cmp [L2], 1024 +jz .AFs +cmp [L2], 512 +jz .AFd +cmp [L2], 256 +jz .AFp + +.AFs: +Text 105,90,0x00000000,AFS, AFSlen-AFS + jmp MMXtest + +.AFd: +Text 105,90,0x00000000,AFV, AFVlen-AFV + jmp MMXtest + +.AFp: +Text 105,90,0x00000000,AFCsp, AFCsplen-AFCsp + jmp MMXtest +;----------------------------------------------- +Intel: +Text 80,90,0x00000000,Inteln, Intelnlen-Inteln + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Print the unpacked img to screen + mov esi, intel + call load_gif + mov eax,7 ; sysfunc7: putimage + mov ebx,img_area+8 ; pointer to image + 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: + cmp [f], $5 + jz .five + cmp [f], $6 + jz .six + cmp [f], $7 + jz .sev + cmp [f], $F + jz .fift +.five: ;Family=5 + +Text 20, 210,0x00000000,cache, cachelen-cache + + cmp [m],$0 + jz .I0 + cmp [m],$1 + jz .I1 + cmp [m],$2 + jz .I2 + cmp [m],$3 + jz .I3 + cmp [m],$4 + jz .I4 + cmp [m],$7 + jz .I7 + cmp [m],$8 + jz .I8 +.I0: +Text 115,90,0x00000000,P50, P50len-P50 + mov [L1d], 8 + mov [L1i], 8 + mov [L2], 256 + mov [micron], 80 + jmp MMXtest +.I1: +Text 115,90,0x00000000,P5, P5len-P5 + mov [L1d], 8 + mov [L1i], 8 + mov [L2], 256 + mov [micron], 50 + jmp MMXtest +.I2: +Text 115,90,0x00000000,P54C, P54Clen-P54C + mov [L1d], 8 + mov [L1i], 8 + mov [L2], 256 + mov [micron], 50 + jmp MMXtest +.I3: +Text 115,90,0x00000000,P54T, P54Tlen-P54T + mov [L1d], 8 + mov [L1i], 8 + mov [L2], 256 + mov [micron], 50 + jmp MMXtest +.I4: +Text 115,90,0x00000000,P55C, P55Clen-P55C + mov [L1d], 8 + mov [L1i], 8 + mov [L2], 256 + mov [micron], 35 + jmp MMXtest +.I7: +Text 115,90,0x00000000,P54C, P54Clen-P54C + mov [L1d], 8 + mov [L1i], 8 + mov [L2], 256 + mov [micron], 35 + jmp MMXtest +.I8: +Text 115,90,0x00000000,P55C, P55Clen-P55C + mov [L1d], 16 + mov [L1i], 16 + mov [L2], 256 + mov [micron], 35 + jmp MMXtest +.six: ;Family=6 + +Text 20, 210,0x00000000,cache, cachelen-cache + + cmp [m],$0 + jz .I60 + cmp [m],$1 + jz .I61 + cmp [m],$3 + jz .I63 + cmp [m],$5 + jz .I65 + cmp [m],$6 + jz .I66 + cmp [m],$7 + jz .I67 + cmp [m],$8 + jz .I68 + cmp [m],$9 + jz .I69 + cmp [m],$A + jz .I6A + cmp [m],$B + jz .I6B + cmp [m],$D + jz .I6D + cmp [m],$E + jz .I6E + cmp [m],$F + jz .I6F +.I60: + mov [micron], 50 +Text 115,90,0x00000000,P60, P60len-P60 + jmp MMXtest +.I61: + mov [micron], 35 +Text 115,90,0x00000000,P61, P61len-P61 + jmp MMXtest +.I63: + mov [micron], 28 +Text 115,90,0x00000000,P63, P63len-P63 + jmp MMXtest +.I65: + mov [micron], 25 + cmp [L2], 0 + jne .pp65 ; Pentium +Text 115,90,0x00000000,P65c, P65clen-P65c + jmp MMXtest +.pp65: +Text 115,90,0x00000000,P65, P65len-P65 + jmp MMXtest +.I66: + mov [micron], 25 +Text 115,90,0x00000000,P66, P66len-P66 + jmp MMXtest +.I67: + mov [micron], 25 +Text 115,90,0x00000000,P67, P67len-P67 + jmp MMXtest +.I68: + mov [micron], 18 + cmp [L2], 128 + jne .pp68 ; Pentium +Text 115,90,0x00000000,P68c, P68clen-P68c + jmp MMXtest + .pp68: +Text 115,90,0x00000000,P68, P68len-P68 + jmp MMXtest +.I69: + mov [micron], 13 +Text 115,90,0x00000000,P69 , P69len-P69 + jmp MMXtest +.I6A: + mov [micron], 18 +Text 115,90,0x00000000,P6A, P6Alen-P6A + jmp MMXtest +.I6B: + mov [micron], 13 + cmp [L2], 256 + jne .pp6B ; Pentium +Text 115,90,0x00000000,P6Bc, P6Bclen-P6Bc + jmp MMXtest +.pp6B: +Text 115,90,0x00000000,P6B, P6Blen-P6B + jmp MMXtest +.I6D: + mov [micron], 9 +Text 115,90,0x00000000,P6D, P6Dlen-P6D + jmp MMXtest +.I6E: + mov [micron], 6 +Text 115,90,0x00000000,P6E, P6Elen-P6E + jmp MMXtest +.I6F: + mov [micron], 6 +Text 115,90,0x00000000,P6F, P6Flen-P6F + jmp MMXtest + +;06Ex - Pentium M Yonah 0.065 +;06Fx - Pentium D Conroe 0.065, Xeon Woodcrest, Celeron D AllenDale + +.sev: ;Family=7 +.IS0: + +Text 20, 210,0x00000000,cache, cachelen-cache ;? + + mov [micron], 18 +Text 115,90,0x00000000,PS0, PS0len-PS0 + jmp MMXtest + +.fift: ;Family=15 + +Text 20, 210,0x00000000,cacheP4, cacheP4len-cacheP4 + + cmp [m],$0 + jz .IF0 + cmp [m],$1 + jz .IF1 + cmp [m],$2 + jz .IF2 + cmp [m],$3 + jz .IF3 + cmp [m],$4 + jz .IF3 ;identical to F3xh + cmp [m],$5 + jz .IF5 + cmp [m],$6 + jz .IF6 + jmp next_generation +.IF0: + mov [micron], 18 + cmp [L2], 128 + jne .ppF0 ; Pentium +Text 115,90,0x00000000,PF0c, PF0clen-PF0c + jmp MMXtest +.ppF0: +Text 115,90,0x00000000,PF0, PF0len-PF0 + jmp MMXtest +.IF1: + mov [micron], 18 + cmp [L2], 128 + je .IF0;jne.ppF1 ; Pentium + ; mov eax,dword 0x00000004 + ; mov ebx,115*65536+80 + ; mov ecx,dword 0x00000000 + ; mov edx,PF0c + ; mov esi,PF0clen-PF0c + ; int 0x40 + ;jmp MMXtest +;.ppF1: +Text 115,90,0x00000000,PF0, PF0len-PF0 + jmp MMXtest +.IF2: + mov [micron], 13 + cmp [L2], 128 + jne .ppF2 ; Pentium +Text 115,90,0x00000000,PF2c, PF2clen-PF2c + jmp MMXtest +.ppF2: +Text 115,90,0x00000000,PF2, PF2len-PF2 + jmp MMXtest +.IF3: + mov [micron], 09 + cmp [L2], 256 + jne .ppF3 ; Pentium +Text 115,90,0x00000000,PF3c, PF3clen-PF3c + jmp MMXtest +.ppF3: +Text 115,90,0x00000000,PF3, PF3len-PF3 + jmp MMXtest + +.IF5: + mov [micron], 09 + cmp [L2], 512 + jae .ppF5 ; Pentium +Text 115,90,0x00000000,PF5c, PF5clen-PF5c + jmp MMXtest +.ppF5: +Text 115,90,0x00000000,PF5, PF5len-PF5 + jmp MMXtest + + .IF6: + mov [micron], 06 ; 065 + cmp [L2], 512 + ja .ppF6 ; Pentium +Text 115,90,0x00000000,PF6c, PF6clen-PF6c + jmp MMXtest +.ppF6: +Text 115,90,0x00000000,PF6, PF6len-PF6 + jmp MMXtest + + + next_generation: +Text 115,90,0x00000000,NG, NGlen-NG + jmp MMXtest +;---------------------------------- +Cyrix: + +Text 20, 210,0x00000000,cache, cachelen-cache + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Print the unpacked img to screen + mov esi, cyrix + call load_gif + mov eax,7 ; sysfunc7: putimage + mov ebx,img_area+8 ; pointer to image + 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 + jz .fivv + cmp [f], $6 + jz .sixx +.fivv: ;Family=5 + cmp [m],$2 + jz .C52 + cmp [m],$4 + jz .C54 +.C52: + mov [micron], 50 ;35? + mov [L1i], 8 + mov [L1d], 8 + mov [L2], 512 +Text 80,90,0x00000000,Cyrixn, Cyrixnlen-Cyrixn +Text 115,90,0x00000000,C52, C52len-C52 + jmp MMXtest +.C54: + mov [micron], 50 + mov [L1i], 8 + mov [L1d], 8 + mov [L2], 512 +Text 80,90,0x00000000,Cyrixn, Cyrixnlen-Cyrixn +Text 115,90,0x00000000,C54, C54len-C54 + jmp MMXtest + +.sixx: ;Family=6 + cmp [m],$0 + jz .C60 + cmp [m],$5 + jz .C65 +.C60: + mov [micron], 25 + mov [L1i], 32 + mov [L1d], 32 + mov [L2], 512 +Text 80,90,0x00000000,Cyrixn, Cyrixnlen-Cyrixn +Text 115,90,0x00000000,C60, C60len-C60 + jmp MMXtest +.C65: + mov [micron], 25 ;35? + mov [L1i], 32 + mov [L1d], 32 + mov [L2], 512 +Text 80,90,0x00000000,Centaurn, Centaurnlen-Centaurn +Text 105,90,0x00000000,C65, C65len-C65 + jmp MMXtest +;--------------------- +Centaur: + +Text 20, 210,0x00000000,cache, cachelen-cache + +;CACHE1: +mov eax, 80000005h + cpuid +shr ecx, 24 +mov [L1d], ecx +shr edx, 24 +mov [L1i], edx +;CACHE2: +mov eax, 80000006h + cpuid +shr ecx, 24 +mov [L2],ecx + + cmp [f], $5 + jz fivC + cmp [f], $6 + jz sixC + +fivC: ;Family=5 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Print the unpacked img to screen + mov esi, idt + call load_gif + mov eax,7 ; sysfunc7: putimage + mov ebx,img_area+8 ; pointer to image + 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 + cmp [m],$4 + jz .V54 + cmp [m],$8 + jz .V58 + cmp [m],$9 + jz .V59 +.V54: + mov [micron], 35 +Text 105,90,0x00000000,V54, V54len-V54 + jmp MMXtest +.V58: + mov [micron], 25 +Text 105,90,0x00000000,V58, V58len-V58 + jmp MMXtest +.V59: + mov [micron], 25 +Text 105,90,0x00000000,V59, V59len-V59 + jmp MMXtest + +sixC: ;Family=6 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Print the unpacked img to screen + mov esi, via + call load_gif + mov eax,7 ; sysfunc7: putimage + mov ebx,img_area+8 ; pointer to image + 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 + cmp [m],$6 + jz .V66 + cmp [m],$7 + jz .V67 + cmp [m],$8 + jz .V68 + cmp [m],$9 + jz .V69 + cmp [m],$A + jz .V6A +.V66: + mov [micron], 18 ; 25? +Text 105,90,0x00000000,V66, V66len-V66 + jmp MMXtest +.V67: + mov [micron], 15 +Text 105,90,0x00000000,V67, V67len-V67 + jmp MMXtest +.V68: + mov [micron], 13 +Text 105,90,0x00000000,V68, V68len-V68 + jmp MMXtest +.V69: + mov [micron], 13 +Text 105,90,0x00000000,V69, V69len-V69 + jmp MMXtest +.V6A: + mov [micron], 9 +Text 105,90,0x00000000,VA, VAlen-VA + jmp MMXtest +;----------- +Transmeta: + +Text 20, 210,0x00000000,cache, cachelen-cache + +Text 80,90,0x00000000,Tranmsmetan, Tranmsmetanlen-Tranmsmetan + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Print the unpacked img to screen + mov esi, transmeta + call load_gif + mov eax,7 ; sysfunc7: putimage + mov ebx,img_area+8 ; pointer to image + 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 +;CACHE1: +mov eax, 80000005h + cpuid +shr ecx, 24 +mov [L1d], ecx +shr edx, 24 +mov [L1i], edx +;CACHE2: +mov eax, 80000006h + cpuid +shr ecx, 16 + +mov [L2],ecx + cmp [f], $5 + jz .fivt + cmp [f], $F + jz .fift +.fivt: ; Family=5 + + mov [micron], 13 ; ? +Text 145,90,0x00000000,T5, T5len-T5 + jmp MMXtest + +.fift: ; Family=F + mov [micron], 13 ; +Text 145,90,0x00000000,TF, TFlen-TF + jmp MMXtest + +;---- +MMXtest: ; MMX test and Brand ID decoding + +call decodebrand ; get Brand ID + +call decode_standard_features + +call decode_extended_features + xor eax,eax + inc eax + cpuid +HTTtest: + test edx, $10000000; ;Test bit 28 + jnz .EL ;HTT technology is supported + jz .ELN + +.EL: + and ebx,00FF0000h ; numbers of logical processors + shr ebx,16 ; shift it to the correct position + cmp ebx, 1 + je .ELN ; HHT not enabled (Celeron) + + + mov dword [HTTn+9], $736579 + mov dword [HTT+ 6], $736579 + jmp TEXTOUT +.ELN: + + mov dword [HTTn+ 9], $6F6E + mov dword [HTT+ 6], $6F6E + jmp TEXTOUT + +TEXTOUT: + +Text 20,130,0x00000000,fam, famlen-fam +Text 20,150,0x00000000,mode, modelen-mode +Text 20,170,0x00000000,step, steplen-step +;--------L1 L2 +Number 80,190,0,3,dword [L1d],0x000000; +Number 80,210,0,3,dword [L1i],0x000000; +Number 178,190,0,4,dword[L2],0x000000; +Number 172,210,0,5,dword[L3],0x000000; +;-----------Features +Number 263,70,0,2,dword [micron],0x000000 ; micron + +Text 280,250,0x00000000,HTT, HTTlen-HTT +Text 280,270,0x00000000,sse3, sse3len-sse3 + +Text 20,90,0x00000000,name, namelen-name + +Text 20,250,0x00000000,MMXs, MMXslen-MMXs +Text 20,270,0x00000000,SSE, SSElen-SSE +Text 100,270,0x00000000,SSE2, SSE2len-SSE2 + + jmp TEST3DNOW +;------------------- +TEST3DNOW: + + cmp [smallvendor], 'ntel' + je .NOEXTENDED + jne .t + +.t: + + mov eax, $80000001 ;// Setup extended function 8000_0001h + cpuid + + test edx, $80000000 ;// Test bit 31 + jnz .XIT + +.NOEXTENDED: ;// 3DNow! technology is supported + mov dword [now+ 9], $6F6E + jmp TEST3DNOWP +.XIT: + mov dword [now+ 9], $736579 + jmp TEST3DNOWP + +TEST3DNOWP: + + cmp [smallvendor], 'ntel' + je .NOEXTENDEDP + +.tp: + + mov eax, $80000001 ;// Setup extended function 8000_0001h + cpuid + + test edx, $40000000 ;// Test bit 30 + jnz .XITP ;// 3DNow! technology is supported + +.NOEXTENDEDP: + mov dword [nowp+ 9], $6F6E + jmp TESTMMXP +.XITP: + mov dword [nowp+ 9], $736579 + jmp TESTMMXP + +TESTMMXP: + + mov eax,$80000000 + cpuid + + test eax, 80000000h +jna NOEXTENDEDM + + ;cmp eax, $80000000 ;// Is 800_0001h supported? + ;jz .NOEXTENDEDM ;// If not, 3DNow! technology is not supported + mov eax, $80000001 ;// Setup extended function 8000_0001h + cpuid + cmp [smallvendor], 'tead' + jne noCyr +Cyrmx: + test edx, $01000000 ;// Test bit 24 + jnz XITM ;// 3DNow! technology is supported + jz NOEXTENDEDM +noCyr: + test edx, $00400000 ;// Test bit 22 + jnz XITM ;// 3DNow! technology is supported + ;jz .NOEXTENDEDM + +NOEXTENDEDM: + mov dword [mmxp+ 7], $6F6E + mov dword [MMXPi+ 8], $6F6E + jmp text3d +XITM: + mov dword [mmxp+ 7], $736579 + mov dword [MMXPi+ 8], $736579 + jmp text3d + +text3d: + +Text 180,250,0x00000000,now, nowlen-now +Text 180,270,0x00000000,nowp, nowplen-nowp +Text 100,250,0x00000000,mmxp, mmxplen-mmxp + +jmp still + +;-------------------------- +NO_CPUID: + Text 20,70,0x00000000,oblom, oblomlen-oblom + jmp FREEZE + +FREEZE: +nop +jmp FREEZE +;---------------- +still: + mov eax,10 + int 0x40 ; + cmp eax,1 ; + je red ; red + cmp eax,2 ; + je key ; key + cmp eax,3 ; + je button ; button + jmp still ; + key: ; + mov eax,2 ;   + int 0x40 ; + jmp still ; + button: ; + mov eax,17 ; + int 0x40 ; + cmp ah,1 ; = 1 ? + je close ; close + + cmp ah,2 ; = 2 ? + je thread_start ; + ; + cmp ah,3 ; = 3 ? + je vybor ; vybor + + jne noclose + +vybor: + + Number 315,90,0,4,dword [rating],0xFFFFFF ; + + Number 320,110,0,3,dword [FRS],0xFFFFFF; MHz + +cmp [FRS], 266 +jz .s1 +cmp [FRS], 333 +jz .s2 +cmp [FRS], 400 +jz .s3 + +.s1: +mov [FRS], 333 +call newrating + Number 315,90,0,4,dword [rating],0x000000 + + Number 320,110,0,3,dword [FRS],0x000000; MHz +jmp still + +.s2: +mov [FRS], 400 + +call newrating + + Number 315,90,0,4,dword [rating],0x000000 + + Number 320,110,0,3,dword [FRS],0x000000; MHz +jmp still + +.s3: +mov [FRS], 266 +call newrating + + Number 315,90,0,4,dword [rating],0x000000 + + Number 320,110,0,3,dword [FRS],0x000000; MHz + +jmp still + +noclose: + jmp still + +close: + mov eax,-1 + int 0x40 + +;**************************** THREAD-SECOND WINDOW +thread_start: + + cmp [num_win2],0 + + jne still + +;================================================RSA test + call init_test ; start RSA code + call module_test + jmp somewhere + + module_test: +;test rsa coding speed +;length of module - 256 bit + mov eax,26 + mov ebx,9 + int 0x40 + add eax,100 ;test lasts 1 second. + push eax +.loop: + mov ecx,4 ;do 4 iterations + push ecx ;this reduces number of calls int 0x40. +.loop1: + call rsa_test ;this procedure change all registers + dec dword [esp] + jnz .loop1 + pop ecx + mov eax,26 + mov ebx,9 + int 0x40 + cmp eax,dword [esp] ;Is time changed? + jl .loop + pop eax + shr dword [iter],4 ;[iter] - speed in Kb/sec. (every iteration codes 64 bytes) + ret + + somewhere: +;====================================================================== + mov eax,51 ; + mov ebx,1 + mov ecx,window_2 + mov edx,thread2_esp + int 0x40 + + jmp still + +window_2: + mov [num_win2],1 + call draw_window_2 + +still_2: + + mov eax,10 + int 0x40 + + cmp eax,1 + je window_2 ; window_2 + cmp eax,2 ; + je key_2 ; key_2 + cmp eax,3 ; + je button_2 ; button_2 + + jmp still_2 ; + + key_2: ; + mov eax,2 ;   2 + int 0x40 ; + jmp still_2 ; + + button_2: ; + mov eax,17 ; 17 + int 0x40 ; + + cmp ah,1 ; = 1 ? + jne noclose_2 ; noclose + + mov [num_win2],0 ; + + or eax,-1 ; + int 0x40 + + noclose_2: + + jmp still_2 ; + +draw_window_2: + mov eax,12 ; function 12:tell os about windowdraw + 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 + +Text 8, 8,0x20ddeeff, standard, standardlen-standard + +Text 20, 30,0x00000000, STDCA, STDCAlen-STDCA +Text 220, 30,0x00000000, EXTCA, EXTCAlen-EXTCA + +Number 140,30,1*256,8,dword [stdc],0x000000 +Number 340,30,1*256,8,dword [extc],0x000000 + +Text 20, 50,0x00000000, FPU, FPUlen-FPU +Text 120, 50,0x00000000, VME, VMElen-VME +Text 220, 50,0x00000000, DE, DElen-DE +Text 320, 50,0x00000000, PSE, PSElen-PSE + +Text 20, 70,0x00000000,TSC, TSClen-TSC +Text 120, 70,0x00000000,MSR, MSRlen-MSR +Text 220,70,0x00000000,PAE, PAElen-PAE +Text 320,70,0x00000000,MCE, MCElen-MCE + +Text 20,90,0x00000000,CX8, CX8len-CX8 +Text 120,90,0x00000000,APIC, APIClen-APIC +Text 220,90,0x00000000,Res, Reslen-Res +Text 320,90,0x00000000,SEP, SEPlen-SEP + +Text 20,110,0x00000000,MTRR, MTRRlen-MTRR +Text 120,110,0x00000000,PGE, PGElen-PGE +Text 220,110,0x00000000,MCA, MCAlen-MCA +Text 320,110,0x00000000,CMOV, CMOVlen-CMOV + +Text 20,130,0x00000000,PAT, PATlen-PAT +Text 120,130,0x00000000,PSE36, PSE36len-PSE36 +Text 220,130,0x00000000,PSNUM, PSNUMlen-PSNUM +Text 320,130,0x00000000,CLFLUSHn, CLFLUSHnlen-CLFLUSHn + +Text 20,150,0x00000000,Res, Reslen-Res +Text 120,150,0x00000000,DTS, DTSlen-DTS +Text 220,150,0x00000000,ACPI, ACPIlen-ACPI +Text 320,150,0x00000000,MMX, MMXlen-MMX + +Text 20,170,0x00000000,FXSR, FXSRlen-FXSR +Text 120,170,0x00000000,SSE, SSElen-SSE +Text 220,170,0x00000000,SSE2, SSE2len-SSE2 +Text 320,170,0x00000000,SSn, SSnlen-SSn + +Text 20,190,0x00000000,HTT, HTTnlen-HTTn +Text 120,190,0x00000000,TM, TMlen-TM +Text 220,190,0x00000000,IA64, IA64len-IA64 +Text 320,190,0x00000000,PBE, PBElen-PBE +;--------------- +DrawLine 5, 405, 205,205,0x8080FF ;10 + +mov eax,$80000000 +cpuid +;mov eax, $03020101  for test of reaction +test eax, 80000000h +jnz goooddd + +baaadd: +Text 100,255,0x00000000,NEF, NEFlen-NEF +jmp too + +goooddd: +Text 20,215,0x00000000,SS3, SS3len-SS3 +Text 20,235,0x00000000,MON, MONlen-MON +Text 20,255,0x00000000,DS_CPL, DS_CPLlen-DS_CPL +Text 20,275,0x00000000,EST, ESTlen-EST +Text 20,295,0x00000000,TM2, TM2len-TM2 + +Text 120,215,0x00000000,CNXT_ID, CNXT_IDlen-CNXT_ID +Text 120,235,0x00000000,CX16, CX16len-CX16 +Text 120,255,0x00000000,ETPRD, ETPRDlen-ETPRD +Text 120,275,0x00000000,SYS, SYSlen-SYS +Text 120,295,0x00000000,LAF, LAFlen-LAF + +Text 220,215,0x00000000,MP, MPlen-MP +Text 220,235,0x00000000,NX, NXlen-NX +Text 220,255,0x00000000,MMXPi, MMXPilen-MMXPi +Text 220,275,0x00000000,MMXn, MMXnlen-MMXn +Text 220,295,0x00000000,FXSRn, FXSRnlen-FXSRn + +Text 320,215,0x00000000,FFXSR, FFXSRlen-FFXSR +Text 320,235,0x00000000,TSCP, TSCPlen-TSCP +Text 320,255,0x00000000,LM, LMlen-LM +Text 320,275,0x00000000,DNo, DNolen-DNo +Text 320,295,0x00000000,DN, DNlen-DN +too: +DrawLine 5, 405, 315,315,0x8080FF ;10 + +Text 20,330,0x00000000,speed, speedlen-speed +Text 135,330,0x00000000,kbpersec, kbperseclen-kbpersec + +Number 100,330,0,5,dword [iter],0x000000; RSA test results + + mov eax,12 + mov ebx,2h + int 0x40 + + ret + +num_win2 db 0 + +; ******* main window ******* + +draw_window: + mov eax,12 + mov ebx,1h + int 0x40 + + mov eax,0 ;  0 + mov ebx,150*65536+351 ; [x ] *65536 + [x ] + 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 + 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 edi, img_area2 + call load_gif2 + mov eax,7 ; sysfunc7: putimage + mov ebx,img_area2+8 ; pointer to image + 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 + + mov eax,12 + mov ebx,2h + int 0x40 + + Text 135,230,0x00000000,instruct, instructlen-instruct + + DrawLine 15, 335, 285,285,0x8080FF + DrawLine 335, 335, 235,285,0x8080FF + DrawLine 15, 15, 235,285,0x8080FF + DrawLine 15, 130, 235,235,0x8080FF + DrawLine 235, 335, 235,235,0x8080FF + + cmp dword[smallvendor], 'cAMD' + jne cont + cmp [f], $6 + jne cont + cmp [f], $6 + jl cont + + mov eax,8 ; new 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 + + call newrating; !!!! + + cont: +;================_RAM_============== + mov eax, 18 + mov ebx, 16 + int 0x40 + + shr eax, 10 + + mov [ram_size_a], eax + + mov eax, 18 + mov ebx, 17 + int 0x40 + + shr eax, 10 + + mov [ram_size_t], eax + + Text 120,300,0x00000000,ram, ramlen-ram + Number 205,300,0,4,dword [ram_size_a],0x000000 + + Number 275,300,0,4,dword [ram_size_t],0x000000 + Text 305,300,0x00000000,mb, mblen-mb + +;============================== + + Text 20,70,0x00000000,tsum, tsumlen-tsum ; + Text 20,110,0x00000000,cpuname, cpunamelen-cpuname; + Text 230,190,0x00000000,typen, typenlen-typen; + Text 180, 70,0x00000000,tech, techlen-tech; + + Number 87,70,0,4,dword [total],0x000000; MHz + Number 115,70,0,2,dword [sot],0x000000; KHz + Text 20,190,0x00000000,cache2, cache2len-cache2 + Number 80,130,1*256,1,dword [f],0x000000 ; + Number 80,150,1*256,1,dword [m],0x000000; + Number 80,170,1*256,1,dword [s],0x000000; + + Number 115,130,1*256,2,dword [ef],0x000000 ; + Number 115,150,1*256,2,dword [em],0x000000; + +Text 20,50,0x00000000,multil, multillen-multil +Number 90,50,0,2,dword [multb],0x000000; +Number 110,50,0,1,dword [multa],0x000000; + +Text 180,50,0x00000000,freql, freqllen-freql +Number 264,50,0,4,dword [freqbb],0x000000; +Number 294,50,0,2,dword [freqll],0x000000; + + Text 20,30,0x00000000,stm, stmlen-stm +; Fix for deleting leading whitespaces +; in Intel P4's internal name +; by Madis Calme +; 23.12.2004 ver. 0.81 + cld + mov edi,myname + mov al,20h + or ecx,-1 + repe scasb + dec edi + mov esi,mynamelen + sub esi,edi + Text 110, 30, 0x00000000, edi, esi +; Text 110,40,0x00000000,myname, mynamelen-myname +;- +Text 230,210,0x00000000,brandid, brandidlen-brandid + + ret ; + +load_gif: + mov edi, img_area +load_gif2: + gif2img esi,edi + ret + +; DATA AREA + +zag: + db 'CPUID 2.05 by Sergey Kuzmin and the KolibriOS team' +zaglen: +tsum: + db 'Frequency: . MHz' +tsumlen: +ost dd ? +sot dd ? +f dd ? +m dd ? +s dd ? +t dd ? + +ef dd ? +em dd ? + +multiplier dd ? +multa dd ? +multb dd ? + +smallvendor dd ? +L1d dd ? +L1i dd ? +L2 dd ? +L3 dd ? +total dd 0x0 +total1 dd 0x0 +rating dd 0x0 +rat dd 0x0 ; +micron dd ? +sse3sup dd ? +brand dd ? + +ram_size_a dd ? +ram_size_t dd ? + +ram: +db 'Available RAM: out of' +ramlen: + +NEF: +db 'EXTENDED FEATURES ARE NOT AVAILABLE' +NEFlen: + +mb : +db 'MB' +mblen: + +speed : +db 'PERFORMANCE:' +speedlen: + +kbpersec: +db 'KB/SEC' +kbperseclen: + +instruct: + db 'Instruction sets' +instructlen: + +standard: + db 'Standard and Extended features plus Performance test' +standardlen: + +FR: + db 'Choose FSB:' +FRlen: + +STDCA: + db 'Highest STD call is ' +STDCAlen: + +EXTCA: + db 'Highest EXT call is h' +EXTCAlen: + +brandid: + db 'Brand:' +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: + db 'SORRY, CPUID IS NOT AVAILABLE' +oblomlen: +other: + db 'SORRY, THIS VENDOR IS NOT SUPPORTED YET' +otherlen: +cpuname: + db 'CPU VENDOR: ' +cpunamelen: +fam: + db 'FAMILY: std ext' +famlen: +mode: + db 'MODEL: std ext' +modelen: +step: + db 'STEPPING:' +steplen: +cache2: + + db 'L1(data): KB L2: KB' +cache2len: + +cache: + db 'L1(inst): KB L3: KB' +cachelen: + +cacheP4: + + db 'L1(inst): Kuops L3: KB' +cacheP4len: + +tech: + db 'Technology: 0. micron ' +techlen: + +typen: + db 'Type:' +typenlen: + +pr: + db 'P-rating:' +prlen: + +multil: + db 'Multiplier: .' +multillen: + +freql: + db 'System clock: . MHz' +freqllen: + +name: + db 'CODENAME:' +namelen: +AMDn: + db 'AMD' +AMDnlen: +Inteln: + db 'Intel' +Intelnlen: +Cyrixn: + db 'Cyrix' +Cyrixnlen: +IDTn: + db 'IDT/Centaur' +IDTnlen: +Centaurn: + db 'VIA' +Centaurnlen: + +Tranmsmetan: + db 'Transmeta' +Tranmsmetanlen: + +MMXs: + db 'MMX: ' +MMXslen: + +mmxp: + db 'MMX+: ' +mmxplen: + +HTT: + db 'HTT: ' +HTTlen: + +HTTn: + db 'HTT: ' +HTTnlen: + +sse3: + db 'SSE3: ' +sse3len: +now: + db '3DNOW!: ' +nowlen: +nowp: + db '3DNOW!+: ' +nowplen: + +;-Type + +t1: + db 'OEM' +t1len: + +t2: + db 'Overdrive' +t2len: + +t3: + db 'Dual' +t3len: + +t4: + db 'Unknown' +t4len: + +;----------Intel +P50: +db 'P5 A-step' +P50len: +P5: +db 'P5' +P5len: +P54T: +db 'P24T Overdrive' +P54Tlen: +P54C: +db 'P54C' +P54Clen: +P55C: +db 'P55C (with MMX)' +P55Clen: +; --- +P60: +db 'Pentium Pro A-step' +P60len: +P61: +db 'Pentium Pro' +P61len: +P63: +db 'Pentium II (Klamath)' +P63len: +P65: +db 'Pentium II (Deschutes)' +P65len: +P66: +db 'Celeron (Medocino)' +P66len: +P67: +db 'Pentium III (Katmai)' +P67len: +P68: +db 'Pentium III (Coppermine)' +P68len: +P69: +db 'Pentium M (Banias)' +P69len: +P6A: +db 'Pentium III Xeon (Cascades)' +P6Alen: +P6B: +db 'Pentium III (Tualatin)' +P6Blen: +P6D: +db 'Pentium M (Dothan)' +P6Dlen: +P6E: +db 'Pentium M (Yonah)' +P6Elen: +P6F: +db 'Pentium D (Conroe)' +P6Flen: +;--- +PS0: +db 'Itanium (IA-64)' +PS0len: +;------------ +PF0: +db 'Pentium 4 (Willamete)' +PF0len: +PF2: +db 'Pentium 4 (Northwood)' +PF2len: +PF3: +db 'Pentium 4 (Prescott)' +PF3len: +PF5: +db 'Pentium 4 (Tejas)' +PF5len: +PF6: +db 'Pentium 4 (Presler)' +PF6len: +;----------------Intel Celerons +P65c: +db 'Celeron (Covington)' +P65clen: +P68c: +db 'Celeron (Coppermine)' +P68clen: +P6Bc: +db 'Celeron (Tualatin)' +P6Bclen: +PF0c: +db 'Celeron (Willamete)' +PF0clen: +PF2c: +db 'Celeron (Northwood)' +PF2clen: +PF3c: +db 'Celeron (Prescott)' +PF3clen: +PF5c: +db 'Celeron D (Texas)' +PF5clen: +PF6c: +db 'Celeron D (Presler)' +PF6clen: +;---------AMD +A50: +db 'K5 (PR75, PR90, PR100)' +A50len: +A51: +db '5k86 (PR120, PR133)' +A51len: +A52: +db '5k86 (PR166)' +A52len: +A53: +db '5k86 (PR200)' +A53len: +A56: +db 'K6' +A56len: +A57: +db 'K6' +A57len: +A58: +db 'K6-2' +A58len: +A59: +db 'K6-III' +A59len: +A5D: +db 'K6-2+ or K6-III+' +A5Dlen: +;------------------- +At1: +db 'Athlon' +At1len: +At2: +db 'Athlon' +At2len: +At3: +db 'Duron (Spitfire)' +At3len: +At4: +db 'Athlon (Thunderbird)' +At4len: +At6: +db 'AthlonXP (Palomino)' +At6len: +At7: +db 'Duron (Morgan)' +At7len: +At8: +db 'AthlonXP (Thoroughbred)' +At8len: +At8a: +db 'Duron (Applebred)' +At8alen: +Ata: +db 'AthlonXP (Barton)' +Atalen: +Atat: +db 'AthlonXP (Thorton)' +Atatlen: +;------------------- +AF1: +db 'Dual-core Opteron' +AF1len: +AF3: +db 'Athlon 64 (Toledo)' +AF3len: +AF4: +db 'Athlon 64 (ClawHammer)' +AF4len: +AF5: +db 'Opteron/Athlon 64 FX (SledgeHammer)' +AF5len: + +AFC: +db 'Athlon 64 (Newcastle)' +AFClen: + +AFF: +db 'Athlon 64 (Winchester)' +AFFlen: + +AFS: +db 'Athlon 64 (San Diego)' +AFSlen: + +AFV: +db 'Athlon 64 (Venice)' +AFVlen: + +AFCs: +db 'Sempron (Paris)' +AFCslen: + +AFCsp: +db 'Sempron (Palermo)' +AFCsplen: + +;---------Cyrix +C52: +db '6x86 M1' +C52len: +C54: +db 'MediaGX' +C54len: +C60: +db '6x86MX M2' +C60len: +C65: +db 'C3 (Cyrix M2)' ;? +C65len: +;--------IDT +V54: +db 'WinChip C6' +V54len: +V58: +db 'WinChip 2' +V58len: +V59: +db 'WinChip 3' +V59len: +;-------VIA +V66: +db 'C3 (Samuel)' ; Joshua is unreleased 065 +V66len: +V67: +db 'C3 (Samuel2/Ezra)' ; ? +V67len: +V68: +db 'C3 (Ezra-T/Eden)' ;? +V68len: +V69: +db 'C3 (Antaur/Nehemiah)' ;? +V69len: +VA: +db 'C7 (Esther)' ;? +VAlen: +;---------Transmeta +T5: +db 'Crusoe' ; +T5len: +TF: +db 'Efficeon' ; +TFlen: +;--------- +NG: + db 'Next generation CPU' +NGlen: + +stm: + db 'Internal name:' +stmlen: + +athloncoef db 110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105 +athloncoef2 db 120, 190, 120, 200, 130, 135, 140, 210, 150, 220, 160, 165, 170, 180, 230, 240 +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 +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 + +myname: + db ' ' +mynamelen: + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; include images and unpacking- and hasharea +; +include 'logos.inc' ; include file where gif's are stored +img_area: ; image is going to be unpacked to here +rb 201*49*3+8 ; image resolution (bits to reserve) + +img_area2: ; image is going to be unpacked to here +rb 93*24*3+8 ; image resolution (bits to reserve) + +gif_hash_area: +rd 4096+1 ;hash area size for unpacking gif +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +I_END: +align 4 + udata + thread2_stack_area rb 64 + thread2_esp = $ +U_END: diff --git a/programs/system/cpuid/trunk/HISTORY.TXT b/programs/system/cpuid/trunk/HISTORY.TXT new file mode 100644 index 0000000000..c261e9dbab --- /dev/null +++ b/programs/system/cpuid/trunk/HISTORY.TXT @@ -0,0 +1,185 @@ +;****************************************************************************** +; project name: CPUID +; 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; +; CPUID (versions before 2.00) works in MS Windows by means of emulators +; compiler: flat assembler 1.67.5 +; version: 2.05 +; last update: 1st November 2006 +; maintained by: Sergey Kuzmin aka Wildwest +; e-mail: kuzmin_serg@list.ru +; site: http://coolthemes.narod.ru/files.html +;****************************************************************************** +; Summary: +; supported vendors - Intel, AMD, VIA, Cyrix, IDT (Centaur),Transmeta +; displayed features - CPU frequency; +; Internal Name; +; Multiplier and System Clock frequency; +; Standard and Extended Features; +; CPU signature (family, model,stepping); +; Codename; +; L1, L2 and L3 Caches; +; Technology; +; CPU Vendor; +; Type and Brand ID; +; Logo for Vendors; +; calculation of PR-rating for AMD AthlonXP; +; Amout of RAM (available and total) +; Highest input values for standard and extended calls +; performed tests - Performance test (RSA encoding) +;****************************************************************************** +;HISTORY: +;2.1: CPUID 01/11/2006 (not finished) +;Author: Sergey Kuzmin aka Wildwest +;Features: +; (+) 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 +; (+) fixed Celeron detection based on L2 cache size for newest Intel CPU (there are Celeron models with 512 Kb); +; (+) CPUID now display System Clock with accuracy 0.01 MHz; +; (+) new logo for Intel (they changed it some time ago); +;Known issues: Sempron marked as AthlonXP +; second window doesn't closed when you close main window +;----------------------------------------------------------------------------- +;2.0: CPUID 31/10/2006 +;Author: Sergey Kuzmin aka Wildwest +; Eugeniy Grechnikov aka Diamond +; Iliya Mikhailov aka Ghost +;Features: +; (+) detection of Brand ID of AMD CPU's (Opteron etc - not finished) +; (+) detection of Extended family and Model of AMD CPU's +; (+) interface+(redesign) +; (+) calculation of System Clock +; (++) added multiplier detection for AMD and Intel (thanks a lot to Ghost) +; (+) optimization of GIF decoder, code cleanup and bugfix by Diamond; +; (+) fixed bug with MMX+ detection for Cyrix CPU (in second window; +; it was properly recognized in main window); +; (+) we show appropiate message in second window if Extended Features +; ($8000_000x) aren't available; +; (+) we mark unknown CPU models as "Next generation CPU"; +;Known issues: Sempron marked as AthlonXP +; second window doesn't closed when you close main window +;----------------------------------------------------------------------------- +;1.1: CPUID 17/03/2006 +;Author: Sergey Kuzmin aka Wildwest +;Features: +; (+) performance test now runs after click at "Press for more" button => we start app without test, i.e. +; immediately, but application can be unstable during multiple switching between windows(need testing) +; (++) added detection of total and available amount of RAM (would work only in KolibriOS) +; (++) added detection of extended family and model (not shown, but if you want...); +; (++) added detection of effective family and model; +; (+) more codenames: Intel Tejas, Presler, Yonah, Conroe; +; (+) more codenames: AMD Toledo; +; (+) interface+(redesign). +;Bugs: probably some non-critical graphical issues +;Known issues: Sempron is not supported (marked as AthlonXP) +;----------------------------------------------------------------------------- +;1.0: CPUID 26/09/2005 +;Author: Sergey Kuzmin aka Wildwest +;Additions: Marat Zakiyanov aka Mario79 +; Andrey Halyavin aka halyavin +;Features: +; (+) fixed bug, when processor doesn't support extented features and program don't report 'no' in such case +; (+) fixed bug in CPU Type detection +; (+) fixed bug, when program crashes on AMD AthlonXP when after click on 'Press for more' button +; you click on 'Choose FSB' button; +; (+) added output of highest standard and extended calls +; (+) Extended Features(phase 1 - big part of AMD/Intel specific EF) +; (+) reworked P-rating calculation for AMD AthlonXP -> +; now one program for 266, 333, 400 MHz FSB +; (but unstable - see Bugs section) +; (+) support for Intel F5x, renamed C3(Esther) to C7(Esther) +; (+) more codenames +; (Intel: new Prescott's model; Dothan; VIA: Esther; +; AMD: Newcastle, Paris, Winchester, San Diego, Venice, Palermo) +; (+) performance test (RSA encoding, fixed-point arithmetics) +; by Andrey Halyavin +; (+) interface+(thanks to Mario79 for additional window +; and to me for nice button) +;Bugs: probably some non-critical graphical issues +;Known issues: Sempron is not supported (marked as AthlonXP) +;----------------------------------------------------------------------------- +;0.9: CPUID 24/01/2005 +;Author: Sergey Kuzmin aka Wildwest +;Additions: Madis Kalme aka Madis731 +; Jeffrey Amelynck aka Profkid +;Features: +; (+) deleting leading whitespaces in Intel P4's internal name +; by Madis Kalme +; (+) all standard features +; (+) more codenames (Transmeta series) +; (+) caches for Cyrix +; (+) Brand ID for Intel +; (+) detect L3 cache for Intel +; (+) detect Xeon (will be improved later, at this moment see Brand) +; (+) interface+(redesign and grafical logos for vendors) +; (+) MMX+ test for Cyrix +; (+) Type for Intel +;Bugs: no !!! +;Known issues: Sempron is not supported (marked as AthlonXP) +; caches for IDT is not detected +;----------------------------------------------------------------------------- +;0.8: CPUID 10/12/2004 +;Author: Sergey Kuzmin aka Wildwest +;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 +;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 +;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 +;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 +;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 +;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 +;***************************************************************************** \ No newline at end of file diff --git a/programs/system/cpuid/trunk/MOS_UZEL.INC b/programs/system/cpuid/trunk/MOS_UZEL.INC new file mode 100644 index 0000000000..79ca440145 --- /dev/null +++ b/programs/system/cpuid/trunk/MOS_UZEL.INC @@ -0,0 +1,1666 @@ +;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 +EST_FLAG equ 0080h ; EST-7 +TM2_FLAG equ 0100h ; TM2-8 +CNXT_ID_FLAG equ 0400h ;CID -10 +CX16_FLAG equ 2000h ;CX16 - 13 +ETPRD_FLAG equ 4000h ;xTPR - 14 + +; 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 для Сирикс это ММХ+ +FFXSR_FLAG equ 2000000h ;25 +TSCP_FLAG equ 8000000h ;27 +LM_FLAG equ 20000000h ;29 +DNo_FLAG equ 40000000h ;30 +DN_FLAG equ 80000000h ;31 + +; ecx cpuid(8000_0001h) +LAHF_FLAG equ 100000h ;Reserved + +; optimize the code for size +macro add arg1,arg2 + { + if arg1 in + 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 + 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 + +;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 +} + +;////////////////////////////////////////////// +; Decoding cache L1,L2,L3 for Intel + + +decodecache: + +comp0: +cmp al, 00h +je L000 + +;-------L2 inst + +comp1: +cmp al, 41h +je L128 + + +comp2: +cmp al, 42h +je L256 + +comp3: +cmp al, 43h +je L512 + +comp4: +cmp al, 44h +je L1024 + + +comp5: +cmp al, 45h +je L2048 + +;------------L1 inst +comp6: +cmp al, 06h +je Li8 + + +comp7: +cmp al, 08h +je Li16 + +comp8: +cmp al, 15h +je Li16 + +comp9: +cmp al, 77h +je Li16 + +comp10: +cmp al, 30h +je Li32 +;---------------L1 data +comp11: +cmp al, 0Ah +je Ld8 + +comp12: +cmp al, 66h +je Ld8 + +comp13: +cmp al, 0Ch +je Ld16 + +comp14: +cmp al, 10h +je Ld16 + +comp15: +cmp al, 67h +je Ld16 + +comp16: +cmp al, 2Ch +je Ld32 + +comp17: +cmp al, 68h +je Ld32 + +;-------L2 +comp18: +cmp al, 39h +je L128 + +comp19: +cmp al, 3Bh +je L128 + +comp20: +cmp al, 79h +je L128 + +comp21: +cmp al, 81h +je L128 + +comp22: +cmp al, 3Ch +je L256 + +comp23: +cmp al, 7Ah +je L256 + +comp24: +cmp al, 7Eh +je L256 + +comp25: +cmp al, 82h +je L256 + +comp26: +cmp al, 7Bh +je L512 + +comp27: +cmp al, 83h +je L512 + +comp28: +cmp al, 86h +je L512 + +comp29: +cmp al, 7Ch +je L1024 + +comp30: +cmp al, 84h +je L1024 + +comp31: +cmp al, 87h +je L1024 + +comp32: +cmp al, 85h +je L2048 + +;-----L1 Trace instr + +comp33: +cmp al, 70h +je Li12 + +comp34: +cmp al, 71h +je Li16 + +comp35: +cmp al, 72h +je Li32 + +;----New codes + +comp36: +cmp al, 60h +je Ld16 + +comp37: +cmp al, 78h +je L1024 + +comp38: +cmp al, 7Dh +je L2048 + +;---- L3 +comp39: +cmp al, 22h +je L305 + +comp40: +cmp al, 23h +je L31 + +comp41: +cmp al, 25h +je L32 + +comp42: +cmp al, 29h +je L34 + +comp43: +cmp al, 88h +je L32 + +comp44: +cmp al, 89h +je L34 + +comp45: +cmp al, 8Ah +je L38 + +comp46: +cmp al, 8Dh +je L34 + +;============= v. 2.04 +comp47: +cmp al, 73h +je Li64 + +comp48: +cmp al, 1Ah +je L96 + +comp49: +cmp al, 3Ah +je L192 + +comp50: +cmp al, 3Dh +je L384 + +comp51: +cmp al, 3Eh +je L512 + +comp52: +cmp al, 7Fh +je L512 + +comp53: +cmp al, 46h +je L34 + +comp54: +cmp al, 47h +je L38 + +comp55: +cmp al, 49h +je L34 + +comp56: +cmp al, 4Ah +je L36 + +comp57: +cmp al, 4Bh +je L38 + +comp58: +cmp al, 4Ch +je L312 + +comp59: +cmp al, 4Dh +je L316 + +jne L000 + +;------------------ +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 + +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 +;////////////////////////////////////////////// +;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 275,210,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 275,210,0x00000000,brand01, brand01len-brand01 +jmp B000 + +Bi02: +mov [brand], 02h +Text 275,210,0x00000000,brand02, brand02len-brand02 +jmp B000 + +Bi03: +mov [brand], 03h + +cmp [m], 8 +je E3 +Text 275,210,0x00000000,brand03, brand03len-brand03 +jmp B000 +E3: +Text 275,210,0x00000000,brand03d, brand03dlen-brand03d +jmp B000 + +Bi04: +mov [brand], 04h +Text 275,210,0x00000000,brand04, brand04len-brand04 +jmp B000 + +Bi06: +mov [brand], 06h +Text 275,210,0x00000000,brand06, brand06len-brand06 +jmp B000 + +Bi07: +mov [brand], 07h +Text 275,210,0x00000000,brand07, brand07len-brand07 +jmp B000 + +Bi08: +mov [brand], 08h +Text 275,210,0x00000000,brand08, brand08len-brand08 +jmp B000 + +Bi09: +mov [brand], 09h +Text 275,210,0x00000000,brand09, brand09len-brand09 +jmp B000 + +Bi0A: +mov [brand], 0Ah +Text 275,210,0x00000000,brand0A, brand0Alen-brand0A +jmp B000 + +Bi0B: +mov [brand], 0Bh + +cmp [m], 13 +jl Eb +Text 275,210,0x00000000,brand0B, brand0Blen-brand0B +jmp B000 +Eb: +Text 275,210,0x00000000,brand0Bd, brand0Bdlen-brand0Bd +jmp B000 + +Bi0C: +mov [brand], 0Ch +Text 275,210,0x00000000,brand0C, brand0Clen-brand0C +jmp B000 + +Bi0E: +mov [brand], 0Eh + +cmp [m], 13 +jl Ed +Text 275,210,0x00000000,brand0E, brand0Elen-brand0E +jmp B000 +Ed: +Text 275,210,0x00000000,brand0Ed, brand0Edlen-brand0Ed +jmp B000 + +Bi0F: +mov [brand], 0Fh +Text 275,210,0x00000000,brand0F, brand0Flen-brand0F +jmp B000 + +Bi11: +mov [brand], 11h +Text 275,210,0x00000000,brand11, brand11len-brand11 +jmp B000 + +Bi12: +mov [brand], 12h +Text 275,210,0x00000000,brand12, brand12len-brand12 +jmp B000 + +Bi13: +mov [brand], 13h +Text 275,210,0x00000000,brand13, brand13len-brand13 +jmp B000 + +Bi14: +mov [brand], 14h +Text 275,210,0x00000000,brand14, brand14len-brand14 +jmp B000 + +Bi15: +mov [brand], 15h +Text 275,210,0x00000000,brand15, brand15len-brand15 +jmp B000 + +Bi16: +mov [brand], 16h +Text 275,210,0x00000000,brand16, brand16len-brand16 +jmp B000 + +Bi17: +mov [brand], 17h +Text 275,210,0x00000000,brand17, brand17len-brand17 +jmp B000 + +B000: + +ret +;////////////////////////////////////////////// + +;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+ 9], $6F6E +jmp Tes7 + +Tes6e: +mov dword [CNXT_ID+ 9], $736579 + + +Tes7: +test ecx, CX16_FLAG +jnz Tes7e + +mov dword [CX16+ 9], $6F6E +jmp Tes8 + +Tes7e: +mov dword [CX16+ 9], $736579 + + +Tes8: +test ecx, ETPRD_FLAG +jnz Tes8e + +mov dword [ETPRD+ 9], $6F6E +jmp Tes9 + +Tes8e: +mov dword [ETPRD+ 9], $736579 + +Tes9: + +ret + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +decode_extended: + xor eax, eax + mov eax,$80000000 + cpuid + ;cmp eax,$80000000 +test eax, 80000000h +jnz gooodd +; +jmp baaad + +baaad: +;mov dword [MP+8], $6F6E +;mov dword [NX+ 8], $6F6E +;mov dword [MMXPi+ 8], $6F6E +;mov dword [MMXn+ 8], $6F6E +;mov dword [FXSRn+ 8], $6F6E +;mov dword [FFXSR+ 10], $6F6E +;mov dword [TSCP+ 10], $6F6E +;mov dword [LM+ 10], $6F6E +;mov dword [DNo+ 10], $6F6E +;mov dword [DN+ 10], $6F6E +;mov dword [SYS+ 9], $6F6E +;mov dword [LAF+ 9], $6F6E + + + +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 было, но из-за Сирикс приходится делать детект в лругом месте + +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+ 10], $6F6E +jmp Tez7 + +Tez6e: +mov dword [FFXSR+ 10], $736579 + +Tez7: +test edx, TSCP_FLAG +jnz Tez7e + +mov dword [TSCP+ 10], $6F6E +jmp Tez8 + +Tez7e: +mov dword [TSCP+ 10], $736579 + + +Tez8: +test edx, LM_FLAG +jnz Tez8e + +mov dword [LM+ 10], $6F6E +jmp Tez9 + +Tez8e: +mov dword [LM+ 10], $736579 + +Tez9: +test edx, DNo_FLAG +jnz Tez9e + +mov dword [DNo+ 10], $6F6E +jmp Tez10 + +Tez9e: +mov dword [DNo+ 10], $736579 + + +Tez10: +test edx, DN_FLAG +jnz Tez10e + +mov dword [DN+ 10], $6F6E +jmp Tez11 + +Tez10e: +mov dword [DN+ 10], $736579 + +;Intel + +Tez11: +test edx, SYS_FLAG +jnz Tez11e + +mov dword [SYS+ 9], $6F6E +jmp Tez12 + +Tez11e: +mov dword [SYS+ 9], $736579 + + +Tez12: +test ecx, LAHF_FLAG +jnz Tez12e + +mov dword [LAF+ 9], $6F6E +jmp Tez13 + +Tez12e: +mov dword [LAF+ 9], $736579 + +Tez13: + +ret +;////////////////////////////////////////////// +newrating: + +cmp [FRS], 266 +jz f266 +cmp [FRS], 333 +jz f333 +cmp [FRS], 400 +jz f400 + +f266: + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Print the unpacked img to screen +; gif2img i333,img_area3 +; mov eax,7 ; sysfunc7: putimage +; mov ebx,img_area3+8 ; pointer to image +; mov ecx,33*65536+30 ; resolution (all gif's included are 64*81) +; mov edx,240*65536+90 ; plce to print image on screen (first number is + ;pixels from left, second pixels from top) +; int 0x40 ; execute function + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;формулы вычисления 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 + 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 + jc @f + mov cl, [athloncoef + ebx] + ret +@@: mov cl, [athloncoef2 + ebx] + 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) + 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) + mov ebx, 3 + mov edx, 0x2C + int 0x40 + + ; shr eax, 24 + ; and eax, 0x1F + shr eax, 27 + and al, 0Fh + add al, 8 + + 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 + mov cl, [coppercoeff + eax] + cmp byte[m], 0x0B + jb @f + mov cl, [tualatcoeff + eax] +@@: ret + +noIntel: +noIntelP6: +noAMDK7: + ret + + diff --git a/programs/system/cpuid/trunk/README.TXT b/programs/system/cpuid/trunk/README.TXT new file mode 100644 index 0000000000..ccd7a39f2a --- /dev/null +++ b/programs/system/cpuid/trunk/README.TXT @@ -0,0 +1,81 @@ +WINDOWS (1251) CODEPAGE + +ENGLISH + +Hi! My name is Sergey Kuzmin aka Wildwest. +This is one of the mostly famous program for KolibriOS/MenuetOS. +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. +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. + +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: + + Ville Turjanmaa (Finland), which wrote MenuetOS and programs TIMES&CPUSPEED + + Ivan Poddubny and /^S0rG^\ (Russia) for useful macroces + + Madis Kalme (Estonia), which wrote fix for strange Intel's Internal names + + Jeffrey Amelynck (Belgium), who send me logos and code for its displaying + (code was based on macros, written by Evgeniy Pavlyushin (Russia), which was + 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 + + Andrey Halyavin (Russia) for his patience during debugging performance test + + Eugeniy Grechnikov (Russia) for great code clean-up and optimization + + Iliya Mikhailov (Russia) for piece of code from his great GMON + + Also I want to thank folks which help me by testing and suggestions - + Sonny, Smiddy and all the RU-Team. + +Please, test it and e-mail me screenshot. + +Bye... + + +RUSSIAN + +Привет! Меня зовут Сергей Кузьмин aka Wildwest. +Это одна из самых известных программ для KolibriOS/MenuetOS. +Она называется CPUID и показывает результаты идентификации процессора. +Это версия 2.05 и ВЫ можете её использовать на свой собственный риск безо всяких гарантий. +Если будут какие-то проблемы или предложения, то напишите мне (kuzmin_serg@list.ru). +Все права на программу принадлежат мне, кроме прав на части, написанных остальными разработчиками. + +Следующие версии будут выкладываться на страничке: http://coolthemes.narod.ru/files.html + +Люди из международной команды MenuetOS помогали мне и я хотел бы упомянуть их здесь: + + Ville Turjanmaa (Финляндия), написавшего MenuetOS, а также программы TIMES и CPUSPEED + + Иван Поддубного and /^S0rG^\ (Россия), написавших полезные макросы + + Madis Kalme (Эстония), написавшего обработчик для странных внутренних имен процессоров Интел + + Jeffrey Amelynck (Бельгия), приславшего мне логотипы и код для их показа + (код основан на макросе от Евгения Павлюшина (Россия), который был просто оберткой + для алгоритма декодирования GIF, реализованного Андреем Ивушкиным (Украина)) + + Марата Закиянова (Россия) за его любезное предложение помочь с созданием дополнительного окна + + Андрея Халявина (Россия) за его терпение в процессе отладки теста произовительности + + Евгения Гречникова (Россия) за чистку кода и оптимизацию + + Илью Михайлова (Россия) за кусок кода из его замечательной программы GMON + + Также я хочу поблагодарить людей, помогавших мне тестированием и предложениями - + Sonny, Smiddy и всю "советскую команду" KolibriOS/MenuetOS . + +Пожалуйста, протестируйте программу и пришлите мне скриншот по e-mail. + +До встреч на форумах( http://meos.sysbin.com, http://board.flatassembler.net/forum.php?f=12). + + + diff --git a/programs/system/cpuid/trunk/amd.gif b/programs/system/cpuid/trunk/amd.gif new file mode 100644 index 0000000000..a79cf5dd0e Binary files /dev/null and b/programs/system/cpuid/trunk/amd.gif differ diff --git a/programs/system/cpuid/trunk/cyrix.gif b/programs/system/cpuid/trunk/cyrix.gif new file mode 100644 index 0000000000..2ffc6535c3 Binary files /dev/null and b/programs/system/cpuid/trunk/cyrix.gif differ diff --git a/programs/system/cpuid/trunk/gif2img.inc b/programs/system/cpuid/trunk/gif2img.inc new file mode 100644 index 0000000000..4413ae4e2b --- /dev/null +++ b/programs/system/cpuid/trunk/gif2img.inc @@ -0,0 +1,301 @@ +COLOR_ORDER equ MENUETOS +gif_hash_offset = gif_hash_area + +macro gif2img gifsrc,imgsrc +{ +local hasharea, ReadGIF, nextblock,_null +local globalColor, img_count, cur_info, img_start +local codesize, compsize, bit_count, CC, EOI, Palette +local block_ofs, table_ptr, gifmacend +local no_gc, block_skip, no_comm, noextblock, uselocal +local setPal, filltable, reinit, cycle, zadd, noinc +local notintable, er, zend, nxt, continue, ex, Gif_skipmap +local Gif_get_sym, shift, nextbl, noblock, loop1, exx +local Gif_output, next, loop2 + +_null fix 0x1000 ; 0x1000 + +if ~gifsrc eq esi + mov esi,gifsrc +end if +if ~imgsrc eq edi + mov edi,imgsrc +end if + + if defined gif_hash_offset + mov eax,gif_hash_offset + else + mov eax,hasharea + end if + + call ReadGIF + jmp gifmacend + + if defined gif_hash_offset + else + hasharea: + times 4096 dd 0 ;4096 + end if + +ReadGIF: + push esi edi + mov [table_ptr],eax + mov [cur_info],edi + xor eax,eax + mov [globalColor],eax + mov [img_count],eax + inc eax + cmp dword[esi],'GIF8' + jne er ; signature + mov ecx,[esi+0xa] + inc eax + add esi,0xd + mov edi,esi + bt ecx,7 + jnc nextblock + mov [globalColor],esi + call Gif_skipmap +nextblock: + cmp byte[edi],0x21 + jne noextblock + inc edi + cmp byte[edi],0xf9 ; Graphic Control Ext + jne no_gc + add edi,7 + jmp nextblock +no_gc: + cmp byte[edi],0xfe ; Comment Ext + jne no_comm + inc edi +block_skip: + movzx eax,byte[edi] + lea edi,[edi+eax+1] + cmp byte[edi],0 + jnz block_skip + inc edi + jmp nextblock +no_comm: + cmp byte[edi],0xff ; Application Ext + jne nextblock + add edi,13 + jmp block_skip +noextblock: + cmp byte[edi],0x2c ; image beginning + jne er + inc [img_count] + inc edi + mov esi,[cur_info] + xchg esi,edi +; movsd +; movsd + + mov bp,word[esi+4] + movzx ebx,bp + mov [edi],ebx + + mov bp,word[esi+6] + movzx ebx,bp + mov [edi+4],ebx + + add edi,8 + add esi,8 + + push edi + movzx ecx,word[esi] + inc esi + bt ecx,7 + jc uselocal + push [globalColor] + mov edi,esi + jmp setPal +uselocal: + call Gif_skipmap + push esi +setPal: + movzx ecx,byte[edi] + inc ecx + mov [codesize],ecx + dec ecx + pop [Palette] + lea esi,[edi+1] + mov edi,[table_ptr] + xor eax,eax + cld + lodsb ; eax - block_count + add eax,esi + mov [block_ofs],eax + mov [bit_count],8 + mov eax,1 + shl eax,cl + mov [CC],eax + inc eax + mov [EOI],eax + lea ecx,[eax-1] + mov eax, _null shl 16 +filltable: + stosd + inc eax + loop filltable + pop edi + mov [img_start],edi +reinit: + mov edx,[EOI] + inc edx + push [codesize] + pop [compsize] + call Gif_get_sym + cmp eax,[CC] + je reinit + call Gif_output +cycle: + movzx ebx,ax + call Gif_get_sym + cmp eax,edx + jae notintable + cmp eax,[CC] + je reinit + cmp eax,[EOI] + je zend + call Gif_output +zadd: + push eax + mov eax,[table_ptr] + mov [eax+edx*4],ebx + pop eax + cmp edx,0xFFF + jae cycle + inc edx + bsr ebx,edx + cmp ebx,[compsize] + jne noinc + inc [compsize] +noinc: + jmp cycle +notintable: + push eax + mov eax,ebx + call Gif_output + push ebx + movzx eax,bx + call Gif_output + pop ebx eax + jmp zadd +er: + pop edi + jmp ex +zend: +; mov eax,[.cur_info] ; skip offset to next frame +; mov [eax],edi + mov [cur_info],edi + add esi,2 + xchg esi,edi +nxt: + cmp byte[edi],0 + jnz continue + inc edi + jmp nxt +continue: +; cmp byte[edi],0x3b ;read next frame +; jne nextblock + xor eax,eax + stosd + mov ecx,[img_count] +ex: + pop edi esi + ret + +Gif_skipmap: +; in: ecx - image descriptor, esi - pointer to colormap +; out: edi - pointer to area after colormap + + and ecx,111b + inc ecx ; color map size + mov ebx,1 + shl ebx,cl + lea ebx,[ebx*2+ebx] + lea edi,[esi+ebx] + ret + +Gif_get_sym: + mov ecx,[compsize] + push ecx + xor eax,eax +shift: + ror byte[esi],1 + rcr eax,1 + dec [bit_count] + jnz loop1 + inc esi + cmp esi,[block_ofs] + jb noblock + push eax + xor eax,eax + lodsb + test eax,eax + jnz nextbl + mov eax,[EOI] + sub esi,2 + add esp,8 + jmp exx +nextbl: + add eax,esi + mov [block_ofs],eax + pop eax +noblock: + mov [bit_count],8 +loop1: + loop shift + pop ecx + rol eax,cl +exx: + xor ecx,ecx + ret + +Gif_output: + push esi eax edx + mov edx,[table_ptr] +next: + push word[edx+eax*4] + mov ax,word[edx+eax*4+2] + inc ecx + cmp ax,_null + jnz next + shl ebx,16 + mov bx,[esp] +loop2: + pop ax + + lea esi,[eax+eax*2] + add esi,[Palette] + + if COLOR_ORDER eq MENUETOS + mov esi,[esi] + bswap esi + shr esi,8 + mov [edi],esi + add edi,3 + else + movsw + movsb + end if + + loop loop2 + pop edx eax esi + ret + + globalColor dd 1 + img_count dd 1 + cur_info dd 1 ; image table pointer + img_start dd 1 + codesize dd 1 + compsize dd 1 + bit_count dd 1 + CC dd 1 + EOI dd 1 + Palette dd 1 + block_ofs dd 1 + table_ptr dd 1 + +gifmacend: +} + diff --git a/programs/system/cpuid/trunk/idt.gif b/programs/system/cpuid/trunk/idt.gif new file mode 100644 index 0000000000..f57ad246aa Binary files /dev/null and b/programs/system/cpuid/trunk/idt.gif differ diff --git a/programs/system/cpuid/trunk/intel.gif b/programs/system/cpuid/trunk/intel.gif new file mode 100644 index 0000000000..38d896967b Binary files /dev/null and b/programs/system/cpuid/trunk/intel.gif differ diff --git a/programs/system/cpuid/trunk/knopka.gif b/programs/system/cpuid/trunk/knopka.gif new file mode 100644 index 0000000000..1fe3e88460 Binary files /dev/null and b/programs/system/cpuid/trunk/knopka.gif differ diff --git a/programs/system/cpuid/trunk/logos.inc b/programs/system/cpuid/trunk/logos.inc new file mode 100644 index 0000000000..b569b942b3 --- /dev/null +++ b/programs/system/cpuid/trunk/logos.inc @@ -0,0 +1,29 @@ +amd: +file 'amd.gif' ;include gif file +rb 50 ;50 bytes temp back zone + +cyrix: +file 'cyrix.gif' ;include gif file +rb 50 ;50 bytes temp back zone + +idt: +file 'idt.gif' ;include gif file +rb 50 ;50 bytes temp back zone + +intel: +file 'intel.gif' ;include gif file +rb 50 ;50 bytes temp back zone + +transmeta: +file 'transmet.gif' ;include gif file +rb 50 ;50 bytes temp back zone + +via: +file 'via.gif' ;include gif file +rb 50 ;50 bytes temp back zone + +knopka: +file 'knopka.gif' ;include gif file +rb 50 ;50 bytes temp back zone + + diff --git a/programs/system/cpuid/trunk/rsatest.inc b/programs/system/cpuid/trunk/rsatest.inc new file mode 100644 index 0000000000..da67b46e26 --- /dev/null +++ b/programs/system/cpuid/trunk/rsatest.inc @@ -0,0 +1,607 @@ +;testing speed of RSA coding (256 bit) +;for program CPUID (WildWest) +;author: halyavin + +;structure of long number: +;rd 1 : length of number +;rd 39: digits of number +;length of zero number is equal to 1. + +number_digits=39 +number_size=4*(number_digits+1) + +;calling convention: +;procedures can change eax,ecx,edx + +init_rsatest: +;to do: add initialization which depends on processor. + ret + + +set_zero: +;eax - address of number +;[eax]:=0 +;result: eax isn't changed + xor ecx,ecx + xor edx,edx + inc edx + mov dword [eax],edx + mov edx,39 + add eax,4 +.loop: + mov dword [eax],ecx + add eax,4 + dec edx + jnz .loop + sub eax,160 ;size of number + ret + +ladd: +;eax - first number +;edx - second number +;[eax]:=[eax]+[edx] + pushad + mov ecx,dword [eax] + mov esi,dword [edx] + mov ebp,eax + cmp ecx,esi + jg .l1 + mov ecx,esi +.l1: + add eax,4 + add edx,4 + xor ebx,ebx + xor esi,esi + mov edi,ecx +.l2: + add ebx,dword [eax] + adc ebx,dword [edx] + adc esi,esi + mov dword [eax],ebx + mov ebx,esi + add eax,4 + xor esi,esi + add edx,4 + dec ecx + jnz .l2 + test ebx,ebx + jz .lend + inc dword [eax] + inc edi +.lend: + mov eax,ebp + mov dword [eax],edi + popad + ret + +lsub: +;eax - first number +;edx - second number +;[eax]=[eax]-[edx] +;[eax]>=[edx] + pushad + mov ecx,dword [eax] + mov edi,ecx + mov ebp,eax + add eax,4 + add edx,4 + xor ebx,ebx + xor esi,esi +.l1: + mov esi,dword [eax] + sub esi,ebx + sbb esi,dword [edx] + mov dword [eax],esi + sbb esi,esi + mov ebx,esi + neg ebx + add eax,4 + add edx,4 + dec ecx + jnz .l1 + dec edi + jz .lend + sub eax,4 +.l2: + mov ebx,dword [eax] + test ebx,ebx + jnz .lend + sub eax,4 + dec edi + jnz .l2 +.lend: + inc edi + mov eax,ebp + mov [eax],edi + popad + ret + +lcmp: +;eax - address of number +;edx - address of number +;result: ecx=1 if eax>edx +; ecx=0 if eax=edx +; ecx=-1 if eax pci_pm_smb_prob + + +.exit_err: + stc + ret +.exit_ok: + clc + ret + +;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +; pci_bus_num: db 2 ; Номер шины +; pci_devfn: db 255 + +; find_north_bridg: + ; mov bl, 6 + ; xor cl, cl +; nbus: mov bh, [pci_bus_num] +; ndevfn: mov ch, [pci_devfn] + ; mov eax, 62 + ; int 0x40 + ; cmp eax, 0xffffffff + ; je bd_next + ;;;;--------- + ; mov esi, bd_table_end - bd_table - 12 +; @@: cmp eax, [bd_table + esi] + ; je bd_found + ; test esi, esi + ; jz bd_next + ; sub esi, 12 + ; jmp @b + ;;;;--------- +; bd_next:dec byte[pci_devfn] + ; jns ndevfn + ; mov byte[pci_devfn], 0 + ; dec byte[pci_bus_num] + ; jns nbus + ; ret +; bd_found: + ; add esi, bd_table + 4 + ; mov edi, nb_name + ; mov ecx, 2 + ; rep movsd + + ; mov [bd_id], eax + ; ret +;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +smbClose: + + ret +;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= diff --git a/programs/system/gmon/config.inc b/programs/system/gmon/config.inc index 6ec3fbdcb8..a5a76aaa2b 100644 --- a/programs/system/gmon/config.inc +++ b/programs/system/gmon/config.inc @@ -1,4 +1,3 @@ -nl equ 0x0d, 0x0a ; 0x00xx - Menuet 0.xx ; 0x0400 - Kolibi 4 (новое завершение процесса) @@ -6,3 +5,5 @@ nl equ 0x0d, 0x0a ; 0x0530 - всего/свободно памяти ; 0x0580 - новое завершение процесса OS_version equ 0x0580 +SMBus fix no ; yes + diff --git a/programs/system/gmon/diag.inc b/programs/system/gmon/diag.inc index c3b0692300..2c1a87b0b3 100644 --- a/programs/system/gmon/diag.inc +++ b/programs/system/gmon/diag.inc @@ -21,11 +21,11 @@ d_show: mov ebx, 12 * 65536 + 13 xor eax, eax lodsb - mov cx, 220 + mov cx, 240 sub ecx, eax @@: shl ecx, 16 - mov cx, 220 + mov cx, 240 lodsb sub ecx, eax mov eax, 38 diff --git a/programs/system/gmon/gmon.asm b/programs/system/gmon/gmon.asm index 7018260b4e..c7b20661f4 100644 --- a/programs/system/gmon/gmon.asm +++ b/programs/system/gmon/gmon.asm @@ -38,6 +38,11 @@ ; 18/07/2006 - Уличшил вывод множителя, исправленны множители для P6 Tualatin, config.inc ; 22/07/2006 - P6 multiplier bugfix ; 30/07/2006 - P6 multiplier bugfix +; --- v 0.4 --- +; 10/08/2006 - начата работа по поддержке SMBus, переписаны функции для чипов мониторинга +; 24/08/2006 - добавленна частота процессора +; 10/09/2006 - bugfix +; 25/11/2006 - добавлен ABIT uGuru ; ; Эй! У меня нет много времени. @@ -46,7 +51,7 @@ ; system.inc - вычисление загрузки процессора, завершение теста, etc... ; tests.inc - тесты ;-) ; diag.inc - поддержка диаграм -; *_tab.inc - процедуры отрисовки соответствуюших вкладок +; tab_*.inc - процедуры отрисовки соответствуюших вкладок ; Идентификаторы кнопок : @@ -202,22 +207,15 @@ no_ut_dec: movzx ecx, ah mov esi, [d_colors + ecx * 4] mov eax, [esi] - call next_color - mov [esi], ebx - jmp draw_window -no_change_color: - - jmp wait_for_event -;--------------------------------------------------------------------- -; Цвета графиков -colors: dd 0xff0000, 0xff00, 0xff, 0xffffff, tcol, 0xFF7E23, 0x8BA169, 0xff0000 ; первый и последний равны -next_color: - mov ecx, (next_color - colors) / 4 ; количество цветов + mov ecx, (colors_end - colors) / 4 ; количество цветов @@: dec ecx cmp eax, [colors + ecx * 4] jne @b mov ebx, [colors + ecx * 4 - 4] - ret + mov [esi], ebx + jmp draw_window +no_change_color: + jmp wait_for_event ;--------------------------------------------------------------------- draw_window: mov eax,12 @@ -226,7 +224,7 @@ draw_window: ; Создаём окно xor eax, eax mov ebx, 300 * 65536 + 309 - mov ecx, 150 * 65536 + 430 + mov ecx, 150 * 65536 + 450 mov edx, tcol + 0x3000000 ; color of work area RRGGBB,8->color mov esi, 0x805080d0 ; color of grab bar RRGGBB,8->color mov edi, 0x005080d0 ; color of frames RRGGBB @@ -234,20 +232,20 @@ draw_window: ; Создаём рамку графика mov eax, 13 mov ebx, 10 * 65536 + 290 - mov ecx, 118 * 65536 + 105 + mov ecx, 138 * 65536 + 105 mov edx, atcol int 0x40 mov ebx, 12 * 65536 + 286 - mov ecx, 120 * 65536 + 101 + mov ecx, 140 * 65536 + 101 mov edx, tcol int 0x40 mov eax, 38 mov edx, atcol mov ebx, 12 * 65536 + 286 + 12 - mov ecx, 120 * 65536 + 120 + mov ecx, 140 * 65536 + 140 @@: add ecx, 10 * 65536 + 10 int 0x40 - cmp cx, 210 ; привязано к координатам окна + cmp cx, 230 ; привязано к координатам окна jl @b ; Пишим заголовок mov eax, 4 @@ -310,7 +308,7 @@ draw_window: cmp byte[hwm_enable], 0 jne show_mon ; Нет датчиков - пишем NO - mov ecx, 6 ;<- количество параметров + mov ecx, 8 ;<- количество параметров mov eax, 4 mov ebx, 121 * 65536 + 50 mov edx, msg_no @@ -332,7 +330,7 @@ show_mon: ;--------------------------- ; Температуру mov ecx, 3 - mov esi, temps + mov esi, hwm_temps mov edx, 121 * 65536 + 50 xor eax, eax sh_temp:push ecx @@ -360,25 +358,25 @@ sh_temp:push ecx pop ecx loop sh_temp ;;--- добавляем на график temp1 --- - movzx eax, word[temps] + movzx eax, word[hwm_temps] mov esi, d_temp1 call d_add call d_show ;;--- добавляем на график temp2 --- - movzx eax, word[temps + 2] + movzx eax, word[hwm_temps + 2] mov esi, d_temp2 call d_add call d_show ;;--- добавляем на график temp3 --- - movzx eax, word[temps + 4] + movzx eax, word[hwm_temps + 4] mov esi, d_temp3 call d_add call d_show ;--------------------------- ; Скорости врашения вентилей - mov ecx, 3 - mov esi, rpms + mov ecx, 5 + mov esi, hwm_rpms mov edx, 121 * 65536 + 80 sh_fan: push ecx lodsd @@ -400,7 +398,7 @@ sh_fan: push ecx ;--------------------------- ; Напруги - mov esi, Vcore + mov esi, hwm_voltages mov edi, old_volts mov ecx, 7 mov ebx, 260 * 65536 + 30 @@ -441,7 +439,7 @@ volt_nxt: no_monitor: ;--------------------------- ; Создаём кнопки вкладок - mov edi, 230 * 65536 + 25 + mov edi, 250 * 65536 + 25 mov ecx, 4 mov eax, 8 mov ebx, 10 * 65536 + 70 @@ -459,7 +457,7 @@ na1: int 0x40 loop n_bt ; Пишим названия вкладок mov eax, 4 - mov ebx, 35 * 65536 + 240 + mov ebx, 35 * 65536 + 260 mov edx, tab_lab mov ecx, 0x10000000 mov esi, 39 @@ -467,11 +465,11 @@ na1: int 0x40 ; создаём рамку внизу экрана mov eax, 13 mov ebx, 10 * 65536 + 290 - mov ecx, 255 * 65536 + 160 + mov ecx, 275 * 65536 + 160 mov edx, atcol int 0x40 mov ebx, 12 * 65536 + 286 - mov ecx, 257 * 65536 + 156 + mov ecx, 277 * 65536 + 156 mov edx, tcol int 0x40 ; рисуем выбранную вкладку @@ -490,16 +488,16 @@ end_drow_tab: jmp wait_for_event ;--- Drow Info tab --------------- info_tab: - include "info_tab.inc" + include "tab_info.inc" ;--- Drow test tab --------------- test_tab: - include "test_tab.inc" + include "tab_test.inc" ;--- Drow Config tab ------------- config_tab: - include "conf_tab.inc" + include "tab_conf.inc" ;--- Drow About tab -------------- about_tab: - include "abou_tab.inc" + include "tab_about.inc" ;--------------------------------------------------------------------- include "system.inc" include "hwm.inc" @@ -509,7 +507,7 @@ about_tab: DATA act_tab db 2 ; Номер активной вкладки tab_lab db 'Info Tests Configs About' -title db 'Ghost Monitor v0.3 [30/07/06]' +title db 'Ghost Monitor v0.4 [25/11/06]' msgs_mon mls \ 'CPU Load (%)',\ @@ -519,7 +517,9 @@ msgs_mon mls \ 'Temp3',\ 'Fan1',\ 'Fan2',\ - 'Fan3' + 'Fan3',\ + 'Fan4',\ + 'Fan5' msgs_mon2 mls \ 'Vcore',\ @@ -536,6 +536,10 @@ msg_no db 'N/A' update_time dd 300 ; период обновления в сотых долях секунды d_colors dd d_cpu_load, d_mem_usage, d_temp1, d_temp2, d_temp3 c_eps dd 0.01 + +; Цвета графиков +colors: dd 0xff0000, 0xff00, 0xff, 0xffffff, tcol, 0xFF7E23, 0x8BA169, 0xff0000 ; первый и последний равны +colors_end: ;--------------------------------------------------------------------- UDATA diff --git a/programs/system/gmon/hwm.inc b/programs/system/gmon/hwm.inc index 8736145758..05636a7829 100644 --- a/programs/system/gmon/hwm.inc +++ b/programs/system/gmon/hwm.inc @@ -1,11 +1,26 @@ +; +; HWM abstract interface, provide: +; hwm_init, hwm_get_params, hwm_enable, hwm_temps, hwm_rpms, hwm_voltages, hwm_chip_name +; + + +if SMBus eq yes + include 'SMBus.inc' +end if include 'hwm_wb.inc' include 'hwm_it87.inc' +include 'hwm_uguru.inc' +;include 'hwm_via686.inc' uglobal - hwm_enable:db 0 ; 0 - no, 1 - Winbond, 2 - ITE - temps db 0,0, 0,0, 0,0 ; градус, десятые, градус, ... - rpms dd 0, 0, 0 ; fan1, fan2, fan3 + hwm_enable: + dd 0 ; 0 - no, 1 - Winbond, 2 - ITE, ... see HWMProbe list + hwm_temps: + db 0,0, 0,0, 0,0 ; градус, десятые, градус, ... + hwm_rpms: + dd 0, 0, 0, 0, 0 ; fan1, fan2, fan3, ... + hwm_voltages: Vcore dd 0.0 Vin0 dd 0.0 Vin1 dd 0.0 @@ -13,68 +28,126 @@ uglobal Vin2 dd 0.0 V12 dd 0.0 V5 dd 0.0 + vol8 dd 0.0 + vol9 dd 0.0 + vol10 dd 0.0 + vol11 dd 0.0 + acc_type db 0 ; 0 - ISA Bus, 1 - SMBus, 2 - other endg +IO_Read dd isaRead ; In : al - addr, out : al - value +IO_Write dd isaWrite ; In : al - addr, bl - value + hwm_unk db 9, 'Not found' hwm_chip_name dd hwm_unk +; NOTE !!! +; HWMProbe - список, процедур проверки чипов, заканчивается +; нулевым двойным словом +; HWMGetParam - список, процедур получения параметров +; оба эти списка должны соответствовать друг другу по +; по порядку процедур +HWMProbe: dd wb_init + dd it87_init + dd uGuru_init + dd 0 ; <- конец списка + +HWMGetParam: dd wb_getparam + dd it87_getparam + dd uGuru_getparam + +;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= hwm_init: ; Проверка наличия и инициализация pusha + ; Ищем датчики на шине ISA + call isaInit + jc @f + call chips_probe + cmp byte[hwm_enable], 0 + jne .exit +@@: call isaClose - mov eax, 46 ; резервируем 0x295 и 0x296 порты - xor ebx, ebx - mov ecx, 0x295 - mov edx, 0x296 - int 0x40 + ; Ищем датчики на шине SMBus + inc byte [acc_type] +if SMBus eq yes + call smbInit + jc @f + call chips_probe + cmp byte[hwm_enable], 0 + jne .exit +@@: call smbClose +end if + ; Ищем датчики на собственной шине (LPC etc) + inc byte [acc_type] + call chips_probe + +.exit: popa + ret +;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +chips_probe: +; Находим нужный чип +; Out : hwm_enable = !0 if found, else hwm_enable not changed + cld ; Paranoia + mov esi, HWMProbe +@@: lodsd test eax, eax - jz hwm_ports_ok -hwm_no: - mov eax, 46 ; освобождаем 0x295 и 0x296 порты - xor ebx, ebx - inc ebx + jz @f ; Конец списка + call eax + jc @b + sub esi, HWMProbe + shr esi, 2 + mov dword[hwm_enable], esi +@@: ret +;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +hwm_get_params: + pusha + mov eax, [hwm_enable] + test eax, eax + jz @f + dec eax + sal eax, 2 + call dword[eax + HWMGetParam] +@@: popa + ret + +;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +; ISA interface +;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +isaRead: + push edx + mov dx, 0x295 + out dx, al + inc edx + in al, dx + pop edx + ret + +isaWrite: + push edx + mov dx, 0x295 + out dx, al + inc edx + mov al, bl + out dx, al + pop edx + ret + +isaInit: + ; Out : CF = 0 if Ok + ; резервируем 0x295 и 0x296 порты mov ecx, 0x295 mov edx, 0x296 - int 0x40 - popa + call ReservePorts + ; jc @f + ; mov [IO_Read], isaRead + ; mov [IO_Write], isaWrite + ; @@: ret -hwm_ports_ok: - call wb_init - jc not_wb - mov byte [hwm_enable], 1 - call wb_get_name - jmp hwm_ok - -not_wb: call it87_init - jc hwm_no - mov byte [hwm_enable], 2 - call it87_get_name - -hwm_ok: mov [hwm_chip_name], edx - popa +isaClose: + ; освобождаем 0x295 и 0x296 порты + mov ecx, 0x295 + mov edx, 0x296 + call FreePorts ret -;---------------------------------------------------- -hwm_get_params: -; Вызывать только если найден - pusha - mov al, [hwm_enable] - dec al - jnz @f - call wb_get_temp - call wb_get_fan_speed - mov edi, wb_coeff - call wb_get_volt - fld dword[V12] - fld dword[wb_n12v_const] - faddp st1, st0 - fstp dword[V12] - popa - ret -@@: call it87_get_temp - call it87_get_fan_speed - mov edi, ite_coeff - call wb_get_volt - popa - ret -;---------------------------------------------------- diff --git a/programs/system/gmon/hwm_it87.inc b/programs/system/gmon/hwm_it87.inc index e55dc87630..6968bcba11 100644 --- a/programs/system/gmon/hwm_it87.inc +++ b/programs/system/gmon/hwm_it87.inc @@ -1,18 +1,15 @@ ; Integrated Technology Express -; Chip Temp Volt Fan -; it8705 3 8 3 -; it8712 3 8 3 +; Chip Temp Volt Fan ISA SMBus +; it8705 3 8 3 + + +; it8712 3 8 3 + + ; SiS -; Chip Temp Volt Fan -; sis950 3 8 3 +; Chip Temp Volt Fan ISA SMBus +; sis950 3 8 3 + + IT87_REGCHIP equ 0x58 IT87_CHIPID equ 0x90 IT87_FANDIV equ 0x0B -uglobal -it_chip_id db 0 -endg it8705 db 15, 'IT8705F/SiS 950' it8712 db 7, 'IT8712F' it8716 db 7, 'IT8716F' @@ -29,37 +26,47 @@ ite_coeff: dd 0.016 ; Vcore it87_init: ; Проверка наличия и инициализация ; OUT - CF = 1 - error + cmp byte[acc_type], 2 ; Only ISA and SMBus + jae it87_no ;--- Проверяем IT87* -------- - mov dx, 0x295 mov al, IT87_REGCHIP - out dx, al - inc edx - in al, dx + call [IO_Read] cmp al, IT87_CHIPID jne it87_no ; это не it87 !!! ; -~- not tested ~-~- - dec edx ; --- узнаём идентификатор чипа -- - mov al, 0x21 - out dx, al - inc edx - in al, dx - mov byte[it_chip_id], al + mov al, 0x21 ; --- узнаём идентификатор чипа -- + call [IO_Read] + mov edx, it8705 + cmp al, 0x05 + je @f + mov edx, it8712 + cmp al, 0x12 + je @f + mov edx, it8716 + cmp al, 0x16 + je @f + mov edx, ite_unk +@@: mov [hwm_chip_name], edx ; -~-~-~-~-~-~-~-~-~- clc ret it87_no:stc ret + +;----------------------------------- +it87_getparam: + call it87_get_temp + call it87_get_fan_speed + mov edi, ite_coeff + call wb_get_volt + ret ;----------------------------------- it87_get_temp: - mov dx, 0x296 xor ecx, ecx - mov esi, temps -@@: dec edx - mov eax, ecx + mov esi, hwm_temps +@@: mov eax, ecx add al, 0x29 - out dx, al - inc edx - in al, dx + call [IO_Read] mov [esi + ecx * 2], al inc ecx cmp ecx, 3 @@ -69,25 +76,21 @@ it87_get_temp: it87_fan_div db 1, 1, 1 it87_get_fan_speed: ; читаем делители - mov dx, 0x295 mov al, IT87_FANDIV - out dx, al - inc dx - in al, dx + call [IO_Read] + mov ah, al and al, 0x07 mov [it87_fan_div], al shr ah, 3 and ah, 0x07 mov [it87_fan_div + 1], ah - + xor ecx, ecx -@@: mov dx, 0x295 - mov al, 0x0D +@@: mov al, 0x0D add al, cl - out dx, al - inc edx - in al, dx + call [IO_Read] + movzx ebx, al push ecx mov cl, [it87_fan_div + ecx] @@ -96,22 +99,10 @@ it87_get_fan_speed: mov eax, 1350000 xor edx, edx div ebx - mov [rpms + 4 * ecx], eax + mov [hwm_rpms + 4 * ecx], eax inc ecx cmp ecx, 3 jb @b ret ;-------------------------------------------------------------------------- -it87_get_name: - mov edx, it8705 - cmp byte[it_chip_id], 0x05 - je @f - mov edx, it8712 - cmp byte[it_chip_id], 0x12 - je @f - mov edx, it8716 - cmp byte[it_chip_id], 0x16 - je @f - mov edx, ite_unk -@@: ret diff --git a/programs/system/gmon/hwm_uguru.inc b/programs/system/gmon/hwm_uguru.inc new file mode 100644 index 0000000000..b349b2c101 --- /dev/null +++ b/programs/system/gmon/hwm_uguru.inc @@ -0,0 +1,212 @@ +; ABIT uGuru +; +; Chip Temp Volt Fan ISA SMBus LPC +; W83L950D(?) 3 11 5 - - + + + +; uGuru ports +UGURU_CMD_PORT equ 0x0e0 +UGURU_DATA_PORT equ 0x0e4 +; temp sensors +UGURU_CPUTEMP equ 0x2100 +UGURU_SYSTEMP equ 0x2101 +UGURU_PWMTEMP equ 0x210f +; fans. These are placed at bank 2 +SENS_CPUFAN equ 0x2600 +SENS_NBFAN equ 0x2601 +SENS_SYSFAN equ 0x2602 +SENS_AUXFAN1 equ 0x2603 +SENS_AUXFAN2 equ 0x2604 +; Voltage sensors +SENS_VCORE equ 0x2103 ; 3.49V max +SENS_DDRVDD equ 0x2104 ; 3.49V max +SENS_DDRVTT equ 0x210A ; 3.49V max +SENS_NBVDD equ 0x2108 ; 3.49V max +SENS_SBVDD equ 0x210E ; 3.49V max +SENS_HTV equ 0x2102 ; 3.49V max +SENS_AGP equ 0x2109 ; 3.49V max +SENS_5V equ 0x2106 ; 6.25V max +SENS_3V3 equ 0x2105 ; 4.36V max +SENS_5VSB equ 0x210B ; 6.25V max +SENS_3VDUAL equ 0x210D ; 4.36V max +; Voltage ADC multipliers +MLTP_3V49 equ 0.0136862745098039 +MLTP_4V36 equ 0.0170980392156863 +MLTP_6V25 equ 0.0245098039215686 + + +v_addr: dw SENS_VCORE, SENS_DDRVDD, SENS_DDRVTT, SENS_NBVDD, SENS_SBVDD + dw SENS_HTV, SENS_AGP, SENS_5V, SENS_3V3, SENS_5VSB, SENS_3VDUAL + +v_mult: dd MLTP_3V49, MLTP_3V49, MLTP_3V49, MLTP_3V49, MLTP_3V49, MLTP_3V49 + dd MLTP_3V49, MLTP_6V25, MLTP_4V36, MLTP_6V25, MLTP_4V36 + + +msg_uguru: db 10, 'ABIT uGuru' + +;----------------------------------- +uGuru_init: +; Проверка наличия и инициализация +; OUT - CF = 1 - error + cmp byte[acc_type], 3 ; Special IO interface + jne .uGuru_no + pusha + mov ecx, UGURU_CMD_PORT + mov edx, UGURU_DATA_PORT + call ReservePorts + test eax, eax + jnz .no_lpc + in al, UGURU_CMD_PORT + test al, al + jz @f + cmp al, 0xac + jne .bad_sig +@@: in al, UGURU_DATA_PORT + test al, al + jz @f + cmp al, 8 + jne .bad_sig +@@: mov [hwm_chip_name], msg_uguru + popa + clc + ret +.bad_sig: + ; popa ; + ; clc ; <- uncomment this three line, if you certain that you + ; ret ; have ABIT uGuru but he is not defined +.no_lpc: + mov ecx, UGURU_CMD_PORT + mov edx, UGURU_DATA_PORT + call FreePorts + popa +.uGuru_no: + stc + ret +;----------------------------------- +uGuru_getparam: + ; Temperature + mov ax, UGURU_CPUTEMP + call uGuru_ReadSensor + mov [hwm_temps + 0], al + mov ax, UGURU_SYSTEMP + call uGuru_ReadSensor + mov [hwm_temps + 1], al + mov ax, UGURU_PWMTEMP + call uGuru_ReadSensor + mov [hwm_temps + 2], al + ; Fan speed + mov ax, SENS_CPUFAN + call uGuru_ReadSensor + mov dl, 60 + mul dl + mov word[hwm_rpms + 0 ], ax + mov ax, SENS_NBFAN + call uGuru_ReadSensor + mov dl, 60 + mul dl + mov word[hwm_rpms + 4 ], ax + mov ax, SENS_SYSFAN + call uGuru_ReadSensor + mov dl, 60 + mul dl + mov word[hwm_rpms + 8 ], ax + mov ax, SENS_AUXFAN1 + call uGuru_ReadSensor + mov dl, 60 + mul dl + mov word[hwm_rpms + 12], ax + mov ax, SENS_AUXFAN2 + call uGuru_ReadSensor + mov dl, 60 + mul dl + mov word[hwm_rpms + 16], ax + ; voltages + cld ; Paranoia + xor ecx, ecx + mov esi, v_addr +@@: push ecx + lodsw + call uGuru_ReadSensor + movzx eax, al + fld dword[v_mult + ecx * 4] + push eax + fild dword [esp] + fmulp st1, st0 + fstp dword [hwm_voltages + ecx * 4] + pop eax + pop ecx + inc ecx + cmp ecx, 11 ; <-- количество датчиков (ADC Vin) + jne @b + + ret +;----------------------------------- +uGuru_ReadSensor: +; Read a sensor +; In : ax - sensorID +; Out : al - result + mov ebx, eax ; Ask to read from uGuru + shr eax, 8 + out UGURU_DATA_PORT, al + mov ecx, 1000 ; I guess this is to se if uGuru is ready to take a command +.is_ready: + in al, UGURU_DATA_PORT + dec ecx + jnz @f + xor al, al + ret +@@: cmp al, 8 + jne .is_ready + mov al, bl ; Whitch sensor to read? + out UGURU_CMD_PORT, al + mov ecx, 1000 ; Wait until uGuru is ready to be read +.is_ready2: + in al, UGURU_DATA_PORT + dec ecx + jnz @f + xor al, al + ret +@@: cmp al, 1 + jne .is_ready2 + in al, UGURU_CMD_PORT ; Read the sensor + push eax + call uGuru_Ready ; Put the chip in ready state + pop eax ; Return the result of the sensor + ret +;----------------------------------- +uGuru_Ready: +; Put uGuru in ready state. uGuru will hold 0x08 at Data port and 0xAC at Command port after this. +; Out : CF = 1 - error + ; Wait until uGuru is in ready-state + ; The loop shouldn't be needed to execut more then one time + mov edx, 1000 +.nxt: in al, UGURU_DATA_PORT + cmp al, 8 + je .ok + xor al, al ; after 0x00 is written to Data port + out UGURU_DATA_PORT, al + mov ecx, 1000 ; Wait until 0x09 is read at Data port +.is_ready: + in al, UGURU_DATA_PORT + dec ecx + jnz @f + stc + ret +@@: cmp al, 9 + jne .is_ready + mov ecx, 1000 ; Wait until 0xAC is read at Cmd port +.is_ready2: + in al, UGURU_CMD_PORT + dec ecx + jnz @f + stc + ret +@@: cmp al, 0xAC + jne .is_ready2 + dec edx ; Prevent a lockup + jnz .nxt + stc + ret +.ok: clc + ret + diff --git a/programs/system/gmon/hwm_wb.inc b/programs/system/gmon/hwm_wb.inc index cf889db1cc..6da0867b59 100644 --- a/programs/system/gmon/hwm_wb.inc +++ b/programs/system/gmon/hwm_wb.inc @@ -6,229 +6,44 @@ ; + 16.03.06 Исправлена ошибка в wb_get_cpu_temper с десятых градуса (было 30.5 30.0 31.5 ...) ; ; -uglobal -wb_chip_id: db 0 ; Идентификатор чипа (если нашли) -endg -; | Chip name | ID Vin Fanin PWM Temp -msg_wb27HF: db 8, 'W83627HF' ; 0x20|0x21 9 3 2 3 -msg_wb27THF: db 9, 'W83627THF' ; 0x90|0x91 7 3 3 3 -msg_wb37THF: db 9, 'W83637THF' ; 0x80 7 3 3 3 -msg_wb97HF: db 8, 'W83697HF' ; 0x60|0x61 8 2 2 2 +; | Chip name | ID Vin Fanin PWM Temp ISA SMBus +msg_wb27HF: db 8, 'W83627HF' ; 0x20|0x21 9 3 2 3 + + +msg_wb27THF: db 9, 'W83627THF' ; 0x90|0x91 7 3 3 3 + + +msg_wb37THF: db 9, 'W83637THF' ; 0x80 7 3 3 3 + + +msg_wb97HF: db 8, 'W83697HF' ; 0x60|0x61 8 2 2 2 + - msg_wb27EHF: db 11,'W83627EHF-A' ; 0x88 msg_wb27THFA: db 11,'W83627THF-A' ; 0x1A -; db 7, 'W83781D' ; 0x10|0x11 7 3 3 -; db 7, 'W83782D' ; 0x30 9 3 3 -; db 8, 'AS99127F' ; 0x31 -; db 7, 'W83783S' ; 0x40|0x41 5-6 3 1-2 -; db 7, 'W83791D' ; 0x70|0x71 10 5 3 +; db 7, 'W83781D' ; 0x10|0x11 7 3 3 + + +; db 7, 'W83782D' ; 0x30 9 3 3 + + +; db 8, 'AS99127F' ; 0x31 7 3 3 - + +; db 7, 'W83783S' ; 0x40|0x41 5-6 3 1-2 - + +; db 7, 'W83791D' ; 0x70|0x71 10 5 3 - + msg_wbunk: db 15,'Unknown Winbond' ; other, non zero ;-) ;----------------------------------- wb_init: ; Проверка наличия и инициализация ; OUT - CF = 1 - error - mov dx, 0x295 + cmp byte[acc_type], 2 ; Only ISA and SMBus + jae wb_no + mov al, 0x4e - out dx, al - inc edx - xor al, al - out dx, al - dec edx + xor bl, bl + call [IO_Write] mov al, 0x4f - out dx, al - inc edx - in al, dx + call [IO_Read] mov ah, al ;! - dec edx mov al, 0x4e - out dx, al - inc edx - mov al, 0x80 - out dx, al - dec edx + mov bl, 0x80 + call [IO_Write] mov al, 0x4f - out dx, al - inc edx - in al, dx + call [IO_Read] cmp ax, 0xa35c jne wb_no ; это не Winbond !!! - dec edx ; --- узнаём идентификатор чипа -- - mov al, 0x58 - out dx, al - inc edx - in al, dx - mov byte[wb_chip_id], al - clc - ret -wb_no: stc - ret - -;----------------------------------- -wb_get_temp: - ; temp 1 - mov dx, 0x295 ; Выбираем bank 1 - mov al, 0x4e - out dx, al - inc edx - mov al, 1 - out dx, al - - dec edx ; Получаем старший байт температуры (градусы) - mov al, 0x50 - out dx, al - inc edx - in al, dx - mov [temps], al - dec edx ; Получаем младший байт температуры (0.5`C) - mov al, 0x51 - out dx, al - inc edx - in al, dx ; if al == 0 then 0.0, else 0.5 - cmp al, 0 - je @f - mov al, 5 -@@: mov [temps + 1], al - ; temp 2 (3 SYSTIN) - dec edx ; Выбираем bank 0 - mov al, 0x4e - out dx, al - inc edx - mov al, 0 - out dx, al - - dec edx ; Получаем старший байт температуры (градусы) - mov al, 0x27 - out dx, al - inc edx - in al, dx - mov [temps + 2], al - ; temp 3 (VTIN) - dec edx ; Выбираем bank 2 - mov al, 0x4e - out dx, al - inc edx - mov al, 2 - out dx, al - - dec edx ; Получаем старший байт температуры (градусы) - mov al, 0x50 - out dx, al - inc edx - in al, dx - mov [temps + 4], al - dec edx ; Получаем младший байт температуры (0.5`C) - mov al, 0x51 - out dx, al - inc edx - in al, dx ; if al == 0 then 0.0, else 0.5 - cmp al, 0 - je @f - mov al, 5 -@@: mov [temps + 5], al - ; Проверка температуры, датчики с 127.5`C не используются - mov ecx, 3 - mov esi, temps -wb_check_temp: - cmp word[esi + ecx * 2 - 2], 0x057F - jne wb_temp_ok - mov word[esi + ecx * 2 - 2], 0 -wb_temp_ok: - loop wb_check_temp - ret -;----------------------------------- -wb_get_fan_speed: - ; fan1 - mov al, 0x47 - mov dx, 0x295 - out dx, al - inc edx - in al, dx - and al, 0x30 - shr al, 4 - mov ebx, 1 - mov cl, al - shl ebx, cl ; <- div1 - dec edx - mov al, 0x28 - out dx, al - inc edx - xor eax, eax - in al, dx - cmp al, 255 - jne @f - xor eax, eax - ret -@@: mul ebx - mov ebx, eax - mov eax, 1350000 - xor edx, edx - div ebx - mov [rpms], eax - - mov al, 0x47 - mov dx, 0x295 - out dx, al - inc edx - in al, dx - shr al, 6 - mov ebx, 1 - mov cl, al - shl ebx, cl ; <- div2 - dec edx - mov al, 0x29 - out dx, al - inc edx - xor eax, eax - in al, dx - cmp al, 255 - jne @f - xor eax, eax - ret -@@: mul ebx - mov ebx, eax - mov eax, 1350000 - xor edx, edx - div ebx - mov [rpms + 4], eax - ret -;----------------------------------- -wb_get_volt: - mov dx, 0x295 - ;mov edi, vcoeff ; <-- possible differences for miscellaneous chip - mov esi, Vcore - xor ecx, ecx -@@: mov eax, ecx - add al, 0x20 - out dx, al - inc edx - in al, dx - fld dword [edi + ecx * 4] - push eax - fild dword [esp] - fmulp st1, st0 - fstp dword [esi + ecx * 4] - pop eax - inc ecx - dec edx - cmp ecx, 7 - jb @b - ret - -wb_coeff: dd 0.016 ; Vcore - dd 0.016 ; Vin0 - dd 0.016 ; Vin1 (+3.3V) - dd 0.02688 ; AVcc (+5V) - dd 0.0608 ; Vin2 (+12V) - dd 0.0822857142857145 ; -12V - dd -0.02408 ; -5V ; false - -wb_n12v_const dd -14.9142857142857 -;----------------------------------- -wb_get_name: -; Возвращает имя чипа -; Out : EDX - pointer to string (size:string - Pascal style) - mov al, [wb_chip_id] + ; --- узнаём идентификатор чипа -- + mov al, 0x58 + call [IO_Read] and al, 0xFE ; 0x20 = 0x21, 0x60 = 0x61, etc mov edx, msg_wb27HF cmp al, 0x20 @@ -249,6 +64,143 @@ wb_get_name: cmp al, 0x1A je @f mov edx, msg_wbunk -@@: ret +@@: mov [hwm_chip_name], edx + clc + ret +wb_no: stc + ret + +;----------------------------------- +wb_getparam: + call wb_get_temp + call wb_get_fan_speed + mov edi, wb_coeff + call wb_get_volt + fld dword[V12] + fld dword[wb_n12v_const] + faddp st1, st0 + fstp dword[V12] + ret +;----------------------------------- +wb_get_temp: + ; temp 1 + mov al, 0x4e ; Выбираем bank 1 + mov bl, 1 + call [IO_Write] + mov al, 0x50 ; Получаем старший байт температуры (градусы) + call [IO_Read] + mov [hwm_temps], al + mov al, 0x51 ; Получаем младший байт температуры (x.5`C) + call [IO_Read] + cmp al, 0 ; if al == 0 then x.0, else x.5 + je @f + mov al, 5 +@@: mov [hwm_temps + 1], al + + ; temp 2 (3 SYSTIN) + mov al, 0x4e ; Выбираем bank 0 + xor bl, bl + call [IO_Write] + mov al, 0x27 ; Получаем старший байт температуры (градусы) + call [IO_Read] + mov [hwm_temps + 2], al + + ; temp 3 (VTIN) + mov al, 0x4e ; Выбираем bank 2 + mov bl, 2 + call [IO_Write] + mov al, 0x50 ; Получаем старший байт температуры (градусы) + call [IO_Read] + mov [hwm_temps + 4], al + mov al, 0x51 ; Получаем младший байт температуры (x.5`C) + call [IO_Read] + cmp al, 0 ; if al == 0 then x.0, else x.5 + je @f + mov al, 5 +@@: mov [hwm_temps + 5], al + + ; Проверка температуры, датчики с 127.5`C не используются + mov ecx, 3 + mov esi, hwm_temps +wb_check_temp: + cmp word[esi + ecx * 2 - 2], 0x057F + jne wb_temp_ok + mov word[esi + ecx * 2 - 2], 0 +wb_temp_ok: + loop wb_check_temp + + ret +;----------------------------------- +wb_get_fan_speed: + ; fan1 + mov al, 0x47 + call [IO_Read] + and al, 0x30 + shr al, 4 + mov ebx, 1 + mov cl, al + shl ebx, cl ; <- div1 + xor eax, eax + mov al, 0x28 + call [IO_Read] + cmp al, 255 + jne @f + xor eax, eax ; ??? + ret ; ??? +@@: mul ebx + mov ebx, eax + mov eax, 1350000 + xor edx, edx + div ebx + mov [hwm_rpms], eax + mov al, 0x47 + call [IO_Read] + shr al, 6 + mov ebx, 1 + mov cl, al + shl ebx, cl ; <- div2 + xor eax, eax + mov al, 0x29 + call [IO_Read] + cmp al, 255 + jne @f + xor eax, eax + ret +@@: mul ebx + mov ebx, eax + mov eax, 1350000 + xor edx, edx + div ebx + mov [hwm_rpms + 4], eax + ret +;----------------------------------- +wb_get_volt: + ;mov edi, wb_coeff ; <-- possible differences for miscellaneous chip + mov esi, hwm_voltages + xor ecx, ecx +@@: mov eax, ecx + add al, 0x20 + call [IO_Read] + fld dword [edi + ecx * 4] + push eax + fild dword [esp] + fmulp st1, st0 + fstp dword [esi + ecx * 4] + pop eax + inc ecx + cmp ecx, 7 + jb @b + ret + +wb_coeff: dd 0.016 ; Vcore + dd 0.016 ; Vin0 + dd 0.016 ; Vin1 (+3.3V) + dd 0.02688 ; AVcc (+5V) + dd 0.0608 ; Vin2 (+12V) + dd 0.0822857142857145 ; -12V + dd -0.02408 ; -5V ; false + +wb_n12v_const dd -14.9142857142857 + diff --git a/programs/system/gmon/macros.inc b/programs/system/gmon/macros.inc index 2bf751cecf..96accce350 100644 --- a/programs/system/gmon/macros.inc +++ b/programs/system/gmon/macros.inc @@ -4,6 +4,7 @@ lang fix en ; ru en fr ge fi @^ fix macro comment { ^@ fix } +nl equ 0x0d, 0x0a ;~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- macro uglobal { UGlobals equ UGlobals, diff --git a/programs/system/gmon/readme.txt b/programs/system/gmon/readme.txt index 3a31194864..fe27dbdba2 100644 --- a/programs/system/gmon/readme.txt +++ b/programs/system/gmon/readme.txt @@ -1,38 +1,46 @@ -==[CP1251]======================================== - Ghost Monitor Автор : Михайлов Илья Андреевич aka Ghost -Версия : 0.3 от 30/07/06 -ОС : для полного функционирования Kolibri 0.5.8.0 и старше +Версия : 0.4 от 25/11/06 +ОС : для полного функционирования скачайте последнне ядро, или последний дистрибутив. +files : svn://kolibrios.org/programs/system/gmon/ + http://iam.gorodok.net/Gmon.zip forum : meos.sysbin.com -> Программы -> GMon -file : http://iam.gorodok.net/Gmon.zip mailto : ghost.nsk@mail.ru Назначение : - Мониторинг температуры и скорости врашения вентиляторов процессора и + Мониторинг температуры, напряжения и скорости врашения вентиляторов процессора и материнской платы, стресс тестирование надёжности системы охлаждения и блока питания компьютера. Мониторинг : - В настоящее время отображаются загрузка процессора, загрузка памяти, температура, скорости -врашения вентиляторов и напряжение. Поддерживаемые чипы мониторинга : + В настоящее время отображаются загрузка/частота процессора, загрузка памяти, температура, +скорости врашения вентиляторов и напряжение. Поддерживаемые чипы мониторинга : + WinBond chip : W83627HF/THF/THF-A/EHF-A, W83637THF, W83697HF, и аналоги. -Integrated Technology Express : IT8705F, IT8712F, IT8716F, и аналоги. -SiS : sis950 (аналог IT8705F) -Функции мониторинга температуры можно проверить в Windows на эмуляторе KlbrInWin, для этого -необходимо в файле настроек написать EnablePorts 295 296 +Integrated Technology Express (ITE) : IT8705F, IT8712F, IT8716F, и аналоги. +Silicon Integrated Systems Corp. (SiS) : sis950 (аналог IT8705F) +ABIT : uGuru + +Функции мониторинга можно проверить в Windows на эмуляторе KlbrInWin, для этого необходимо в +файле настроек написать (пользуйтесь последней версией): + +EnablePorts=e0-e8 295 296 +AllowReadMSR=true Тесты : Тесты ориентированы на процессоры P5, P6, K6 и K7, основаны на Robert Redelmeier's CPUburn [http://pages.sbcglobal.net/redelm/]. Цля тестирования Pentium 4, рекомендую тест для K7, для остальных процессоров подберите по максимальной температуре (напишите мне об этом). -Внимание! Программа не реагирует на критический порог температуры, поэтому для избежания + + Внимание! Программа не реагирует на критический порог температуры, поэтому для избежания порчи оборудования не оставляйте запушенный тест без присмотра! В связи с различием в реализации функции 18-2, для Menuet и Kolibri необходимы различные реализации программы, по -умолчанию компилируется для Kolibri 0.5.8.0, при необходимости измените процедуру stop_test в -system.inc. Тесты работают одинаково эффективно как на реальном оборудовании, так и на -виртуальных машинах. +умолчанию компилируется для Kolibri 0.5.8.0 и старше, при необходимости измените параметр +OS_version в файле config.inc. Тесты работают одинаково эффективно как на реальном оборудовании, +так и на виртуальных машинах, но не рекоммендуется запускать их на эмуляторах (KlbrInWin, +MeOSEmul, etc) в связи с плохой реализацией завершения процесса, что может привести к порче +оборудования. На будущее : Новые чипы @@ -42,58 +50,9 @@ system.inc. Особая благодарность всем участникам форума. Найденные ошибки и предложения пишите в форум или на почту. -ВНИМАНИЕ !!! ВОЗМОЖНА ПОРЧА ОБОРУЦОВАНИЯ! -ИСПОЛЬЗУЙТЕ НА СВОЙ СТРАХ И РИСК! +И напоследок : + +ВНИМАНИЕ !!! ВОЗМОЖНА ПОРЧА ОБОРУДОВАНИЯ! ИСПОЛЬЗУЙТЕ НА СВОЙ СТРАХ И РИСК! Программа распостраняется "as is", и автор не несет ответственности за возможный ущерб, причиненный -программой. - -==[CP866]========================================= - - Ghost Monitor - -Ђўв®а : ЊЁе ©«®ў €«мп Ђ­¤аҐҐўЁз aka Ghost -‚ҐабЁп : 0.3 ®в 30/07/06 -Ћ‘ : ¤«п Ї®«­®Ј® дг­ЄжЁ®­Ёа®ў ­Ёп Kolibri 0.5.8.0 Ё бв аиҐ -forum : meos.sysbin.com -> Џа®Ја ¬¬л -> GMon -file : http://iam.gorodok.net/Gmon.zip -mailto : ghost.nsk@mail.ru - -Ќ §­ зҐ­ЁҐ : - Њ®­Ёв®аЁ­Ј ⥬ЇҐа вгал Ё бЄ®а®бвЁ ўа иҐ­Ёп ўҐ­вЁ«пв®а®ў Їа®жҐбб®а  Ё -¬ вҐаЁ­бЄ®© Ї« вл, бваҐбб вҐбвЁа®ў ­ЁҐ ­ ¤с¦­®бвЁ бЁбвҐ¬л ®е« ¦¤Ґ­Ёп Ё Ў«®Є  -ЇЁв ­Ёп Є®¬ЇмовҐа . - -Њ®­Ёв®аЁ­Ј : - ‚ ­ бв®п饥 ўаҐ¬п ®в®Ўа ¦ овбп § Јаг§Є  Їа®жҐбб®а , § Јаг§Є  Ї ¬пвЁ, ⥬ЇҐа вга , бЄ®а®бвЁ -ўа иҐ­Ёп ўҐ­вЁ«пв®а®ў Ё ­ Їа殮­ЁҐ. Џ®¤¤Ґа¦Ёў Ґ¬лҐ зЁЇл ¬®­Ёв®аЁ­Ј  : -WinBond chip : W83627HF/THF/THF-A/EHF-A, W83637THF, W83697HF, Ё  ­ «®ЈЁ. -Integrated Technology Express : IT8705F, IT8712F, IT8716F, Ё  ­ «®ЈЁ. -SiS : sis950 ( ­ «®Ј IT8705F) -”г­ЄжЁЁ ¬®­Ёв®аЁ­Ј  ⥬ЇҐа вгал ¬®¦­® Їа®ўҐаЁвм ў Windows ­  н¬г«пв®аҐ KlbrInWin, ¤«п нв®Ј® -­Ґ®Ўе®¤Ё¬® ў д ©«Ґ ­ бв஥Є ­ ЇЁб вм EnablePorts 295 296 - -’Ґбвл : - ’Ґбвл ®аЁҐ­вЁа®ў ­л ­  Їа®жҐбб®ал P5, P6, K6 Ё K7, ®б­®ў ­л ­  Robert Redelmeier's CPUburn -[http://pages.sbcglobal.net/redelm/]. –«п вҐбвЁа®ў ­Ёп Pentium 4, ४®¬Ґ­¤го вҐбв ¤«п K7, ¤«п -®бв «м­ле Їа®жҐбб®а®ў Ї®¤ЎҐаЁвҐ Ї® ¬ ЄбЁ¬ «м­®© ⥬ЇҐа вгॠ(­ ЇЁиЁвҐ ¬­Ґ ®Ў н⮬). -‚­Ё¬ ­ЁҐ! Џа®Ја ¬¬  ­Ґ ॠЈЁагҐв ­  ЄаЁвЁзҐбЄЁ© Ї®а®Ј ⥬ЇҐа вгал, Ї®н⮬㠤«п Ё§ЎҐ¦ ­Ёп -Ї®азЁ ®Ў®а㤮ў ­Ёп ­Ґ ®бв ў«п©вҐ § Їг襭­л© вҐбв ЎҐ§ ЇаЁб¬®ва ! ‚ бўп§Ё б а §«ЁзЁҐ¬ ў -ॠ«Ё§ жЁЁ дг­ЄжЁЁ 18-2, ¤«п Menuet Ё Kolibri ­Ґ®Ўе®¤Ё¬л а §«Ёз­лҐ ॠ«Ё§ жЁЁ Їа®Ја ¬¬л, Ї® -㬮«з ­Ёо Є®¬ЇЁ«ЁагҐвбп ¤«п Kolibri 0.5.8.0, ЇаЁ ­Ґ®Ўе®¤Ё¬®бвЁ Ё§¬Ґ­ЁвҐ Їа®жҐ¤гаг stop_test ў -system.inc. ’Ґбвл а Ў®в ов ®¤Ё­ Є®ў® нд䥪⨢­® Є Є ­  ॠ«м­®¬ ®Ў®а㤮ў ­ЁЁ, в Є Ё ­  -ўЁавг «м­ле ¬ иЁ­ е. - -Ќ  Ўг¤г饥 : - Ќ®ўлҐ зЁЇл - ђҐ ЄжЁп ­  ЄаЁвЁзҐбЄЁ© Ї®а®Ј ⥬ЇҐа вгал - Џа®ўҐЄ  ­ ¤с¦­®бвЁ б奬 ЇЁв ­Ёп - -Ћб®Ў п Ў« Ј®¤ а­®бвм ўбҐ¬ гз бв­ЁЄ ¬ д®аг¬ . -Ќ ©¤Ґ­­лҐ ®иЁЎЄЁ Ё ЇаҐ¤«®¦Ґ­Ёп ЇЁиЁвҐ ў д®аг¬ Ё«Ё ­  Ї®звг. - -‚Ќ€ЊЂЌ€… !!! ‚Ћ‡ЊЋ†ЌЂ ЏЋђ—Ђ ЋЃЋђ“–Ћ‚ЂЌ€џ! -€‘ЏЋ‹њ‡“‰’… ЌЂ ‘‚Ћ‰ ‘’ђЂ• € ђ€‘Љ! - -Џа®Ја ¬¬  а бЇ®бва ­пҐвбп "as is", Ё  ўв®а ­Ґ ­ҐбҐв ®вўҐвб⢥­­®бвЁ §  ў®§¬®¦­л© гйҐаЎ, ЇаЁзЁ­Ґ­­л© -Їа®Ја ¬¬®©. \ No newline at end of file +программой. \ No newline at end of file diff --git a/programs/system/gmon/system.inc b/programs/system/gmon/system.inc index a865a2a030..ecf9dc149a 100644 --- a/programs/system/gmon/system.inc +++ b/programs/system/gmon/system.inc @@ -161,7 +161,7 @@ multiplier: ; out : CL = коэфф.умножения * 10, или 0 xor ecx, ecx if (OS_version >= 0x0510) - display nl, 'Multiplier : yes' + display nl, 'Multiplier (RDMSR) : yes' cmp dword [Vendor + 8], 'cAMD' ; Check for Advanced Micro Devices CPU jne noAMD cmp byte [CPU_fam], 5 @@ -369,3 +369,26 @@ uglobal Data_String: times 20 db 0 ; ASCIIZ сторка с преобразованным числом endg ;-------------------------------------------------------------------- +ReservePorts: + ; In : ecx - first port, edx - last port + ; Out : CF = 1 if error + pusha + mov eax, 46 + xor ebx, ebx + int 0x40 + clc + test eax, eax + jz @f + stc +@@: popa + ret + +FreePorts: + ; In : ecx - first port, edx - last port + pusha + mov eax, 46 ; освобождаем 0x295 и 0x296 порты + xor ebx, ebx + inc ebx + int 0x40 + popa + ret diff --git a/programs/system/gmon/abou_tab.inc b/programs/system/gmon/tab_about.inc similarity index 87% rename from programs/system/gmon/abou_tab.inc rename to programs/system/gmon/tab_about.inc index c5eee75ac0..698931974d 100644 --- a/programs/system/gmon/abou_tab.inc +++ b/programs/system/gmon/tab_about.inc @@ -1,6 +1,6 @@ mov edx, msg_about - mov ebx, 17 * 65536 + 265 + mov ebx, 17 * 65536 + 285 call show_text jmp end_drow_tab @@ -12,10 +12,10 @@ msg_about mls \ ; 'Supported SuperIO : W83627HF,W83697HF',\ ' W83627THF,W83627THF-A,W83627EHF-A,',\ ' W83637THF,IT8705F,IT8712F,SiS950',\ + ' ABIT uGuru',\ '',\ 'Tests based on R.J.Redelmeier CPUBurn',\ '',\ 'Mailto : ghost.nsk@mail.ru',\ '',\ - '',\ ' *** Use at YOUR own RISK ***' diff --git a/programs/system/gmon/conf_tab.inc b/programs/system/gmon/tab_conf.inc similarity index 75% rename from programs/system/gmon/conf_tab.inc rename to programs/system/gmon/tab_conf.inc index da6a9bda4f..147e9972f0 100644 --- a/programs/system/gmon/conf_tab.inc +++ b/programs/system/gmon/tab_conf.inc @@ -6,7 +6,7 @@ ; Время обновления mov eax, 8 mov ebx, 200 * 65536 + 15 - mov ecx, 260 * 65536 + 15 + mov ecx, 280 * 65536 + 15 mov edx, 11 mov esi, tcol int 0x40 @@ -16,13 +16,13 @@ int 0x40 mov eax, 4 - mov ebx, 17 * 65536 + 265 + mov ebx, 17 * 65536 + 285 mov edx, msg_cf_utime mov ecx, 0x10000000 mov esi, 11 int 0x40 - mov ebx, 205 * 65536 + 265 + mov ebx, 205 * 65536 + 285 mov edx, msg_cf_pm xor ecx, ecx mov esi, 4 @@ -30,14 +30,14 @@ mov ecx, [update_time] call digit_len - mov edx, 160 * 65536 + 265 + mov edx, 160 * 65536 + 285 xor esi, esi mov eax, 47 int 0x40 ; Расставляем двоеточия mov eax, 4 - mov ebx, 152 * 65536 + 265 + mov ebx, 152 * 65536 + 285 mov edx, dub_p mov esi, 1 mov ecx, 0x10000000 diff --git a/programs/system/gmon/info_tab.inc b/programs/system/gmon/tab_info.inc similarity index 69% rename from programs/system/gmon/info_tab.inc rename to programs/system/gmon/tab_info.inc index 6ef23451d5..8bc16d7d41 100644 --- a/programs/system/gmon/info_tab.inc +++ b/programs/system/gmon/tab_info.inc @@ -8,16 +8,16 @@ ; Пишем параметры mov edx, lab_info_tab - mov ebx, 17 * 65536 + 265 + mov ebx, 17 * 65536 + 285 call show_text ; Пишем производителя процессора mov edx, Vendor mov esi, 12 - mov ebx, 160 * 65536 + 265 + mov ebx, 160 * 65536 + 285 int 0x40 ; Поддержка MMX - mov ebx, 160 * 65536 + 275 + mov ebx, 160 * 65536 + 305 mov esi, 3 mov edx, msg_yes cmp byte[CPU_mmx], 1 @@ -25,20 +25,40 @@ mov edx, msg_no mmx_en: int 0x40 ; Чип мониторинга - int 0x40 mov edx, [hwm_chip_name] mov al, byte[edx] movzx esi, al inc edx - mov ebx, 160 * 65536 + 285 + mov ebx, 160 * 65536 + 315 mov al, 4 int 0x40 + ; Частота процессора + mov eax, 18 + mov ebx, 5 + int 0x40 + push eax + fild dword[esp] + push 1000;000 + fidiv dword[esp] + fidiv dword[esp] + fstp dword[esp] + mov esi, esp + call ftoa + mov ebx, 160 * 65536 + 295 + mov edx, Data_String + mov eax, 4 + mov esi, 7 + xor ecx, ecx + int 0x40 + pop eax + pop eax + ; Семейство и модель процессора mov eax, 47 mov ebx, 0x10100 xor ecx, ecx mov cl, [CPU_fam] - mov edx, 250 * 65536 + 265 + mov edx, 250 * 65536 + 285 xor esi, esi int 0x40 mov cl, [CPU_mod] @@ -57,7 +77,7 @@ mmx_en: int 0x40 fstp dword[esp] mov esi, esp call ftoa - mov ebx, 160 * 65536 + 295 + mov ebx, 160 * 65536 + 325 mov edx, Data_String mov eax, 4 mov esi, eax @@ -74,17 +94,17 @@ if (OS_version >= 0x0530) mov ecx, eax call digit_len mov eax, 47 - mov edx, 160 * 65536 + 305 + mov edx, 160 * 65536 + 335 xor esi, esi int 0x40 end if ; Расставляем двоеточия mov eax, 4 - mov ebx, 152 * 65536 + 265 + mov ebx, 152 * 65536 + 285 mov edx, dub_p mov esi, 1 - mov ecx, 5 ; <- количество строк + mov ecx, 6 ; <- количество строк nxt_dp: push ecx mov ecx, 0x10000000 int 0x40 @@ -97,6 +117,7 @@ dub_p db ':' lab_info_tab mls \ 'CPU Vendor',\ + 'CPU frequency (MHz)',\ 'MMX tehnology',\ 'Monitoring chip',\ 'Multiplier',\ diff --git a/programs/system/gmon/test_tab.inc b/programs/system/gmon/tab_test.inc similarity index 85% rename from programs/system/gmon/test_tab.inc rename to programs/system/gmon/tab_test.inc index 6d9a1ce11c..52b3842a57 100644 --- a/programs/system/gmon/test_tab.inc +++ b/programs/system/gmon/tab_test.inc @@ -21,7 +21,7 @@ ; Pentium (P5) button mov eax, 8 mov ebx, 17 * 65536 + 145 - mov ecx, 277 * 65536 + 25 + mov ecx, 297 * 65536 + 25 mov edx, 6 mov esi, tcol cmp byte[Vendor + 11], 'l' @@ -70,7 +70,7 @@ k7n: int 0x40 ; mmxn: int 0x40 ; Пишем названия кнопок mov eax, 4 - mov ebx, 30 * 65536 + 287 + mov ebx, 30 * 65536 + 307 mov esi, 7 mov edx, tmsg_p ; P5 mov ecx, 0x10000000 @@ -78,14 +78,14 @@ k7n: int 0x40 jne nr1 mov ecx, 0x10FF0000 nr1: int 0x40 - mov ebx, 30 * 65536 + 287 + 27 + mov ebx, 30 * 65536 + 307 + 27 mov esi, 20 ; P6 mov ecx, 0x10000000 cmp byte[test_id], 7 jne nr2 mov ecx, 0x10FF0000 nr2: int 0x40 - mov ebx, 30 * 65536 + 287 + 27 + 27 + mov ebx, 30 * 65536 + 307 + 27 + 27 mov edx, tmsg_k6 ; K6 mov esi, 13 mov ecx, 0x10000000 @@ -93,7 +93,7 @@ nr2: int 0x40 jne nr3 mov ecx, 0x10FF0000 nr3: int 0x40 - mov ebx, 30 * 65536 + 287 + 27 + 27 + 27 + mov ebx, 30 * 65536 + 307 + 27 + 27 + 27 mov edx, tmsg_k7 ; K7 mov esi, 15 mov ecx, 0x10000000 @@ -101,7 +101,7 @@ nr3: int 0x40 jne nr4 mov ecx, 0x10FF0000 nr4: int 0x40 - ; mov ebx, 30 * 65536 + 287 + 27 + 27 + 27 + 27 + ; mov ebx, 30 * 65536 + 307 + 27 + 27 + 27 + 27 ; mov edx, tmsg_mmx ; MMX ; mov esi, 12 ; mov ecx, 0x10000000 @@ -111,12 +111,12 @@ nr4: int 0x40 ; nr5: int 0x40 ; recommendate mov ecx, 0x10000000 - mov ebx, 190 * 65536 + 400 + mov ebx, 190 * 65536 + 420 mov edx, tmsg_rec mov esi, 14 int 0x40 ; read about - mov ebx, 30 * 65536 + 262 + mov ebx, 30 * 65536 + 282 mov edx, tmsg_war mov esi, 34 mov ecx, 0x10FF0000 @@ -124,7 +124,7 @@ nr4: int 0x40 ; recommendate color mov eax, 13 mov ebx, 170 * 65536 + 10 - mov ecx, 398 * 65536 + 10 + mov ecx, 418 * 65536 + 10 mov edx, atcol int 0x40