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:
Philipp Oppermann
2017-01-14 16:38:33 +01:00
parent b3ddd18e7a
commit 43ef84d68a

View File

@@ -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: