From a7cb2f3691c3afa618efbb35b24e9e8bacd1d702 Mon Sep 17 00:00:00 2001 From: Ivan Baravy Date: Mon, 26 Dec 2016 23:29:27 +0000 Subject: [PATCH] Set CR0.AM bit Allow applications to get Alignment Check exception git-svn-id: svn://kolibrios.org@6817 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/core/sys32.inc | 6 ++++-- kernel/trunk/kernel.asm | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/kernel/trunk/core/sys32.inc b/kernel/trunk/core/sys32.inc index eaa8ac45f1..1ffcafb20e 100644 --- a/kernel/trunk/core/sys32.inc +++ b/kernel/trunk/core/sys32.inc @@ -58,7 +58,8 @@ iglobal dw 0 ;просто выравнивание msg_fault_sel dd msg_exc_8,msg_exc_u,msg_exc_a,msg_exc_b - dd msg_exc_c,msg_exc_d,msg_exc_e + dd msg_exc_c,msg_exc_d,msg_exc_e,msg_exc_u + dd msg_exc_u,msg_exc_11 msg_exc_8 db "Double fault", 0 msg_exc_u db "Undefined Exception", 0 @@ -67,6 +68,7 @@ iglobal msg_exc_c db "Stack fault", 0 msg_exc_d db "General protection fault", 0 msg_exc_e db "Page fault", 0 + msg_exc_11 db "Alignment Check", 0 if lang eq sp include 'core/sys32-sp.inc' @@ -221,7 +223,7 @@ show_error_parameters: end if cmp bl, 0x08 jb .l0 - cmp bl, 0x0e + cmp bl, 0x11 jbe .l1 .l0: mov bl, 0x09 diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index f5db5e1437..b4ca4f0850 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -180,7 +180,7 @@ include "detect/biosdisk.inc" ; CR0 Flags - Protected mode and Paging - mov ecx, CR0_PE + mov ecx, CR0_PE+CR0_AM ; Enabling 32 bit protected mode