Skip to content

Commit

Permalink
Use native fpu exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ergo720 committed Aug 27, 2024
1 parent 0e73245 commit 164e636
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions nboxkrnl/ki/ki.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define EXCEPTION_CHAIN_END reinterpret_cast<EXCEPTION_REGISTRATION_RECORD *>(EXCEPTION_CHAIN_END2)

// cr0 flags
#define CR0_NE (1 << 5) // numeric error
#define CR0_TS (1 << 3) // task switched
#define CR0_EM (1 << 2) // emulation
#define CR0_MP (1 << 1) // monitor coprocessor
Expand Down
5 changes: 5 additions & 0 deletions nboxkrnl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
xor ebp, ebp
mov esp, offset KiIdleThreadStack + KERNEL_STACK_SIZE - (SIZE FX_SAVE_AREA + SIZE KSTART_FRAME + SIZE KSWITCHFRAME)

// Update cr0
mov eax, cr0
or eax, CR0_NE
mov cr0, eax

// Initialize the CRT of the kernel executable
call InitializeCrt

Expand Down

0 comments on commit 164e636

Please sign in to comment.