1
0
Fork 0
mirror of https://gitlab.com/bztsrc/bootboot.git synced 2023-02-13 20:54:32 -05:00

Make sure long mode CR0 is consistent on BIOS and UEFI

This commit is contained in:
bzt 2020-07-04 23:37:45 +02:00
parent c9eaba0a98
commit 5c3122774e
9 changed files with 5 additions and 9 deletions

BIN
dist/bootboot.bin vendored

Binary file not shown.

BIN
dist/bootboot.efi vendored

Binary file not shown.

BIN
dist/bootboot.rom vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View file

@ -1551,7 +1551,7 @@ end if
xor eax, eax xor eax, eax
repnz stosd repnz stosd
mov dword [ebx+0], '// N' mov dword [ebx+0], '// N'
mov dword [ebx+4], '/A\n' mov dword [ebx+4], '/A' or (10 shl 16)
.parseend: .parseend:
;-----load /sys/core------ ;-----load /sys/core------
@ -2165,9 +2165,7 @@ longmode_init:
or eax, 100h ;enable long mode or eax, 100h ;enable long mode
wrmsr wrmsr
mov eax, cr0 mov eax, 0C0000011h ;clear EM, MP (enable SSE) and WP
and al, 0FBh ;clear EM, MP (enable SSE)
or eax, 0C0000001h
mov cr0, eax ;enable paging with cache disabled mov cr0, eax ;enable paging with cache disabled
lgdt [GDT_value] ;read 80 bit address lgdt [GDT_value] ;read 80 bit address
jmp @f jmp @f

View file

@ -1300,9 +1300,7 @@ VOID EFIAPI bootboot_startcore(IN VOID* buf)
// enable SSE // enable SSE
__asm__ __volatile__ ( __asm__ __volatile__ (
"movq %%cr0, %%rax;" "movl $0xC0000011, %%eax;"
"andb $0xfb, %%al;"
"orl $0xC0000001, %%eax;"
"movq %%rax, %%cr0;" "movq %%rax, %%cr0;"
"movq %%cr4, %%rax;" "movq %%cr4, %%rax;"
"orw $3 << 8, %%ax;" "orw $3 << 8, %%ax;"