diff options
Diffstat (limited to 'Kernel/HALKit')
| -rw-r--r-- | Kernel/HALKit/AMD64/HalUtils.asm (renamed from Kernel/HALKit/AMD64/HalInstallTIB.asm) | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Kernel/HALKit/AMD64/HalInstallTIB.asm b/Kernel/HALKit/AMD64/HalUtils.asm index 00fe2ad8..6681a692 100644 --- a/Kernel/HALKit/AMD64/HalInstallTIB.asm +++ b/Kernel/HALKit/AMD64/HalUtils.asm @@ -28,6 +28,9 @@ rt_install_tib: ;; @used rcx, address to jump on. ;; @note adjusted for long mode. rt_jump_user_mode: + cmp rcx, 0 + je rt_jump_user_mode_failed + mov ax, (6 * 8) | 3 ; user data segment with RPL 3 mov ds, ax mov es, ax @@ -38,6 +41,9 @@ rt_jump_user_mode: push (6 * 8) | 3 push rax pushf - push (5 * 8) | 3 + push (5 * 8) | 3 ; user code segment with RPL 3 push rcx iretq + ;; we just failed to validate the rcx, fallback and return to previous pc. +rt_jump_user_mode_failed: + ret
\ No newline at end of file |
