mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Boot: Fix undefined Multiboot behaviors
Both ESP and GDTR are left undefined by the Multiboot specification and OS images must not rely on these values to be valid. Fix the undefined behaviors so that booting with PXELINUX does not triple-fault the CPU.
This commit is contained in:
parent
cb29dca029
commit
6677ab1ccd
Notes:
sideshowbarker
2024-07-18 23:03:29 +09:00
Author: https://github.com/boricj Commit: https://github.com/SerenityOS/serenity/commit/6677ab1ccd2 Pull-request: https://github.com/SerenityOS/serenity/pull/5002
1 changed files with 7 additions and 7 deletions
|
@ -194,10 +194,13 @@ start:
|
|||
orl $0x80000000, %eax
|
||||
movl %eax, %cr0
|
||||
|
||||
/* set up stack */
|
||||
mov $stack_top, %esp
|
||||
and $-16, %esp
|
||||
|
||||
/* jmp to an address above the 3GB mark */
|
||||
push %cs
|
||||
push $1f
|
||||
retf
|
||||
movl $1f,%eax
|
||||
jmp *%eax
|
||||
1:
|
||||
movl %cr3, %eax
|
||||
movl %eax, %cr3
|
||||
|
@ -212,10 +215,7 @@ start:
|
|||
addl $8, %edi
|
||||
loop 1b
|
||||
|
||||
/* set up initial stack and jump into C++ land */
|
||||
mov $stack_top, %esp
|
||||
and $-16, %esp
|
||||
|
||||
/* jump into C++ land */
|
||||
addl $0xc0000000, %ebx
|
||||
movl %ebx, multiboot_info_ptr
|
||||
|
||||
|
|
Loading…
Reference in a new issue