Персональный сайт

Сергея Кузьмина

Bugfix for MenuetOS - Evolution

Real frequency

Original bug

My first bugfix

My second bugfix

My FINAL FIX (now difference < 0.01 MHz)

I'm working on CPUID utility for MenuetOS now. I'm found a bug in KERNEL.ASM during testing. It causes wrong value for CPU frequency (sysfunc 18 subfunc 5).

Please, see at this:

delay_ms: ; delay in 1/1000 sec
push eax
push ecx
mov ecx,esi
;-------------------------------------------------
imul ecx,66 <----- wrong
;-------------------------------------------------
in al,0x61
and al,0x10
mov ah,al
cld
For getting more correct CPU frequency you must replace '''' imul ecx,66 '''' by this:

; Fix for CPU clock detection by Sergey Kuzmin aka Wildwest <kuzmin_serg [at] list.ru>
;10/22/2004

imul ecx, 33941
shr ecx, 9

;10/22/2004
;Fix for CPU clock detection by Sergey Kuzmin aka Wildwest <kuzmin_serg [at] list.ru>


Hosted by uCoz