Displaying 1 result from an estimated 1 matches for "afterbit".
Did you mean:
afterbits
2004 Oct 07
1
x86 vs. x86_64 detection proof of concept patch (try two)
...cpu a x86_64 machine?
;
; PXE packets which don't need static initialization
@@ -392,6 +393,27 @@
call writestr
;
+; ID the CPU: Shamelessly borrowed from the Linux kernel
arch/x86_64/kernel/head.S
+;
+ mov word [CpuIs64], 0
+ mov eax, 80000000h
+ cpuid
+ cmp eax, 80000000h
+ jbe afterbits
+ ; Check if long mode is implemented
+ mov eax, 80000001h
+ cpuid
+ bt edx, 29
+ jnc afterbits
+ mov word [CpuIs64], 1
+afterbits:
+ mov si, cpu64_str
+ cmp word [CpuIs64], 1
+ je writecpustr
+ mov si, cpu32_str
+writecpustr: call writestr
+
+;
; Assume API version 2.1, in case we fin...