128,12 → 128,12 |
mov [pg_data.kernel_tables-OS_BASE], edx |
|
xor eax, eax |
mov edi, sys_pgdir-OS_BASE |
mov ecx, 4096/4 |
mov edi, sys_proc-OS_BASE |
mov ecx, 8192/4 |
cld |
rep stosd |
|
mov edx, (sys_pgdir-OS_BASE)+ 0x800; (OS_BASE shr 20) |
mov edx, (sys_proc-OS_BASE+PROC.pdt_0)+ 0x800; (OS_BASE shr 20) |
bt [cpu_caps-OS_BASE], CAPS_PSE |
jnc .no_PSE |
|
177,9 → 177,9 |
dec ecx |
jnz .map_kernel_tabs |
|
mov dword [sys_pgdir-OS_BASE+(page_tabs shr 20)], sys_pgdir+PG_SW-OS_BASE |
mov dword [sys_proc-OS_BASE+PROC.pdt_0+(page_tabs shr 20)], sys_proc+PROC.pdt_0+PG_SW-OS_BASE |
|
mov edi, (sys_pgdir-OS_BASE) |
mov edi, (sys_proc+PROC.pdt_0-OS_BASE) |
lea esi, [edi+(OS_BASE shr 20)] |
movsd |
movsd |
345,9 → 345,6 |
proc test_cpu |
locals |
cpu_type dd ? |
cpu_id dd ? |
cpu_Intel dd ? |
cpu_AMD dd ? |
endl |
|
xor eax, eax |
354,6 → 351,7 |
mov [cpu_type], eax |
mov [cpu_caps-OS_BASE], eax |
mov [cpu_caps+4-OS_BASE], eax |
mov [cpu_phys_addr_width-OS_BASE], 32 |
|
pushfd |
pop eax |
378,7 → 376,6 |
pop eax |
xor eax, ecx |
je .end_cpuid |
mov [cpu_id], 1 |
|
xor eax, eax |
cpuid |
386,13 → 383,7 |
mov [cpu_vendor-OS_BASE], ebx |
mov [cpu_vendor+4-OS_BASE], edx |
mov [cpu_vendor+8-OS_BASE], ecx |
cmp ebx, dword [intel_str-OS_BASE] |
jne .check_AMD |
cmp edx, dword [intel_str+4-OS_BASE] |
jne .check_AMD |
cmp ecx, dword [intel_str+8-OS_BASE] |
jne .check_AMD |
mov [cpu_Intel], 1 |
|
cmp eax, 1 |
jl .end_cpuid |
mov eax, 1 |
402,6 → 393,20 |
mov [cpu_caps-OS_BASE], edx |
mov [cpu_caps+4-OS_BASE], ecx |
|
bt edx, CAPS_PAE |
jnc @f |
mov [cpu_phys_addr_width-OS_BASE], 36 |
@@: |
mov eax, 0x80000000 |
cpuid |
cmp eax, 0x80000008 |
jb @f |
mov eax, 0x80000008 |
cpuid |
mov [cpu_phys_addr_width-OS_BASE], al |
@@: |
|
mov eax, [cpu_sign-OS_BASE] |
shr eax, 8 |
and eax, 0x0f |
ret |
408,36 → 413,6 |
.end_cpuid: |
mov eax, [cpu_type] |
ret |
|
.check_AMD: |
cmp ebx, dword [AMD_str-OS_BASE] |
jne .unknown |
cmp edx, dword [AMD_str+4-OS_BASE] |
jne .unknown |
cmp ecx, dword [AMD_str+8-OS_BASE] |
jne .unknown |
mov [cpu_AMD], 1 |
cmp eax, 1 |
jl .unknown |
mov eax, 1 |
cpuid |
mov [cpu_sign-OS_BASE], eax |
mov [cpu_info-OS_BASE], ebx |
mov [cpu_caps-OS_BASE], edx |
mov [cpu_caps+4-OS_BASE], ecx |
shr eax, 8 |
and eax, 0x0f |
ret |
.unknown: |
mov eax, 1 |
cpuid |
mov [cpu_sign-OS_BASE], eax |
mov [cpu_info-OS_BASE], ebx |
mov [cpu_caps-OS_BASE], edx |
mov [cpu_caps+4-OS_BASE], ecx |
shr eax, 8 |
and eax, 0x0f |
ret |
endp |
|
iglobal |