Subversion Repositories Kolibri OS

Rev

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

Rev 5787 Rev 5792
Line 69... Line 69...
69
format binary as "mnt"
69
format binary as "mnt"
Line 70... Line 70...
70
 
70
 
71
include 'macros.inc'
71
include 'macros.inc'
Line 72... Line 72...
72
include 'struct.inc'
72
include 'struct.inc'
Line 73... Line 73...
73
 
73
 
74
$Revision: 5787 $
74
$Revision: 5792 $
Line 699... Line 699...
699
        mov     [clipboard_main_list], eax
699
        mov     [clipboard_main_list], eax
Line 700... Line 700...
700
 
700
 
701
        mov     eax, [hpet_base]
701
        mov     eax, [hpet_base]
702
        test    eax, eax
702
        test    eax, eax
703
        jz      @F
-
 
704
        DEBUGF  1, "K : HPET base %x\n", eax
-
 
705
        mov     eax, [hpet_period]
-
 
706
        DEBUGF  1, "K : HPET period %d\n", eax
-
 
707
        mov     eax, [hpet_timers]
-
 
708
        DEBUGF  1, "K : HPET timers %d\n", eax
-
 
709
 
703
        jz      @F
710
        mov     eax, [hpet_base]
704
        mov     eax, [hpet_base]
711
        stdcall map_io_mem, [hpet_base], 1024, PG_GLOBAL+PAT_UC+PG_SWR
705
        stdcall map_io_mem, [hpet_base], 1024, PG_GLOBAL+PAT_UC+PG_SWR
712
        mov     [hpet_base], eax
-
 
713
 
706
        mov     [hpet_base], eax
714
        mov     eax, [eax]
707
        mov     eax, [eax]
715
        DEBUGF  1, "K : HPET caps %x\n", eax
-
 
716
 
708
        DEBUGF  1, "K : HPET caps %x\n", eax
717
@@:
709
@@:
Line 718... Line 710...
718
; SET UP OS TASK
710
; SET UP OS TASK
719
 
711
 
Line 1039... Line 1031...
1039
; PRINT CPU FREQUENCY
1031
; PRINT CPU FREQUENCY
Line 1040... Line 1032...
1040
 
1032
 
1041
        mov     esi, boot_cpufreq
1033
        mov     esi, boot_cpufreq
Line -... Line 1034...
-
 
1034
        call    boot_log
-
 
1035
 
-
 
1036
        cli
-
 
1037
        mov     ebx, [hpet_base]
-
 
1038
        test    ebx, ebx
-
 
1039
        jz      @F
-
 
1040
        mov     ebx, [ebx+0xF0]
-
 
1041
 
-
 
1042
        rdtsc
-
 
1043
        mov     ecx, 1000
-
 
1044
        sub     eax, [hpet_tsc_start]
-
 
1045
        sbb     edx, [hpet_tsc_start+4]
-
 
1046
        shld    edx, eax, 10
-
 
1047
        shl     eax, 10
-
 
1048
        mov     esi, eax
-
 
1049
        mov     eax, edx
-
 
1050
        mul     ecx
-
 
1051
        xchg    eax, esi
-
 
1052
        mul     ecx
-
 
1053
        adc     edx, esi
-
 
1054
        div     ebx
-
 
1055
        mul     ecx
1042
        call    boot_log
1056
        div     [hpet_period]
-
 
1057
        mul     ecx
-
 
1058
        DEBUGF  1, "K : cpu frequency %u Hz\n", eax
1043
 
1059
        jmp     .next
1044
        cli                         ;FIXME check IF
1060
@@:
1045
        rdtsc
1061
        rdtsc
1046
        mov     ecx, eax
1062
        mov     ecx, eax
1047
        mov     esi, 250            ; wait 1/4 a second
1063
        mov     esi, 250            ; wait 1/4 a second
Line 1051... Line 1067...
1051
 
1067
 
1052
        sub     eax, ecx
1068
        sub     eax, ecx
1053
        xor     edx, edx
1069
        xor     edx, edx
1054
        shld    edx, eax, 2
1070
        shld    edx, eax, 2
-
 
1071
        shl     eax, 2
1055
        shl     eax, 2
1072
.next:
1056
        mov     dword [cpu_freq], eax
1073
        mov     dword [cpu_freq], eax
1057
        mov     dword [cpu_freq+4], edx
1074
        mov     dword [cpu_freq+4], edx
1058
        mov     ebx, 1000000
1075
        mov     ebx, 1000000
1059
        div     ebx
1076
        div     ebx