Subversion Repositories Kolibri OS

Rev

Rev 241 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 241 Rev 313
Line -... Line 1...
-
 
1
;
-
 
2
; Ghost Monitor - óòèëèòà (ñòðåññ) òåñòèðîâàíèÿ è ìîíèòîðèíãà ñèñòåìû
-
 
3
; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru)
-
 
4
; All Right Reserved
-
 
5
 
1
;--------------------------------------------------------------------
6
;--------------------------------------------------------------------
2
; Çàãðóçêà ïðîöåññîðà
7
; Çàãðóçêà ïðîöåññîðà
3
; OUT : AL - çàãðóçêà â ïðîöåíòàõ
8
; OUT : AL - çàãðóçêà â ïðîöåíòàõ
4
cpu_usage:
9
cpu_usage:
5
	pusha
10
	pusha
Line 257... Line 262...
257
	mul	dl
262
	mul	dl
258
	mov	cl, al
263
	mov	cl, al
259
	ret
264
	ret
260
@@:	cmp	byte [CPU_mod], 2
265
@@:	cmp	byte [CPU_mod], 2
261
	jae	@f
266
	jae	@f
262
	mov	eax, 68		; Pentium 4 / Xeon (model < 2)
267
	mov	eax, 68		; Pentium 4 / Xeon (model < 2) Willamete
263
	mov	ebx, 3
268
	mov	ebx, 3
264
	mov	edx, 0x2A
269
	mov	edx, 0x2A
265
	int	0x40
270
	int	0x40
266
	shr	eax, 8
271
	shr	eax, 8
267
	and	eax, 0x0F
272
	and	eax, 0x0F
268
	mov	cl, [p4coef + eax]
273
	mov	cl, [p4coef + eax]
269
	ret
274
	ret
270
@@:	mov	eax, 68		; Pentium 4 / Xeon (model >= 2)
275
@@:	mov	eax, 68		; Pentium 4 / Xeon (model >= 2) NorthWood
271
	mov	ebx, 3
276
	mov	ebx, 3
272
	mov	edx, 0x2C
277
	mov	edx, 0x2C
273
	int	0x40
278
	int	0x40
274
	
-
 
275
	; shr	eax, 24
279
	shr	eax, 24
276
	; and	eax, 0x1F
280
	and	eax, 0x1F
277
	shr	eax, 27
-
 
278
	and	al, 0Fh
-
 
279
	add	al, 8
-
 
280
	
-
 
281
	mov	dl, 10
281
	mov	dl, 10
282
	mul	dl
282
	mul	dl
283
	mov	cl, al
283
	mov	cl, al
284
	ret	
284
	ret	
285
noIntelP4:
285
noIntelP4:
Line 320... Line 320...
320
athloncoef	db	110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 120
320
athloncoef	db	110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 120
321
		db	190, 120, 200, 130, 135, 140, 210, 150, 220, 160, 165, 170, 180, 230, 240
321
		db	190, 120, 200, 130, 135, 140, 210, 150, 220, 160, 165, 170, 180, 230, 240
322
athlonmcoef:	db	110, 115, 120, 125, 50, 55, 60, 65,  70, 75, 80, 85, 90, 95, 100, 105
322
athlonmcoef:	db	110, 115, 120, 125, 50, 55, 60, 65,  70, 75, 80, 85, 90, 95, 100, 105
323
		db	30, 190, 40, 200, 130, 135, 14, 210, 150, 220, 160, 165, 170, 230, 240
323
		db	30, 190, 40, 200, 130, 135, 14, 210, 150, 220, 160, 165, 170, 230, 240
324
athloncoef3	db	45, 50, 40, 55, 25, 30, 60, 35
324
athloncoef3	db	45, 50, 40, 55, 25, 30, 60, 35
325
p4coef		db	160, 170, 180, 190, 200, 210, 220, 230, 80, 90, 100, 110, 120, 130, 140, 150	; Pentium 4
325
p4coef		db	160, 170, 180, 190, 200, 210, 220, 230, 80, 90, 100, 110, 120, 130, 140, 150	; Pentium 4 (Willamete)
326
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
326
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
327
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
327
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
328
else
328
else
329
	display nl, 'Multiplier : no'
329
	display nl, 'Multiplier : no'
330
	ret
330
	ret