Rev 839 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 839 | Rev 847 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 839 $ |
8 | $Revision: 847 $ |
Line 71... | Line 71... | ||
71 | ; çäåñü äîëæíà çàïîëíÿòñÿ pci_emu_dat |
71 | ; çäåñü äîëæíà çàïîëíÿòñÿ pci_emu_dat |
72 | .BIOS32_not_found: |
72 | .BIOS32_not_found: |
73 | .end: |
73 | .end: |
74 | ret |
74 | ret |
Line 75... | Line -... | ||
75 | - | ||
76 | align 4 |
- | |
77 | proc test_cpu |
- | |
78 | locals |
- | |
79 | cpu_type dd ? |
- | |
80 | cpu_id dd ? |
- | |
81 | cpu_Intel dd ? |
- | |
82 | cpu_AMD dd ? |
- | |
83 | endl |
- | |
84 | - | ||
85 | mov [cpu_type], 0 |
- | |
86 | xor eax, eax |
- | |
87 | mov [cpu_caps-OS_BASE], eax |
- | |
88 | mov [cpu_caps+4-OS_BASE], eax |
- | |
89 | - | ||
90 | pushfd |
- | |
91 | pop eax |
- | |
92 | mov ecx, eax |
- | |
93 | xor eax, 0x40000 |
- | |
94 | push eax |
- | |
95 | popfd |
- | |
96 | pushfd |
- | |
97 | pop eax |
- | |
98 | xor eax, ecx |
- | |
99 | mov [cpu_type], CPU_386 |
- | |
100 | jz .end_cpuid |
- | |
101 | push ecx |
- | |
102 | popfd |
- | |
103 | - | ||
104 | mov [cpu_type], CPU_486 |
- | |
105 | mov eax, ecx |
- | |
106 | xor eax, 0x200000 |
- | |
107 | push eax |
- | |
108 | popfd |
- | |
109 | pushfd |
- | |
110 | pop eax |
- | |
111 | xor eax, ecx |
- | |
112 | je .end_cpuid |
- | |
113 | mov [cpu_id], 1 |
- | |
114 | - | ||
115 | xor eax, eax |
- | |
116 | cpuid |
- | |
117 | - | ||
118 | mov [cpu_vendor-OS_BASE], ebx |
- | |
119 | mov [cpu_vendor+4-OS_BASE], edx |
- | |
120 | mov [cpu_vendor+8-OS_BASE], ecx |
- | |
121 | cmp ebx, dword [intel_str-OS_BASE] |
- | |
122 | jne .check_AMD |
- | |
123 | cmp edx, dword [intel_str+4-OS_BASE] |
- | |
124 | jne .check_AMD |
- | |
125 | cmp ecx, dword [intel_str+8-OS_BASE] |
- | |
126 | jne .check_AMD |
- | |
127 | mov [cpu_Intel], 1 |
- | |
128 | cmp eax, 1 |
- | |
129 | jl .end_cpuid |
- | |
130 | mov eax, 1 |
- | |
131 | cpuid |
- | |
132 | mov [cpu_sign-OS_BASE], eax |
- | |
133 | mov [cpu_info-OS_BASE], ebx |
- | |
134 | mov [cpu_caps-OS_BASE], edx |
- | |
135 | mov [cpu_caps+4-OS_BASE],ecx |
- | |
136 | - | ||
137 | shr eax, 8 |
- | |
138 | and eax, 0x0f |
- | |
139 | ret |
- | |
140 | .end_cpuid: |
- | |
141 | mov eax, [cpu_type] |
- | |
142 | ret |
- | |
143 | - | ||
144 | .check_AMD: |
- | |
145 | cmp ebx, dword [AMD_str-OS_BASE] |
- | |
146 | jne .unknown |
- | |
147 | cmp edx, dword [AMD_str+4-OS_BASE] |
- | |
148 | jne .unknown |
- | |
149 | cmp ecx, dword [AMD_str+8-OS_BASE] |
- | |
150 | jne .unknown |
- | |
151 | mov [cpu_AMD], 1 |
- | |
152 | cmp eax, 1 |
- | |
153 | jl .unknown |
- | |
154 | mov eax, 1 |
- | |
155 | cpuid |
- | |
156 | mov [cpu_sign-OS_BASE], eax |
- | |
157 | mov [cpu_info-OS_BASE], ebx |
- | |
158 | mov [cpu_caps-OS_BASE], edx |
- | |
159 | mov [cpu_caps+4-OS_BASE],ecx |
- | |
160 | shr eax, 8 |
- | |
161 | and eax, 0x0f |
- | |
162 | ret |
- | |
163 | .unknown: |
- | |
164 | mov eax, 1 |
- | |
165 | cpuid |
- | |
166 | mov [cpu_sign-OS_BASE], eax |
- | |
167 | mov [cpu_info-OS_BASE], ebx |
- | |
168 | mov [cpu_caps-OS_BASE], edx |
- | |
169 | mov [cpu_caps+4-OS_BASE],ecx |
- | |
170 | shr eax, 8 |
- | |
171 | and eax, 0x0f |
- | |
172 | ret |
- |