diff --git a/kernel/trunk/const.inc b/kernel/trunk/const.inc index 9c1f737a9..3ac6f08c2 100644 --- a/kernel/trunk/const.inc +++ b/kernel/trunk/const.inc @@ -218,10 +218,10 @@ KEY_BUFF equ (OS_BASE+0x000F401) BTN_COUNT equ (OS_BASE+0x000F500) BTN_BUFF equ (OS_BASE+0x000F501) -CPU_FREQ equ (OS_BASE+0x000F600) +;CPU_FREQ equ (OS_BASE+0x000F600) ;unused ? no active references -MOUSE_PORT equ (OS_BASE+0x000F604) +;MOUSE_PORT equ (OS_BASE+0x000F604) ;unused PS2_CHUNK equ (OS_BASE+0x000FB00) diff --git a/kernel/trunk/core/peload.inc b/kernel/trunk/core/peload.inc index 050fcfdbc..8cbccb3eb 100644 --- a/kernel/trunk/core/peload.inc +++ b/kernel/trunk/core/peload.inc @@ -335,7 +335,8 @@ __exports: delay_hs, 'Delay', \ ; ebx set_mouse_data, 'SetMouseData', \ ; set_keyboard_data, 'SetKeyboardData', \ ; gcc fastcall - timer_hs, 'TimerHs' ; stdcall + timer_hs, 'TimerHs', \ ; stdcall + get_cpu_freq, 'GetCpuFreq' diff --git a/kernel/trunk/data32.inc b/kernel/trunk/data32.inc index fca5911ed..87815cafe 100644 --- a/kernel/trunk/data32.inc +++ b/kernel/trunk/data32.inc @@ -81,7 +81,7 @@ if lang eq ru boot_pal_vga db 'Установка VGA 640x480 палитры',0 boot_failed db 'Загрузка первого приложения не удалась',0 boot_mtrr db 'Установка MTRR',0 - + boot_APIC_found db 'APIC включен', 0 boot_APIC_nfound db 'APIC не найден', 0 if preboot_blogesc @@ -119,7 +119,7 @@ else boot_pal_vga db 'Setting VGA 640x480 palette',0 boot_failed db 'Failed to start first app',0 boot_mtrr db 'Setting MTRR',0 - + boot_APIC_found db 'APIC enabled', 0 boot_APIC_nfound db 'APIC not found', 0 if preboot_blogesc @@ -332,6 +332,8 @@ mem_block_list rd 64*2 mem_used_list rd 64*2 mem_hash_cnt rd 64 +cpu_freq rq 1 + heap_mutex MUTEX heap_size rd 1 heap_free rd 1 diff --git a/kernel/trunk/gui/event.inc b/kernel/trunk/gui/event.inc index 9edee9f7d..f25e8387a 100644 --- a/kernel/trunk/gui/event.inc +++ b/kernel/trunk/gui/event.inc @@ -165,6 +165,7 @@ raise_event: ;; EXPORT use ; esi - event data (=0 => skip) ;scratched: ebx,ecx,esi,edi call NotDummyTest ; not returned for fail !!! + mov [check_idle_semaphore], 5 or esi, esi jz @f lea edi, [ebx+EVENT.code] diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 433d0e139..0f0f0f469 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -420,7 +420,7 @@ high_code: call calculate_fast_getting_offset_for_WinMapAddress ; for Qemu or non standart video cards -; Unfortunately [BytesPerScanLine] does not always +; Unfortunately [BytesPerScanLine] does not always ; equal to [_display.width] * [ScreenBPP] / 8 call calculate_fast_getting_offset_for_LFB @@ -837,16 +837,19 @@ end if rdtsc ;call _rdtsc sti sub eax, ecx + xor edx, edx + shld edx, eax, 2 shl eax, 2 - mov [CPU_FREQ], eax ; save tsc / sec -; mov ebx, 1000000 -; div ebx + mov dword [cpu_freq], eax + mov dword [cpu_freq+4], edx + mov ebx, 1000000 + div ebx ; вообще-то производительность в данном конкретном месте ; совершенно некритична, но чтобы заткнуть любителей ; оптимизирующих компиляторов ЯВУ... - mov edx, 2251799814 - mul edx - shr edx, 19 +; mov edx, 2251799814 +; mul edx +; shr edx, 19 mov [stall_mcs], edx ; PRINT CPU FREQUENCY mov esi, boot_cpufreq @@ -2240,10 +2243,14 @@ sysfn_getidletime: ; 18.4 = GET IDLETIME ret ;------------------------------------------------------------------------------ sysfn_getcpuclock: ; 18.5 = GET TSC/SEC - mov eax, [CPU_FREQ] + mov eax, dword [cpu_freq] mov [esp+32], eax ret ;------------------------------------------------------------------------------ +get_cpu_freq: + mov eax, dword [cpu_freq] + mov edx, dword [cpu_freq+4] + ret ; SAVE ramdisk to /hd/1/menuet.img ;!!!!!!!!!!!!!!!!!!!!!!!! include 'blkdev/rdsave.inc'