mirror of
https://github.com/Fennix-Project/Lynx.git
synced 2025-07-17 10:01:40 +00:00
Test kernel bootstrap
This commit is contained in:
16
FennixLoader/Detect/Detect64.asm
Normal file
16
FennixLoader/Detect/Detect64.asm
Normal 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
|
20
FennixLoader/Detect/DetectCPUID.asm
Normal file
20
FennixLoader/Detect/DetectCPUID.asm
Normal 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
|
Reference in New Issue
Block a user