Test kernel bootstrap

This commit is contained in:
Alex
2023-04-29 06:52:22 +03:00
parent 069386b0f2
commit ea1b0bb72a
39 changed files with 7725 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
[bits 32]
global Detect64Bit
Detect64Bit:
mov eax, 0x80000000
cpuid
cmp eax, 0x80000001
jb .NoLongMode
mov eax, 0x80000001
cpuid
test edx, 1 << 29
jz .NoLongMode
mov eax, 1
ret
.NoLongMode:
xor eax, eax
ret

View File

@@ -0,0 +1,20 @@
[bits 32]
global DetectCPUID
DetectCPUID:
pushfd
pop eax
mov ecx, eax
xor eax, 1 << 21
push eax
popfd
pushfd
pop eax
push ecx
popfd
xor eax, ecx
jz .NoCPUID
mov eax, 1
ret
.NoCPUID:
xor eax, eax
ret