mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Load null selectors to all data registers
This is required for some instructions such as iretq (ss must be valid or 0).
(cherry picked from commit 8f8b46a9b6)
This commit is contained in:
@@ -13,6 +13,14 @@ extern rust_main
|
||||
section .text
|
||||
bits 64
|
||||
long_mode_start:
|
||||
; load 0 into all data segment registers
|
||||
mov ax, 0
|
||||
mov ss, ax
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov fs, ax
|
||||
mov gs, ax
|
||||
|
||||
; call rust main (with multiboot pointer in rdi)
|
||||
call rust_main
|
||||
.os_returned:
|
||||
|
||||
Reference in New Issue
Block a user