mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-07 15:03:34 +00:00
Update commentary in ape.S
This commit is contained in:
parent
c5de653b98
commit
c8a9d3458e
1 changed files with 11 additions and 11 deletions
20
ape/ape.S
20
ape/ape.S
|
@ -1406,12 +1406,12 @@ longmodeloader:
|
||||||
.endfn longmodeloader
|
.endfn longmodeloader
|
||||||
|
|
||||||
// Long Mode Hardware Check
|
// Long Mode Hardware Check
|
||||||
lcheck: pushf # check for i8086 / i8088 / i80186
|
lcheck: pushf # checks for i8086 / i8088 / i80186
|
||||||
pop %ax
|
pop %ax # see intel manual volume 1 §20.1.2
|
||||||
test $0x80,%ah # see intel manual volume 1 20.1.2
|
test $0x80,%ah
|
||||||
jnz 10f # we now assume 32 bit is supported
|
jnz 10f # we now assume 32 bit is supported
|
||||||
pushfl # now check for i386 or early i486
|
pushfl # now check for i386, or early i486
|
||||||
pop %eax # test ability to change cpuid bit
|
pop %eax # tests ability to change cpuid bit
|
||||||
mov %eax,%ecx
|
mov %eax,%ecx
|
||||||
mov $1<<21,%ebx
|
mov $1<<21,%ebx
|
||||||
xor %ebx,%eax
|
xor %ebx,%eax
|
||||||
|
@ -1424,16 +1424,16 @@ lcheck: pushf # check for i8086 / i8088 / i80186
|
||||||
or %ebx,%eax # puts cpuid bit in the on position
|
or %ebx,%eax # puts cpuid bit in the on position
|
||||||
push %eax
|
push %eax
|
||||||
popfl
|
popfl
|
||||||
mov $0x80000000,%edi # get amd ext cpuid thingy length
|
mov $0x80000000,%edi # get amd64 ext cpuid thingy length
|
||||||
mov %edi,%eax
|
mov %edi,%eax
|
||||||
inc %edi
|
inc %edi
|
||||||
cpuid # clobbers eax, ebx, ecx, and edx
|
cpuid # leaf 0x80000000, clob ax/bx/cx/dx
|
||||||
cmp %edi,%eax
|
cmp %edi,%eax
|
||||||
jl 10f
|
jl 10f
|
||||||
mov %edi,%eax
|
mov %edi,%eax
|
||||||
cpuid
|
cpuid # leaf 0x80000001, clob ax/bx/cx/dx
|
||||||
mov $1<<29|1<<20,%edi # need nexgen32e long mode support
|
mov $1<<29|1<<20,%edi # 29 = LM (long), 20 = NX (no exec)
|
||||||
and %edi,%edx # & nx support
|
and %edi,%edx # we need to both, or we won't work
|
||||||
cmp %edi,%edx
|
cmp %edi,%edx
|
||||||
jne 10f
|
jne 10f
|
||||||
xor %ax,%ax
|
xor %ax,%ax
|
||||||
|
|
Loading…
Reference in a new issue