Improve comments in code as well

This commit is contained in:
Philipp Oppermann
2016-02-02 23:11:19 +01:00
parent bb4d64dc99
commit de2305038a

View File

@@ -148,14 +148,17 @@ check_cpuid:
; Throw error 2 if the CPU doesn't support Long Mode. ; Throw error 2 if the CPU doesn't support Long Mode.
check_long_mode: check_long_mode:
mov eax, 0x80000000 ; Set the A-register to 0x80000000. ; test if extended processor info in available
cpuid ; CPU identification. mov eax, 0x80000000 ; implicit argument for cpuid
cmp eax, 0x80000001 ; Compare the A-register with 0x80000001. cpuid ; get highest supported argument
jb .no_long_mode ; It is less, there is no long mode. cmp eax, 0x80000001 ; it needs to be at least 0x80000001
mov eax, 0x80000001 ; Set the A-register to 0x80000001. jb .no_long_mode ; if it's less, the CPU is too old for long mode
cpuid ; CPU identification.
test edx, 1 << 29 ; Test if the LM-bit, which is bit 29, is set in the D-register. ; use extended info to test if long mode is available
jz .no_long_mode ; They aren't, there is no long mode. mov eax, 0x80000001 ; argument for extended processor info
cpuid ; returns various feature bits in ecx and edx
test edx, 1 << 29 ; test if the LM-bit is set in the D-register
jz .no_long_mode ; If it's not set, there is no long mode
ret ret
.no_long_mode: .no_long_mode:
mov al, "2" mov al, "2"